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 00:59] hyphop [Make custom DT overlays] |
products:sbc:common:configurations:device-tree-overlay [2022/11/16 20:21] nick [Configuration DT Overlays] |
||
---|---|---|---|
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 ====== |
+ | |||
+ | ^ | ||
^ VIM1 | ^ VIM1 | ||
^ VIM2 | ^ VIM2 | ||
Line 13: | Line 15: | ||
^ Edge1 | / | ^ Edge1 | / | ||
| ::: | | ::: | ||
+ | |||
+ | ===== Device Configurations ===== | ||
<tabbox VIM1/ | <tabbox VIM1/ | ||
+ | |||
+ | DT-overlays '' | ||
+ | |||
+ | <WRAP important > | ||
+ | **BOARD** should be '' | ||
+ | </ | ||
<WRAP tip > | <WRAP tip > | ||
- | This page takes VIM3 as an example, which can be different | + | Next example |
</ | </ | ||
- | + | ```shell | |
- | The dtbo files are stored in directory ''/ | + | khadas@Khadas: |
- | + | disable-ts050.dtbo | |
- | ```txt | + | i2c3.dtbo |
- | khadas@Khadas: | + | m2x-eth.dtbo |
- | total 40 | + | onewire.dtbo |
- | drwxr-xr-x 2 root root 4096 Jan 29 11:13 ./ | + | os08a10.dtbo |
- | drwxr-xr-x 6 root root 4096 Jan 29 11:13 ../ | + | pwm_f.dtbo |
- | -rw-r--r-- 1 root root 352 Jan 29 09:35 disable-ts050.dtbo | + | spi1.dtbo |
- | -rw-r--r-- 1 root root 223 Jan 29 09:35 i2c3.dtbo | + | uart3.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 > | + | DT-overlays configuration file: |
- | **#BOARD#** should be '' | + | |
- | </ | + | |
- | The releated dtbo configuration file is '' | + | ```txt |
- | + | ||
- | + | ||
- | ```shell | + | |
# Device Tree Overlays | # Device Tree Overlays | ||
# | # | ||
Line 59: | Line 58: | ||
``` | ``` | ||
- | '' | + | * default '' |
- | + | * If you want to disable '' | |
- | * If you want to disable '' | + | * If you want to enable '' |
- | + | ||
- | * If you want to enable '' | + | |
<tabbox VIM4> | <tabbox VIM4> | ||
- | The dtbo files are stored in directory ''/ | + | DT-overlays '' |
- | ``` | + | ```shell |
- | khadas@Khadas: | + | khadas@Khadas: |
- | total 28 | + | ext_board.dtbo |
- | drwxr-xr-x 2 root root 4096 Jul 6 14:55 . | + | i2cm_a.dtbo |
- | drwxr-xr-x 3 root root 4096 Jul 6 14:55 .. | + | i2cm_f.dtbo |
- | -rwxr-xr-x 1 root root 462 Jul 6 14:55 ext_board.dtbo | + | pwm_f.dtbo |
- | -rwxr-xr-x 1 root root 223 Jul 6 14:55 i2cm_a.dtbo | + | uart_e.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 ''/ | + | DT-overlays |
<tabbox VIM1S> | <tabbox VIM1S> | ||
- | The dtbo files are stored in directory ''/ | + | DT-overlays '' |
+ | ```shell | ||
+ | khadas@Khadas: | ||
+ | i2cm_b.dtbo | ||
+ | i2cm_e.dtbo | ||
+ | pwm_f.dtbo | ||
+ | uart_c.dtbo | ||
``` | ``` | ||
- | khadas@Khadas: | + | DT-overlays configuration file is ''/ |
- | total 28 | + | |
- | drwxrwxr-x 2 root root 4096 Aug 19 09:21 ./ | + | |
- | drwxr-xr-x 3 root root 4096 Aug 19 09:21 ../ | + | |
- | -rw-rw-r-- 1 root root 223 Aug 12 10:59 i2cm_b.dtbo | + | |
- | -rw-rw-r-- 1 root root 223 Aug 12 10:59 i2cm_e.dtbo | + | |
- | -rw-rw-r-- 1 root root 345 Aug 12 10:59 pwm_f.dtbo | + | |
- | -rw-rw-r-- 1 root root 225 Aug 12 10:59 uart_c.dtbo | + | |
- | ``` | + | |
- | + | ||
- | The releated dtbo configuration file is ''/ | + | |
<tabbox Edge2> | <tabbox Edge2> | ||
- | The dtbo files are stored in directory ''/ | + | DT-overlays '' |
- | ``` | + | ```shell |
khadas@Khadas: | khadas@Khadas: | ||
mipi-panel.dtbo | mipi-panel.dtbo | ||
``` | ``` | ||
- | The releated dtbo configuration file is ''/ | + | DT-overlays |
</ | </ | ||
- | ===== Configuration ===== | + | ===== Configuration |
- | + | ||
- | If you want to enable the peripherals, | + | |
- | ===== Make custom DT overlays | + | You need to edit the DT overlays configuration file and add custom DT overlays |
- | There are some preparations steps DT overlays '' | + | ===== Make custom DT Overlays ===== |
+ | There are some preparations steps for DT overlays '' | ||
- | ==== Write DT overlay source==== | + | ==== Write DT Overlay Source==== |
- | For example: | + | Basic DT overlay source |
```dts example.dts | ```dts example.dts | ||
Line 143: | Line 130: | ||
``` | ``` | ||
- | ==== Compile | + | ==== Compile |
```sh | ```sh | ||
Line 149: | Line 136: | ||
``` | ``` | ||
- | ==== Copy DTBO File to DTBO Directory | + | ==== Copy DT Overlays |
- | * VIM1/ | ||
* VIM4 is ''/ | * VIM4 is ''/ | ||
* VIM1S is ''/ | * VIM1S is ''/ | ||
* Edge2 is ''/ | * Edge2 is ''/ | ||
+ | * VIM1/ | ||
+ | |||
+ | <WRAP important > | ||
+ | **BOARD** should be '' | ||
+ | </ | ||
- | <wrap important > | + | ==== Edit DT Overlays |
- | **BOARD** should be '' | + | |
- | </ | + | |
- | ==== Edit DTBO Configuration | + | |
- | Add '' | + | Edit list variable value inside DT overlay configuration file: |
* VIM1/ | * VIM1/ | ||
Line 170: | Line 158: | ||
==== Reboot ==== | ==== Reboot ==== | ||
- | Need to reboot | + | Need reboot board to take effect. |