2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
デバイスツリー オーバーレイ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
デバイスツリー(DT)は、名前付きノードと、検出不能ハードウェアを記述するプロパティで構成されるデータ構造です。Android で使用される Linux カーネルなどのカーネルは、Android 搭載デバイスで使用される幅広いハードウェア構成を DT によってサポートします。ハードウェア ベンダーは独自のデバイスツリー ソース(DTS)ファイルを提供します。このファイルは、デバイスツリー コンパイラによってデバイスツリー blob(DTB)ファイルにコンパイルされます。これらのファイルは、ブートローダーによって使用されます。DTB ファイルには、バイナリ形式のフラット化されたデバイスツリーが含まれています。
デバイスツリー オーバーレイ(DTO)は、中央の DTB を DT(デバイスツリー blob オーバーレイ(DTBO))にオーバーレイできるようにします。ブートローダーで DTO を使用することで、システム オン チップ(SoC)の DT を維持しながら、デバイス固有の DT を動的にオーバーレイできます(ツリーへのノードの追加や既存のツリーのプロパティの変更など)。
Android 9 リリースのアップデート
Android 9 では、ブートローダーは、統合した DTB をカーネルに渡す前に、DTO で定義されたプロパティを変更してはなりません。
DT を読み込む
ブートローダーで DT を読み込むには、ビルド、パーティショニング、実行が必要です。

図 1. ブートローダーでデバイスツリーを読み込むための一般的な実装
DTB を作成して書き込むには:
1a. DTC(dtc
)を使用して、DTS(.dts
)を DTB(.dtb
)にコンパイルします。DTB はフラット化された DT としてフォーマットされます。1b. ブートローダーが実行時にアクセスできる場所に .dtb
ファイルを書き込みます(詳細は後述します)。
パーティショニングを行うには、ブートローダーが実行時にアクセスできるフラッシュ メモリ内の信頼できる場所を決定して、.dtb
を配置します。場所の例:

図 2. .dtb を image.gz の末尾に追加し、 kernel として mkbootimg に渡して、 ブート パーティションに配置する
|

図 3. .dtb を固有のパーティションに配置する (例: dtb パーティション)
|
DTB を読み込んでカーネルを起動するには:
- ストレージからメモリに
.dtb
を読み込みます。
- 読み込まれた DT のメモリアドレスを使用して、カーネルを起動します。
次のステップ
このページでは、DT を読み込むためのブートローダーの一般的なワークフローを説明し、一般的な DT 用語のリストを掲載しています。このセクションの他のページでは、ブートローダーのサポートを実装する方法、DTO をコンパイル、検証、最適化する方法、複数の DT を使用する方法について説明します。また、DTO 構文と、必要となる DTO および DTBO パーティションのフォーマットについても詳細に説明します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-06 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-06 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)."]]