Many SoC vendors and ODMs support the use of multiple DTs on a device, enabling one image to power multiple SKUs/configurations. In such cases, the bootloader identifies the hardware and loads the corresponding DT at runtime:
Note: Using multiple DTs is not mandatory.
To add support for multiple DTs to the DTO model, set up a list of main DTs and another list of overlay DTs.
The bootloader should be able to:
- read the SoC ID and select the main DT correspondingly, and
- read the board ID and select the overlay DT accordingly.
Only one main DT and one overlay DT are selected for use at runtime, and the selected pair must be compatible.
To partition, determine a bootloader runtime-accessible and trusted location
in flash memory to store the DTBs and DTBOs (bootloader must be able to locate
these files in the matching process). Keep in mind that DTBs and DTBOs can not
exist in the same partition. If your DTBs/DTBOs are in the
dtbo partition, use the table structure and header
format detailed in DTB/DTBO
Running in bootloader
- Identify the SoC and load the corresponding .dtb from storage into memory.
- Identify the board and load the corresponding
.dtbofrom storage into memory.
- Overlay the
.dtboto be a merged DT.
- Start kernel given the memory address of the merged DT.