1, DTC (Device tree compiler) is a small tool responsible for converting DTS to DTB (Device tree blob). DTB is a binary form of DTS for use by machines. In use, we first modify the DTS files according to the hardware, then convert the DTS files to DTB files by using the DTC tool at compile time, and then burn the DTB files to the machine (such as EMMC, disk, etc.). When the system starts, the FastBoot (or similar launcher, such as Uboot) reads the DTB file into memory before starting the kernel, and jumps to the kernel as it executes and passes the DTB start address to the kernel. The kernel can parse the entire device tree based on the DTB structure through the starting address. The specification of the device tree can be divided into two levels and is intended for DTS, and the DTB structure is not within this scope. DTB is simply a translation of DTS for convenience of machine use (or DTS is only a description of DTB to facilitate human use).
2, in fact, device tree after compiling will eventually be all placed in a. DtB end of the file, the following will be DTB decompile to DTS:-bash-4.3# Find/-name *.DTB/PNS/SDM_B/LCPA. X31.ahp.dtb/pns/sdm_b/lbra. X31.DTB/PNS/SDM_B/LCAA. X31.dtb/pns/sdm_b/lnia. X31.DTB/PNS/SDM_B/LCPA. X31.SHP.DTB/PNS/SDM_A/LCAA. x32.dtb-bash-4.3# dtc-i DtB "/PNS/SDM_A/LCAA. X32.DTB ">/tmp/xxx.dts-bash-4.3# cat/tmp/xxx.dts/dts-v1/;
/{epapr-version = "ePAPR-1.1"; part-number = "LCAA"; version = "00000000"; revision = "0002";
fragment@0 {target = <0xdeadbeef>;
__overlay__ {#address-cells = <0x1>; #size-cells = <0x0>;
lcaa0_ep_0_clk@90000 {compatible = "Nsn,vrha-clk-agusta"; reg = <0x90000 0x1000>; interrupts = <0x26 0x27>; I Nterrupt-names = "Sync_irq", "PHASELATCH_IRQ"; Vrha_event = <0x1>; Fpga-name = "Augusta"; Clk-version = <0x1>;
The DTS files generated by the disassembly are then compiled with DTC to DTB:-bash-4.3# dtc-i dts-o dtb-o/tmp/xxxx.dtb/tmp/xxx.dts-bash-4.3# --r--1 root root 5159 3 20:59/TMP/XXXX.DTB above the DTC compiler has several options and parameters:-i is the input file format, in this article is Dts-o is the target file format, in this article is the Dtb-o is the target file path the last parameter is After the input file path is compiled, a DTB file is generated in the destination file path, which must be named according to the file in the previous uboot default configuration, in this article DEVICETREE.DTB
to generate DTS from a running kernel:-bash-4.3# dtc-i fs-o Dts-o/tmp/xxxx.dts/proc/device-tree/
-bash-4.3# Ls/tmp/xxxx.dts
/tmp/xxxx.dts
3, install Dtc:sudo apt-get install Device-tree-compiler
4, http://blog.chinaaet.com/cuter521/p/5100050348
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.