Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common: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
Next revision Both sides next revision
products:sbc:common:configurations:device-tree-overlay [2022/09/22 02:40]
hyphop
products:sbc:common:configurations:device-tree-overlay [2023/06/05 04:02]
nick [VIM4]
Line 1: Line 1:
 ====== Device Tree Overlay ====== ====== Device Tree Overlay ======
  
-We can use DT overlays to enable or disable the peripherals without recompiling the kernel source code.+We can use DT overlays to enable/disable or change configuration for peripherals without recompiling the DT kernel source code.
  
-===== Device reference table ======+===== DT collections  =====
  
-^          DT overlays directory                                  DT overlays list variable  ^  DT overlays config file                           ^ +https://github.com/khadas/khadas-linux-kernel-dt-overlays
-^  VIM1    /boot/dtb/overlays/kvim                                overlays          |  /boot/env.txt                                            | +
-^  VIM2    /boot/dtb/overlays/kvim2                              | :::                | ::                                                      | +
-^  VIM3   |  /boot/dtb/overlays/kvim3                              | :::                | :::                                                       | +
-^  VIM3L  |  /boot/dtb/overlays/kvim3l                             | :::                | :::                                                       | +
-^  VIM1S  |  /boot/dtb/amlogic/kvim1s.dtb.overlays                  fdt_overlays      |  /boot/dtb/amlogic/kvim1s.dtb.overlay.env                 | +
-^  VIM4    /boot/dtb/amlogic/kvim4.dtb.overlays                  | :::                |  /boot/dtb/amlogic/kvim4.dtb.overlay.env                  | +
-^  Edge2  |  /boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays  |  :::                /boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env +
-^  Edge1  |  /boot/dtb/rockchip/overlays/caption                    overlays          |  /boot/env.txt                                            | +
-| :::      /boot/dtb/rockchip/overlays/edgev                     | :::                | :::                                                       |+
  
-===== Device configurations =====+===== Device Reference Table ====== 
 + 
 +^            ^  DT overlays folder                                    ^  DT overlays list variable  ^  DT overlays config file                                  ^ 
 +^  VIM1      |  /boot/dtb/overlays/kvim                                overlays                    /boot/env.txt                                            | 
 +^  VIM2      |  /boot/dtb/overlays/kvim2                              | :::                         | :::                                                       | 
 +^  VIM3      |  /boot/dtb/overlays/kvim3                              | :::                         | :::                                                       | 
 +^  VIM3L      /boot/dtb/overlays/kvim3l                             | :::                         | :::                                                       | 
 +^  VIM1S      /boot/dtb/amlogic/kvim1s.dtb.overlays                  fdt_overlays                /boot/dtb/amlogic/kvim1s.dtb.overlay.env                 | 
 +^  VIM4      |  /boot/dtb/amlogic/kvim4.dtb.overlays                  | :::                          /boot/dtb/amlogic/kvim4.dtb.overlay.env                  | 
 +^  New VIM4  |  /boot/dtb/amlogic/kvim4n.dtb.overlays                 | :::                          /boot/dtb/amlogic/kvim4n.dtb.overlay.env                 | 
 +^  Edge2      /boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays  |                              /boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env 
 +^  Edge1      /boot/dtb/rockchip/overlays/caption                    overlays                    /boot/env.txt                                            | 
 +| :::        |  /boot/dtb/rockchip/overlays/edgev                     | :::                         | :::                                                       | 
 + 
 +===== Device Configurations =====
  
 <tabbox VIM1/2/3/3L/Edge1> <tabbox VIM1/2/3/3L/Edge1>
Line 23: Line 28:
  
 <WRAP important > <WRAP important >
-**BOARD** should be ''vim1'', ''vim2'', ''vim3'', ''vim3l'' or ''edge''.+**BOARD** should be ''kvim1'', ''kvim2'', ''kvim3'', ''kvim3l'' or ''edgev''.
 </WRAP> </WRAP>
  
Line 31: Line 36:
  
 ```shell ```shell
-khadas@Khadas:~$ ls -1  /boot/dtb/overlays/kvim3/+khadas@Khadas:~$ ls -1 /boot/dtb/overlays/kvim3/
 disable-ts050.dtbo disable-ts050.dtbo
 i2c3.dtbo i2c3.dtbo
Line 42: Line 47:
 ``` ```
  
-DT-overlays configuration file: ''/boot/env.txt''.+DT-overlays configuration file:
  
-```txt+```txt /boot/env.txt
 # Device Tree Overlays # Device Tree Overlays
 #   uart3           -- Enable UART3 (uart_C, GPIO Header PIN15 & PIN16) #   uart3           -- Enable UART3 (uart_C, GPIO Header PIN15 & PIN16)
Line 64: Line 69:
 <tabbox VIM4> <tabbox VIM4>
  
