A device tree (DT) is a data structure of named nodes and properties that describe non-discoverable hardware. Operating systems, 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 DT source files, which Linux then compiles into the Device Tree Blob (DTB) file used by the bootloader.
A device tree overlay (DTO) enables a central device tree blob (DTB) to be overlaid on the device tree. 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.
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 for DTO, how to compile, verify, and optimize your DTO implementation, and how to use multiple DTs. You can also get details on DTO syntax and required DTO/DTBO partition formatting.
In Android {{ androidPVersionNumber }}, the bootloader must not modify the properties defined in the device tree overlays before passing the unified device tree blob to the kernel.
Loading a device tree in bootloader involves building, partitioning, and running.
dtc
) to compile device tree
source (.dts
) into a device tree blob (.dtb
),
formatted as a flattened device tree..dtb
file into a bootloader runtime-accessible
location (detailed below)..dtb
. Example locations:
Boot Partition |
---|
.dtb
in boot partition by appending
to image.gz
and passing as "kernel
" to
mkbootimg
.
Unique Partition |
---|
.dtb
in an unique partition (e.g.
dtb
partition).
.dtb
from storage into memory.This section uses the following device tree terms:
DT | Device Tree |
---|---|
DTB | Device Tree Blob |
DTBO | Device Tree Blob for Overlay |
DTC | Device Tree Compiler |
DTO | Device Tree Overlay |
DTS | Device Tree Source |
FDT | Flattened Device Tree, a binary format contained in a .dtb blob
file |