[Linux driver] Device tree overview

00. Table of Contents

01. Device tree overview

The function of the device tree is to describe the hardware resources of a hardware platform. This "device tree" can be passed to the kernel by the bootloader (uboot), and the kernel can obtain hardware information from the device tree.
Insert image description here

02. Device tree features

The device tree has two characteristics when describing hardware resources.

  • First, hardware resources are described in a "tree" structure. For example, the local bus is the "backbone" of the tree and is called the "root node" in the device tree. The IIC bus, SPI bus and UART bus mounted to the local bus are the "branches" of the tree and is called the "root node" in the device tree. There are more than one IIC devices under the IIC bus, and these "branches" can be further divided.
  • Second, the device tree can be like a header file (.h file). One device tree file refers to another device tree file, so that "code" can be reused. For example, multiple hardware platforms use i.MX6ULL as the main control chip, then we can write the hardware resources of the i.MX6ULL chip into a separate device tree file, generally using the ".dtsi" suffix, and other device tree files directly use " #includexxx" can be quoted.

03. Several common DTs

  • DTS refers to a file in .dts format, which is a device tree description in ASCII text format. It is also the device tree source code we want to write. Generally, one .dts file corresponds to one The hardware platform is located in the "/arch/arm/boot/dts" directory of the Linux source code.
  • DTSI refers to the device tree file officially provided by NXP and is a "shared" device tree file for the imx6ull platform.
  • DTC refers to the tool for compiling device tree source code. Generally, we need to install this compilation tool manually.
  • DTB is a file generated by compiling the device tree source code, similar to the ".bin" file generated by compiling the ".C" file in our C language.
  • DTBO is a file compiled and generated by the device tree overlay, which can be added to the DTB.

04. Reference

官网:https://www.devicetree.org/

05. Appendix

Guess you like

Origin blog.csdn.net/dengjin20104042056/article/details/134424949