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.
Device tree overlays
Stay organized with collections
Save and categorize content based on your preferences.
A device tree (DT) is a data structure of named nodes and properties that
describe non-discoverable hardware. Kernels, such as the Linux kernel
used in Android, use DTs to support a wide range of hardware configurations used
by Android-powered devices. Hardware vendors supply their own device tree
source (DTS) files, which are compiled into the device tree blob (DTB) file
using the device tree compiler. These files are then used by the
bootloader. The DTB file contains a binary-formatted flattened device tree.
A device tree overlay (DTO)
enables a central DTB to be overlaid on the DT (a device tree blob
for overlay (DTBO)). A bootloader using DTO can maintain the system-on-chip
(SoC) DT and dynamically overlay a device-specific DT, adding nodes to the tree
and making changes to properties in the existing tree.
Updates in Android 9 release
In Android 9, the bootloader must not modify the
properties defined in the DTOs before passing the unified DTB to the kernel.
Load a DT
Loading a DT in bootloader involves building, partitioning, and running.

Figure 1. Typical implementation for loading device tree in bootloader.
To create and flash the DTB:
1a. Use the DTC (dtc
) to compile DTS (.dts
) into a DTB (.dtb
).
The DTB is formatted as a flattened DT.
1b. Flash the .dtb
file into a bootloader runtime-accessible location
(detailed below).
To partition, determine a bootloader runtime-accessible and trusted location
in flash memory to put .dtb
. Example locations:

Figure 2. Put .dtb in a boot partition by appending to image.gz and passing as "kernel" to mkbootimg.
|

Figure 3. Put .dtb in a unique partition (for example, dtb partition).
|
To load the DTB and start the kernel:
- Load
.dtb
from storage into memory.
- Start kernel using the memory address of the loaded DT.
What's next?
This page details a typical bootloader workflow for loading a DT and provides
a list of common DT terms. Other pages in this section describe how to
implement bootloader support, how to
compile, verify, and
optimize your DTO, and how to
use multiple DTs. You can
also get details on DTO syntax and
required
DTO and DTBO partition formatting.
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-06-12 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-06-12 UTC."],[],[],null,["# Device tree overlays\n\n\u003cbr /\u003e\n\nA *device tree (DT)* is a data structure of named nodes and properties that\ndescribe non-discoverable hardware. Kernels, such as the Linux kernel\nused in Android, use DTs to support a wide range of hardware configurations used\nby Android-powered devices. Hardware vendors supply their own *device tree\nsource (DTS)* files, which are compiled into the *device tree blob (DTB)* file\nusing the *device tree compiler* . These files are then used by the\nbootloader. The DTB file contains a binary-formatted *flattened device tree*.\n\nA [*device tree overlay (DTO)*](https://lkml.org/lkml/2012/11/5/615)\nenables a central DTB to be overlaid on the DT (a *device tree blob\nfor overlay (DTBO)*). A bootloader using DTO can maintain the system-on-chip\n(SoC) DT and dynamically overlay a device-specific DT, adding nodes to the tree\nand making changes to properties in the existing tree.\n\nUpdates in Android 9 release\n----------------------------\n\nIn Android 9, the bootloader must not modify the\nproperties defined in the DTOs before passing the unified DTB to the kernel.\n\nLoad a DT\n---------\n\nLoading a DT in bootloader involves building, partitioning, and running.\n\n**Figure 1.** Typical implementation for loading device tree in bootloader.\n\n1. To create and flash the DTB:\n\n 1a. Use the DTC (`dtc`) to compile DTS (`.dts`) into a DTB (`.dtb`).\n The DTB is formatted as a flattened DT.\n 1b. Flash the `.dtb` file into a bootloader runtime-accessible location\n (detailed below).\n2. To partition, determine a bootloader runtime-accessible and trusted location\n in flash memory to put `.dtb`. Example locations:\n\n \u003cbr /\u003e\n\n |-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|\n | **Figure 2.** Put .dtb in a boot partition by appending to image.gz and passing as \"kernel\" to mkbootimg. | **Figure 3.** Put .dtb in a unique partition (for example, dtb partition). |\n\n \u003cbr /\u003e\n\n3. To load the DTB and start the kernel:\n\n - Load `.dtb` from storage into memory.\n - Start kernel using the memory address of the loaded DT.\n\nWhat's next?\n------------\n\nThis page details a typical bootloader workflow for loading a DT and provides\na list of common DT terms. Other pages in this section describe how to\n[implement bootloader support](/docs/core/architecture/dto/implement), how to\n[compile](/docs/core/architecture/dto/compile), verify, and\n[optimize your DTO](/docs/core/architecture/dto/optimize), and how to\n[use multiple DTs](/docs/core/architecture/dto/multiple). You can\nalso get details on [DTO syntax](/docs/core/architecture/dto/syntax) and\nrequired\n[DTO and DTBO partition formatting](/docs/core/architecture/dto/partitions)."]]