On SECO Android 11 BSP it is possible to create and test custom “devicetree.dtb” and “overlay.dtbo” files for implementing and validating custom DISPLAY configuration or peripherals.
You can customize and test new dtb/dtbo file without using external resources, you just need the SECO board, and a PC (Windows or Linux) for connecting to it with ADB protocol (via USB cable or over IP).
Please refer to Connecting via ADB for detailed instructions on HOW TO connect the board via ADB.
Procedure
Connect to the board via ADB protocol (ref to Connecting via ADB for details) or via Serial cable
Enter in the folder /data/seco/dts_source:
cd /data/seco/dts_source
Inside “seco/” folder you will find the dts sources files you can modify and compile for changing default dtb or dtbo
Here is an example from c43 board:
You can edit .dts files using the vi editor included in our Android distribution and adding or changing sections in the source files.
Example command for editing devicetree dts file on C43 board:
vi seco/seco-imx8qm-c43.dts
Example command for editing overlays dts file on C43 board:
vi seco/overlays/seco-imx8qm-c43-lvds-GENERIC-single-channel-overlay.dts
After having changed the sources file with the right setup, it is possible to compile dtb and dtbo binary files with the script ./dtscompile.sh <file_to_be_compied>:
./dtscompile.sh seco/overlays/seco-imx8qm-c43-lvds-GENERIC-single-channel-overlay.dts
or:
./dtscompile.sh seco/seco-imx8qm-c43.dts
Results will be copied in /data/seco/ folder:
/data/seco/overlay.dtbo
/data/seco/devicetree.dtb
You can edit /data/seco/android_seco.conf:
vi /data/seco/android_seco.conf
and add in it the following definitions:
### Enable dtb customization # enablecustomization=true ### Definitions for dtb custom file customdtb=devicetree.dtb ### Definitions for device tree overlay custom file customdtbo=overlay.dtbo
N.B. If you are defining a new video output you need also to unconfigure any defined video:
### Force video selection. # Posible values are: NONE, LVD0, ... LVD6, HDM0, HIN0, EDP0, HLV0, ELV0, LEH0, EHD0 videosel=NONE
The changes will be applied starting from the next reboot.
At startup pay attention to the following messages for verifiying the new setup:
switch to partitions #0, OK mmc0(part 0) is current device 587 bytes read in 11 ms (51.8 KiB/s) verify OK, boot 'boot_a' Found custom dtb of size 165905 in path /misc/seco/devicetree.dtb <---- 165905 bytes read in 13 ms (12.2 MiB/s) <---------- size Found custom dtbo of size 3147 in path /misc/seco/overlay.dtbo <----- 3147 bytes read in 12 ms (255.9 KiB/s) <---------- size Warn! Can't find videoselection NONE in dtbo image. <------- Kernel load addr 0x80280000 size 43283 KiB kernel @ 80280000 (44321280) ramdisk @ 86400000 (8505136) fdt @ 83e80000 (165905) <---------- size ## Flattened Device Tree blob at 83e80000 Booting using the fdt blob at 0x83e80000 Using Device Tree in place at 0000000083e80000, end 0000000083f2bfff
P.S. If you prefer you can edit dts files on your Desktop PC, and copy them using adb push command:
adb push seco-imx8qm-c43.dts /data/seco/seco/seco-imx8qm-c43.dts adb push test.dtb /data/seco/overlays/seco-imx8qm-c43-lvds-GENERIC-single-channel-overlay.dts
P.P.S. It is also possible to customize only dtb or only dtbo file. If only one of this files has been found the default configuration will be used instead of the missing one.