This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:vim4:configurations:device-tree-overlay [2022/07/06 02:46] nick |
products:sbc:vim4:configurations:device-tree-overlay [2022/09/28 08:45] (current) nick |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Device Tree Overlay ====== | + | {{indexmenu_n> |
- | ===== Introduction ===== | ||
- | You can use Device Tree Overlay | + | ====== VIM4 Device Tree Overlay |
- | ===== Install Device Tree Overlay Debian Package ===== | ||
- | + | {{page> | |
- | You can find the device tree overlays configuration in `/ | + | |
- | + | ||
- | ```bash | + | |
- | # Device Tree Overlays | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | overlays=uart3 pwm_f i2c3 os08a10 | + | |
- | ``` | + | |
- | + | ||
- | `uart3 pwm_f i2c3 os08a10` are enabled by default. | + | |
- | + | ||
- | * If you want to disable `pwm_f` you can remove `pwm_f` in `overlays` node. | + | |
- | + | ||
- | * If you want to enable `onewire`, you can add `onewire` to `overlays` node. | + | |
- | + | ||
- | {% note info Note %} | + | |
- | + | ||
- | You need to save the file `/ | + | |
- | + | ||
- | {% endnote %} | + | |
- | + | ||
- | ## Make Your Own DTBO Files | + | |
- | + | ||
- | There are some ready to use dtbo files, you can also add your own dtbos to enable or disable the peripherals. | + | |
- | + | ||
- | The default dtbo files are stored in directory: `/ | + | |
- | + | ||
- | ```bash | + | |
- | khadas@Khadas:~$ ll / | + | |
- | total 40 | + | |
- | drwxr-xr-x 2 root root 4096 Jan 29 11:13 ./ | + | |
- | drwxr-xr-x 6 root root 4096 Jan 29 11:13 ../ | + | |
- | -rw-r--r-- 1 root root 352 Jan 29 09:35 disable-ts050.dtbo | + | |
- | -rw-r--r-- 1 root root 223 Jan 29 09:35 i2c3.dtbo | + | |
- | -rw-r--r-- 1 root root 277 Jan 29 09:35 m2x-eth.dtbo | + | |
- | -rw-r--r-- 1 root root 472 Jan 29 09:35 onewire.dtbo | + | |
- | -rw-r--r-- 1 root root 1072 Jan 29 09:35 os08a10.dtbo | + | |
- | -rw-r--r-- 1 root root 345 Jan 29 09:35 pwm_f.dtbo | + | |
- | -rw-r--r-- 1 root root 447 Jan 29 09:35 spi1.dtbo | + | |
- | -rw-r--r-- 1 root root 225 Jan 29 09:35 uart3.dtbo | + | |
- | ``` | + | |
- | + | ||
- | * Write your own device tree overlay | + | |
- | + | ||
- | ``` | + | |
- | /dts-v1/; | + | |
- | /plugin/; | + | |
- | + | ||
- | / { | + | |
- | fragment@0 { | + | |
- | target = <&i2c3>; | + | |
- | + | ||
- | __overlay__ { | + | |
- | status = " | + | |
- | | + | |
- | | + | |
- | }; | + | |
- | ``` | + | |
- | + | ||
- | This device tree overlay is to enable `i2c3`. | + | |
- | + | ||
- | * Compile it to dtbo | + | |
- | + | ||
- | ``` | + | |
- | khadas@Khadas: | + | |
- | khadas@Khadas: | + | |
- | example.dtbo | + | |
- | ``` | + | |
- | + | ||
- | * Move the dtbo file to `/ | + | |
- | + | ||
- | * Edit `/ | + | |
- | + | ||
- | * Reboot the board | + |