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 03:10] 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 |
| - | The dtbo files are stored in directory ''/ | ||
| - | ``` | + | {{page> |
| - | khadas@Khadas:~$ ls -al / | + | |
| - | total 28 | + | |
| - | drwxr-xr-x 2 root root 4096 Jul 6 14:55 . | + | |
| - | drwxr-xr-x 3 root root 4096 Jul 6 14:55 .. | + | |
| - | -rwxr-xr-x 1 root root 462 Jul 6 14:55 ext_board.dtbo | + | |
| - | -rwxr-xr-x 1 root root 223 Jul 6 14:55 i2cm_a.dtbo | + | |
| - | -rwxr-xr-x 1 root root 223 Jul 6 14:55 i2cm_f.dtbo | + | |
| - | -rwxr-xr-x 1 root root 225 Jul 6 14:55 pwm_f.dtbo | + | |
| - | -rwxr-xr-x 1 root root 225 Jul 6 14:55 uart_e.dtbo | + | |
| - | ``` | + | |
| - | + | ||
| - | The releated dtbo configuration file is ''/ | + | |
| - | + | ||
| - | ``` | + | |
| - | khadas@Khadas: | + | |
| - | / | + | |
| - | ``` | + | |
| - | + | ||
| - | ===== Configuration ===== | + | |
| - | + | ||
| - | If you want to enable some functions, you can edit the dtbo configuration file ''/ | + | |
| - | + | ||
| - | For example, if you want to enable '' | + | |
| - | + | ||
| - | ``` | + | |
| - | khadas@Khadas: | + | |
| - | fdt_overlays=i2cm_a | + | |
| - | ``` | + | |
| - | + | ||
| - | Save the file and reboot the system to take effect. | + | |
| - | + | ||
| - | ===== 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. | + | |
| - | + | ||
| - | + | ||
| - | * Write your own device tree overlay file, for example '' | + | |
| - | /dts-v1/; | + | |
| - | /plugin/; | + | |
| - | + | ||
| - | / { | + | |
| - | fragment@0 { | + | |
| - | target = <&i2c5>; | + | |
| - | + | ||
| - | __overlay__ { | + | |
| - | status = " | + | |
| - | | + | |
| - | | + | |
| - | }; | + | |
| - | ``` | + | |
| - | + | ||
| - | This device tree overlay is to enable '' | + | |
| - | + | ||
| - | * Compile it to dtbo ``` | + | |
| - | khadas@Khadas: | + | |
| - | khadas@Khadas: | + | |
| - | example.dtbo | + | |
| - | ``` | + | |
| - | + | ||
| - | * Copy the dtbo file to ''/ | + | |
| - | + | ||
| - | * Edit ''/ | + | |
| - | + | ||
| - | * Reboot the board | + | |