Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:configurations:android-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:common:configurations:android-device-tree-overlay [2024/12/18 21:26]
xiong [Device Reference Table]
products:sbc:common:configurations:android-device-tree-overlay [2024/12/20 03:26] (current)
william
Line 1: Line 1:
-====== Edge2 Android Device Tree Overlay ======+====== Android Device Tree Overlay ======
  
-We can use DT overlays to enable/disable or change configuration for peripherals without recompiling the DT kernel source code.+We can use DT overlays to enable/disable or change the configuration of peripherals without recompiling the kernel source code.
  
 ===== Device Reference Table ====== ===== Device Reference Table ======
  
-^          Android Version  ^  DT overlays folder                                    ^  DT overlays list variable  ^  DT overlays config file                                  +^          Android Version  ^  DT overlays folder                                                  ^  DT overlays list variable  ^  DT overlays config file                                                       
-^  Edge2  |  14.0            |  vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays  | fdt_overlays                |  vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env  |+^  Edge2  |  14               |  /vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays  | fdt_overlays                |  /vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env         | 
 +^  VIM4    11,14            |  /mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlays              | fdt_overlays                |  /mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlays/kvim4.dtb.overlay.env  |
  
  
 ===== Device Configurations ===== ===== Device Configurations =====
  
-DT-overlays ''dtbo'' directory: ''vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays''+ 
 +<tabbox Edge2 > 
 + 
 +DT-overlays ''dtbo'' directory: ''/vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays''
  
 ```shell ```shell
Line 18: Line 22:
 ``` ```
  
-DT-overlays configuration file: ''vendor/custom/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env''+DT-overlays configuration file: ''/mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlays/kvim4.dtb.overlay.env''
  
 Enable: Enable:
Line 40: Line 44:
 ``` ```
  
 +<tabbox VIM4>
 +DT-overlays ''dtbo'' directory: ''/mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlays''.
  
-===== Write DT Overlay Source =====+```shell 
 +khadas@Khadas:~$ ls -1 /mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlays 
 +i2s.dtbo   
 +pwm_f.dtbo   
 +spdifout.dtbo   
 +uart_e.dtbo 
 +``` 
 +DT-overlays configuration file: ''/mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlay.env'' 
 + 
 +Enable: 
 +```shell 
 +$ echo fdt_overlays=i2s > /mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlay.env 
 +``` 
 +```shell 
 +$ cat kvim4.dtb.overlay.env 
 +fdt_overlays=i2s 
 + 
 +``` 
 + 
 +Disable: 
 +```shell 
 +$ echo fdt_overlays= > /mnt/vendor/odm_ext/custom/overlays/kvim4.dtb.overlay.env 
 +``` 
 +```shell 
 +$ cat kvim4.dtb.overlay.env 
 +fdt_overlays= 
 + 
 +``` 
 +</tabbox> 
 + 
 +===== Configuration DT Overlays ===== 
 + 
 +You need to edit the DT overlays configuration file and add custom DT overlays dtbo files to a special folder. 
 + 
 +===== Make custom DT Overlays ===== 
 + 
 +There are some preparation steps for DT overlays dtbo files, you can also add custom DT overlays. 
 + 
 +==== Write DT Overlay Source====
  
-Basic  DT overlay source edge2-io-spi:+Basic  DT overlay source example:
  
-```dts edge2-io-spi.dts +```dts example.dts 
 /dts-v1/; /dts-v1/;
 /plugin/; /plugin/;
  
 / { / {
- fragment@0 { +    fragment@0 { 
- target = <&spi1>; +        target = <&i2c3>; 
- +        __overlay__ { 
- __overlay__ { +            status = "disabled"; 
- status = "disabled"; +        }; 
- }; +    };
- };+
 }; };
 ``` ```
  
-===== Compile DT Overlay Source =====+==== Compile DT Overlay Source ====
  
 ```sh ```sh
-dtc -I dts -O dtb -o edge2-io-spi.dtbo edge2-io-spi.dts+dtc -I dts -O dtb -o example.dtbo example.dts
 ``` ```
  
Last modified: 2024/12/18 21:26 by xiong