-DT-overlays ''dtbo'' directory: ''/boot/dtb/amlogic/kvim4.dtb.overlays''+DT-overlays ''dtbo'' directory: ''/boot/dtb/amlogic/kvim4.dtb.overlays'' or ''/boot/dtb/amlogic/kvim4n.dtb.overlays''
  
 ```shell ```shell
Line 82: Line 87:
  
 ```shell ```shell
-khadas@Khadas:~$ ls -l1 /boot/dtb/amlogic/kvim1s.dtb.overlays/ +khadas@Khadas:~$ ls -/boot/dtb/amlogic/kvim1s.dtb.overlays/ 
-total 28 +i2cm_b.dtbo 
--rw-rw-r-- 1 root root  223 Aug 12 10:59 i2cm_b.dtbo +i2cm_e.dtbo 
--rw-rw-r-- 1 root root  223 Aug 12 10:59 i2cm_e.dtbo +pwm_f.dtbo 
--rw-rw-r-- 1 root root  345 Aug 12 10:59 pwm_f.dtbo +uart_c.dtbo
--rw-rw-r-- 1 root root  225 Aug 12 10:59 uart_c.dtbo+
 ``` ```
- 
 DT-overlays configuration file is ''/boot/dtb/amlogic/kvim1s.dtb.overlay.env''. DT-overlays configuration file is ''/boot/dtb/amlogic/kvim1s.dtb.overlay.env''.
  
 <tabbox Edge2> <tabbox Edge2>
  
-DT-overlays ''dtbo'' directory:  ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays'':+DT-overlays ''dtbo'' directory: ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays''
  
 ```shell ```shell
Line 105: Line 108:
 </tabbox> </tabbox>
  
-===== Configuration DT overlays =====+===== Configuration DT Overlays =====
  
-Need edit the DT overlays configuration file and add custom DT overlays ''dtbo'' files to special folder.+You need to edit the DT overlays configuration file and add custom DT overlays ''dtbo'' files to special folder.
  
-===== Make custom DT overlays =====+===== Make custom DT Overlays =====
  
 There are some preparations steps for DT overlays ''dtbo'' files, you can also add custom DT overlays. There are some preparations steps for DT overlays ''dtbo'' files, you can also add custom DT overlays.
  
-==== Write DT overlay source====+==== Write DT Overlay Source====
  
-Basic example:+Basic  DT overlay source example:
  
 ```dts example.dts  ```dts example.dts 
Line 132: Line 135:
 ``` ```
  
-==== Compile DT overlay source ====+==== Compile DT Overlay Source ====
  
 ```sh ```sh
Line 138: Line 141:
 ``` ```
  
-==== Copy DT overlays to special folder ====+==== Copy DT Overlays to Special Folder ====
  
   * VIM4 is ''/boot/dtb/amlogic/kvim4.dtb.overlays''    * VIM4 is ''/boot/dtb/amlogic/kvim4.dtb.overlays'' 
   * VIM1S is ''/boot/dtb/amlogic/kvim1s.dtb.overlays''   * VIM1S is ''/boot/dtb/amlogic/kvim1s.dtb.overlays''
   * Edge2 is ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays''   * Edge2 is ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlays''
-  * VIM1/2/3/3L/Edge1 is ''/boot/dtb/overlays/**BOARD**'' +  * VIM1/2/3/3L/Edge1 is ''/boot/dtb/overlays/%%*%%*BOARD%%*%%*'' 
  
 <WRAP important > <WRAP important >
-**BOARD** should be ''vim1'', ''vim2'', ''vim3'', ''vim3l'' or ''edge''+**BOARD** should be ''kvim1'', ''kvim2'', ''kvim3'', ''kvim3l'' or ''edgev''.
 </WRAP> </WRAP>
  
-==== Edit DT overlays configuration ====+==== Edit DT Overlays Configuration ====
  
 Edit list variable value inside DT overlay configuration file: Edit list variable value inside DT overlay configuration file:
    
   * VIM1/2/3/3L/Edge1 is ''/boot/env.txt''   * VIM1/2/3/3L/Edge1 is ''/boot/env.txt''
-  * VIM4 is ''/boot/dtb/amlogic/kvim4.dtb.overlay.env''+  * VIM4 is ''/boot/dtb/amlogic/kvim4.dtb.overlay.env'' or ''/boot/dtb/amlogic/kvim4n.dtb.overlay.env''
   * VIM1S is ''/boot/dtb/amlogic/kvim4.dtb.overlay.env''   * VIM1S is ''/boot/dtb/amlogic/kvim4.dtb.overlay.env''
   * Edge2 is ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env''   * Edge2 is ''/boot/dtb/rockchip/rk3588s-khadas-edge2.dtb.overlay.env''
Last modified: 2023/11/07 04:18 by nick