This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
products:sbc:common:configurations:device-tree-overlay [2022/09/22 01:42] hyphop |
products:sbc:common:configurations:device-tree-overlay [2023/06/05 04:05] nick [Edit DT Overlays Configuration] |
||
---|---|---|---|
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/ |
- | ^ | + | ===== DT collections |
- | ^ VIM1 | + | |
- | ^ VIM2 | + | |
- | ^ VIM3 | + | |
- | ^ VIM3L | / | + | |
- | ^ VIM1S | / | + | |
- | ^ VIM4 | + | |
- | ^ Edge2 | / | + | |
- | ^ Edge1 | / | + | |
- | | ::: | + | |
- | ===== Boards ===== | + | https:// |
- | <tabbox VIM1/ | + | ===== Device Reference Table ====== |
- | <WRAP tip > | + | ^ |
- | This page takes VIM3 as an example, which can be different from yours but the structure is the same. | + | ^ VIM1 |
- | </WRAP> | + | ^ VIM2 |
+ | ^ | ||
+ | ^ VIM3L | / | ||
+ | ^ VIM1S | / | ||
+ | ^ VIM4 | ||
+ | ^ Edge2 | / | ||
+ | ^ Edge1 | / | ||
+ | | ::: | ||
+ | ===== Device Configurations ===== | ||
+ | |||
+ | <tabbox VIM1/ | ||
DT-overlays '' | DT-overlays '' | ||
- | |||
- | ```shell | ||
- | khadas@Khadas: | ||
- | total 40 | ||
- | -rw-r--r-- 1 root root 352 Jan 29 09:35 disable-ts050.dtbo | ||
- | -rw-r--r-- 1 root root 223 Jan 29 09:35 i2c3.dtbo | ||
- | -rw-r--r-- 1 root root 277 Jan 29 09:35 m2x-eth.dtbo | ||
- | -rw-r--r-- 1 root root 472 Jan 29 09:35 onewire.dtbo | ||
- | -rw-r--r-- 1 root root 1072 Jan 29 09:35 os08a10.dtbo | ||
- | -rw-r--r-- 1 root root 345 Jan 29 09:35 pwm_f.dtbo | ||
- | -rw-r--r-- 1 root root 447 Jan 29 09:35 spi1.dtbo | ||
- | -rw-r--r-- 1 root root 225 Jan 29 09:35 uart3.dtbo | ||
- | ``` | ||
<WRAP important > | <WRAP important > | ||
- | **BOARD** should be '' | + | **BOARD** should be '' |
</ | </ | ||
- | DT-overlays configuration file: '' | + | <WRAP tip > |
+ | Next example for VIM3 device, which can be different for other device, but the structure is the same. | ||
+ | </ | ||
+ | |||
+ | ```shell | ||
+ | khadas@Khadas:~$ ls -1 /boot/dtb/ | ||
+ | disable-ts050.dtbo | ||
+ | i2c3.dtbo | ||
+ | m2x-eth.dtbo | ||
+ | onewire.dtbo | ||
+ | os08a10.dtbo | ||
+ | pwm_f.dtbo | ||
+ | spi1.dtbo | ||
+ | uart3.dtbo | ||
+ | ``` | ||
+ | |||
+ | DT-overlays configuration file: | ||
- | ```txt | + | ```txt /boot/env.txt |
# Device Tree Overlays | # Device Tree Overlays | ||
# | # | ||
Line 64: | Line 68: | ||
<tabbox VIM4> | <tabbox VIM4> | ||
- | The dtbo files are stored in directory ''/ | + | DT-overlays '' |
```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 | + | |
``` | ``` | ||
- | DT-overlays configuration file is ''/ | + | DT-overlays configuration file: ''/ |
<tabbox VIM1S> | <tabbox VIM1S> | ||
- | The dtbo files are stored in directory ''/ | + | DT-overlays '' |
```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> | ||
- | The dtbo files are stored in directory ''/ | + | DT-overlays '' |
```shell | ```shell | ||
Line 106: | Line 107: | ||
</ | </ | ||
- | ===== Configuration ===== | + | ===== Configuration |
- | If you want to enable the peripherals, | + | 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 DT overlays '' | + | ==== Write DT Overlay Source==== |
- | + | Basic | |
- | ==== Write DT overlay source==== | + | |
- | + | ||
- | Basic example: | + | |
```dts example.dts | ```dts example.dts | ||
Line 135: | Line 134: | ||
``` | ``` | ||
- | ==== Compile DT overlay source | + | ==== Compile DT Overlay Source |
```sh | ```sh | ||
Line 141: | 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: | ||
Line 162: | Line 162: | ||
==== Reboot ==== | ==== Reboot ==== | ||
- | Need to reboot | + | Need reboot board to take effect. |