Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release
, bukan aosp-main
, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Overlay hierarki perangkat
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Hierarki perangkat (DT) adalah struktur data dari node dan properti bernama yang
menjelaskan hardware yang tidak dapat ditemukan. Kernel, seperti kernel Linux
yang digunakan di Android, menggunakan DT untuk mendukung berbagai konfigurasi hardware yang digunakan
oleh perangkat yang didukung Android. Vendor hardware menyediakan file sumber hierarki
perangkat (DTS) mereka sendiri, yang dikompilasi ke dalam file blob hierarki perangkat (DTB)
menggunakan compiler hierarki perangkat. File ini kemudian digunakan oleh
bootloader. File DTB berisi hierarki perangkat yang diratakan berformat biner.
Overlay hierarki perangkat (DTO)
memungkinkan DTB pusat ditempatkan di DT (blob hierarki perangkat
untuk overlay (DTBO)). Bootloader yang menggunakan DTO dapat mempertahankan DT
system-on-chip (SoC) dan secara dinamis menempatkan DT khusus perangkat, menambahkan node ke hierarki
dan membuat perubahan pada properti dalam hierarki yang ada.
Update dalam rilis Android 9
Di Android 9, bootloader tidak boleh mengubah
properti yang ditentukan dalam DTO sebelum meneruskan DTB terpadu ke kernel.
Memuat DT
Memuat DT di bootloader melibatkan pembuatan, pemisahan, dan pengoperasian.

Gambar 1. Implementasi umum untuk memuat hierarki perangkat di bootloader.
Untuk membuat dan mem-flash DTB:
1a. Gunakan DTC (dtc
) untuk mengompilasi DTS (.dts
) menjadi DTB (.dtb
).
DTB diformat sebagai DT yang diratakan.
1b. Flash file .dtb
ke lokasi yang dapat diakses runtime bootloader
(dijelaskan di bawah).
Untuk membuat partisi, tentukan lokasi tepercaya dan dapat diakses runtime bootloader
di memori flash untuk menempatkan .dtb
. Contoh lokasi:

Gambar 2. Masukkan .dtb di partisi booting dengan menambahkan ke image.gz dan meneruskan sebagai "kernel" ke mkbootimg.
|

Gambar 3. Masukkan .dtb dalam partisi unik (misalnya, partisi dtb).
|
Untuk memuat DTB dan memulai kernel:
- Muat
.dtb
dari penyimpanan ke dalam memori.
- Mulai kernel menggunakan alamat memori DT yang dimuat.
Apa selanjutnya?
Halaman ini menjelaskan alur kerja bootloader standar untuk memuat DT dan memberikan
daftar istilah DT umum. Halaman lain di bagian ini menjelaskan cara
menerapkan dukungan bootloader, cara
mengompilasi, memverifikasi, dan
mengoptimalkan DTO, serta cara
menggunakan beberapa DT. Anda juga dapat
mendapatkan detail tentang sintaksis DTO dan
pemformatan partisi DTO dan DTBO yang diperlukan.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-27 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)."]]