Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:configurations:device-tree-overlay

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:vim4:configurations:device-tree-overlay [2022/07/06 02:59]
nick
products:sbc:vim4:configurations:device-tree-overlay [2022/09/28 08:45] (current)
nick
Line 1: Line 1:
-====== Device Tree Overlay ======+{{indexmenu_n>5}}
  
-===== Introduction ===== 
  
-You can use Device Tree Overlay feature to enable/disable some hardware functions without to recompile the kernel source code.+====== VIM4 Device Tree Overlay ======
  
-===== Configuration ===== 
  
-The dtbo files are stored in directory ''/boot/dtb/amlogic/kvim4.dtb.overlays'': +{{page>products:sbc:common:configurations:device-tree-overlay&noheader}}
- +
-``` +
-khadas@Khadas:~$ ls -al /boot/dtb/amlogic/kvim4.dtb.overlays/ +
-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 ''/boot/dtb/amlogic/kvim4.dtb.overlay.env'' +
- +
-``` +
-khadas@Khadas:~$ ls /boot/dtb/amlogic/kvim4.dtb.overlay.env  +
-/boot/dtb/amlogic/kvim4.dtb.overlay.env +
-``` +
- +
-===== 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. +
- +
- +
-```sh +
-khadas@Khadas:~$ ll /boot/dtb/overlays/kvim3 +
-``` +
- +
-  * Write your own device tree overlay file, for example `example.dts`: ``` +
-/dts-v1/; +
-/plugin/; +
- +
-/ { +
-    fragment@0 { +
-        target = <&i2c3>; +
- +
-        __overlay__ { +
-            status = "okay"; +
-        }+
-    }+
-}; +
-``` +
- +
-This device tree overlay is to enable `i2c3`. +
- +
-  * Compile it to dtbo ``` +
-khadas@Khadas:~$ dtc -I dts -O dtb -o example.dtbo example.dts +
-khadas@Khadas:~$ ls example.dtbo +
-example.dtbo +
-``` +
- +
-  * Move the dtbo file to ''/boot/dtb/overlays/kvim3'' +
- +
-  * Edit ''/boot/env.txt'' to add in node ''overlays'' +
- +
-  * Reboot the board+
Last modified: 2022/07/06 02:59 by nick