2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
複数の DT の使用
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
多くの SoC ベンダーと ODM は、デバイスでの複数のデバイスツリー(DT)の使用をサポートしています。そのため、1 つのイメージで複数の SKU または構成に対応できます。このようなケースでは、ブートローダーはハードウェアを識別し、実行時に対応する DT を読み込みます。

図 1. ブートローダー内の複数のデバイスツリー オーバーレイ。
注: 複数の DT を使用することは必須ではありません。
セットアップ
DTO モデルに複数の DT のサポートを追加するには、メイン DT のリストとオーバーレイ DT のリストをセットアップします。

図 2. 複数の DT のランタイム DTO 実装。
ブートローダーでは以下のことができる必要があります。
- SoC ID を読み、対応するメイン DT を選択する。
- ボード ID を読み、それに応じてオーバーレイ DT のセットを選択する。
実行時に使用するメイン DT は 1 つだけ選択する必要があります。オーバーレイ DT は複数選択できますが、選択したメイン DT と互換性がある必要があります。複数のオーバーレイを使用することで、DTBO パーティション内にボードごとに 1 つずつオーバーレイを格納するのではなく、ボード ID に基づいて(または、周辺機器をプローブすることにより)必要なオーバーレイのサブセットをブートローダーが決定できるようになります。たとえば、ボード A にはオーバーレイ 1、3、5 によって追加されたデバイスが必要で、ボード B にはオーバーレイ 1、4、5 によって追加されたデバイスが必要な場合があります。
パーティション
パーティショニングするには、DTB と DTBO を格納する、ブートローダーが実行時にアクセスできるフラッシュ メモリ内の信頼できる場所を決定します(ブートローダーは、照合プロセス中にこれらのファイルを検出できる必要があります)。DTB と DTBO は、同じパーティションに存在できません。DTB / DTBO が dtb
/ dtbo
パーティションにある場合は、DTB および DTBO パーティション形式で詳細が説明されているテーブル構造とヘッダー形式を使用します。
ブートローダーで実行する
以下の手順で実行します。
- SoC を特定し、ストレージから対応する .dtb をメモリに読み込みます。
- ボードを特定し、ストレージから対応する
.dtbo
をメモリに読み込みます。
.dtb
を .dtbo
でオーバーレイして、DT を統合します。
- 統合した DT のメモリアドレスを指定して、カーネルを起動します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 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."]]