This is an old revision of the document!
You can use Device Tree Overlay feature to enable/disable some hardware functions without to recompile the kernel source code.
The dtbo files are stored in directory /boot/dtb/amlogic/kvim4.dtb.overlays
:
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
If you want to enable some functions, you can edit the dtbo configuration file /boot/dtb/amlogic/kvim4.dtb.overlay.env
and add the dtbo name to node fdt_overlays
.
For example, if you want to enable I2CM_F
, you can edit /boot/dtb/amlogic/kvim4.dtb.overlay.env
and add i2cm_a
to node fdt_overlays
.
khadas@Khadas:~$ cat /boot/dtb/amlogic/kvim4.dtb.overlay.env fdt_overlays=i2cm_a
Save the file and reboot the system to take effect.
There are some ready to use dtbo files, you can also add your own dtbos to enable or disable the peripherals.
example.dts
: /dts-v1/; /plugin/; / { fragment@0 { target = <&i2c5>; __overlay__ { status = "okay"; }; }; };
khadas@Khadas:~$ dtc -I dts -O dtb -o example.dtbo example.dts khadas@Khadas:~$ ls example.dtbo example.dtbo
/boot/dtb/amlogic/kvim4.dtb.overlays/
/boot/dtb/amlogic/kvim4.dtb.overlay.env
to add in node fdt_overlays
and save the file.