Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Use multiple DTs
Stay organized with collections
Save and categorize content based on your preferences.
Many SoC vendors and ODMs support the use of multiple device trees (DTs) on a device,
enabling one image to power multiple SKUs or configurations. In such cases, the
bootloader identifies the hardware and loads the corresponding DT at runtime:

Figure 1. Multiple device tree overlays (DTOs) in bootloader.
Note: Using multiple DTs isn't mandatory.
Set up
To add support for multiple DTs to the DTO model, set up a list of main DTs
and another list of overlay DTs.

Figure 2. Runtime DTO implementation for multiple DTs.
The bootloader should be able to:
- Read the SoC ID and select the corresponding main DT.
- Read the board ID and select the set of overlay DTs accordingly.
Only one main DT should be selected for use at runtime. Multiple overlay DTs
may be selected but they must be compatible with the chosen main DT. Using
multiple overlays can help avoid storing one overlay per board within the DTBO
partition and enable the bootloader to determine the subset of required overlays
based on the board ID (or possibly by probing the peripherals). For
example, Board A may need the devices added by the overlays 1, 3, and 5 while
Board B may need the devices added by the overlays 1, 4, and 5.
Partition
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 cann't
exist in the same partition. If your DTBs/DTBOs are in the
dtb
/dtbo
partition, use the table structure and header
format detailed in DTB and DTBO
partition format.
Run in bootloader
To run:
- Identify the SoC and load the corresponding .dtb from
storage into memory.
- Identify the board and load the corresponding
.dtbo
from storage into memory.
- Overlay the
.dtb
with the .dtbo
to be a merged
DT.
- Start kernel given the memory address of the merged DT.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-27 UTC."],[],[],null,["# Use multiple DTs\n\nMany SoC vendors and ODMs support the use of multiple device trees (DTs) on a device,\nenabling one image to power multiple SKUs or configurations. In such cases, the\nbootloader identifies the hardware and loads the corresponding DT at runtime:\n\n**Figure 1.** Multiple device tree overlays (DTOs) in bootloader.\n\n**Note:** Using multiple DTs isn't mandatory.\n\nSet up\n------\n\nTo add support for multiple DTs to the DTO model, set up a list of main DTs\nand another list of overlay DTs.\n\n**Figure 2.** Runtime DTO implementation for multiple DTs.\n\nThe bootloader should be able to:\n\n- Read the SoC ID and select the corresponding main DT.\n- Read the board ID and select the set of overlay DTs accordingly.\n\nOnly one main DT should be selected for use at runtime. Multiple overlay DTs\nmay be selected but they must be compatible with the chosen main DT. Using\nmultiple overlays can help avoid storing one overlay per board within the DTBO\npartition and enable the bootloader to determine the subset of required overlays\nbased on the board ID (or possibly by probing the peripherals). For\nexample, Board A may need the devices added by the overlays 1, 3, and 5 while\nBoard B may need the devices added by the overlays 1, 4, and 5.\n\nPartition\n---------\n\nTo partition, determine a bootloader runtime-accessible and trusted location\nin flash memory to store the DTBs and DTBOs (bootloader must be able to locate\nthese files in the matching process). Keep in mind that DTBs and DTBOs cann't\nexist in the same partition. If your DTBs/DTBOs are in the\n`dtb`/`dtbo` partition, use the table structure and header\nformat detailed in [DTB and DTBO\npartition format](/docs/core/architecture/dto/partitions).\n\nRun in bootloader\n-----------------\n\nTo run:\n\n1. **Identify the SoC** and load the corresponding .dtb from storage into memory.\n2. **Identify the board** and load the corresponding `.dtbo` from storage into memory.\n3. Overlay the `.dtb` with the `.dtbo` to be a merged DT.\n4. Start kernel given the memory address of the merged DT."]]