This shows you the differences between two versions of the page.
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:34] hyphop |
products:sbc:common:configurations:device-tree-overlay [2023/02/14 03:30] hyphop |
||
---|---|---|---|
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/ |
- | ===== Device reference table ====== | + | ===== DT collections |
- | ^ | + | https:// |
+ | |||
+ | ===== Device Reference Table ====== | ||
+ | |||
+ | ^ | ||
^ VIM1 | ^ VIM1 | ||
^ VIM2 | ^ VIM2 | ||
Line 16: | Line 20: | ||
| ::: | | ::: | ||
- | ===== Device | + | ===== Device |
<tabbox VIM1/ | <tabbox VIM1/ | ||
- | < | + | DT-overlays '' |
- | This page takes VIM3 as an example, which can be different from yours but the structure is the same. | + | |
+ | < | ||
+ | **BOARD** should | ||
</ | </ | ||
- | + | <WRAP tip > | |
- | DT-overlays '' | + | Next example for VIM3 device, which can be different for other device, but the structure is the same. |
+ | </WRAP> | ||
```shell | ```shell | ||
- | khadas@Khadas: | + | khadas@Khadas: |
disable-ts050.dtbo | disable-ts050.dtbo | ||
i2c3.dtbo | i2c3.dtbo | ||
Line 39: | Line 46: | ||
``` | ``` | ||
- | <WRAP important > | + | DT-overlays configuration file: |
- | **BOARD** should be '' | + | |
- | </ | + | |
- | + | ||
- | DT-overlays configuration file: ''/ | + | |
- | ```txt | + | ```txt /boot/env.txt |
# Device Tree Overlays | # Device Tree Overlays | ||
# | # | ||
Line 68: | Line 71: | ||
```shell | ```shell | ||
- | khadas@Khadas: | + | khadas@Khadas: |
- | total 28 | + | ext_board.dtbo |
- | -rwxr-xr-x 1 root root 462 Jul 6 14:55 ext_board.dtbo | + | i2cm_a.dtbo |
- | -rwxr-xr-x 1 root root 223 Jul 6 14:55 i2cm_a.dtbo | + | i2cm_f.dtbo |
- | -rwxr-xr-x 1 root root 223 Jul 6 14:55 i2cm_f.dtbo | + | pwm_f.dtbo |
- | -rwxr-xr-x 1 root root 225 Jul 6 14:55 pwm_f.dtbo | + | uart_e.dtbo |
- | -rwxr-xr-x 1 root root 225 Jul 6 14:55 uart_e.dtbo | + | |
``` | ``` | ||
Line 84: | Line 86: | ||
```shell | ```shell | ||
- | khadas@Khadas: | + | khadas@Khadas: |
- | 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 ''/ | DT-overlays configuration file is ''/ | ||
<tabbox Edge2> | <tabbox Edge2> | ||
- | DT-overlays '' | + | DT-overlays '' |
```shell | ```shell | ||
Line 107: | Line 107: | ||
</ | </ | ||
- | ===== Configuration DT overlays | + | ===== Configuration DT Overlays |
- | Need edit the DT overlays configuration file and add custom DT overlays '' | + | You need to edit the DT overlays configuration file and add custom DT overlays '' |
- | ===== Make custom DT overlays | + | ===== Make custom DT Overlays |
There are some preparations steps for DT overlays '' | There are some preparations steps for DT overlays '' | ||
- | ==== Write DT overlay source==== | + | ==== Write DT Overlay Source==== |
- | Basic example: | + | Basic DT overlay source |
```dts example.dts | ```dts example.dts | ||
Line 134: | Line 134: | ||
``` | ``` | ||
- | ==== Compile DT overlay source | + | ==== Compile DT Overlay Source |
```sh | ```sh | ||
Line 140: | Line 140: | ||
``` | ``` | ||
- | ==== Copy DT overlays | + | ==== Copy DT Overlays |
* VIM4 is ''/ | * VIM4 is ''/ | ||
* VIM1S is ''/ | * VIM1S is ''/ | ||
* Edge2 is ''/ | * Edge2 is ''/ | ||
- | * VIM1/ | + | * VIM1/ |
<WRAP important > | <WRAP important > | ||
- | **BOARD** should be '' | + | **BOARD** should be '' |
</ | </ | ||
- | ==== 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: |