Device Tree Basic Concepts

1. Definition:

A data structure that describes hardware resources. The hardware resources are passed to the kernel through the bootloader , so that the kernel and hardware resource descriptions are relatively independent.

2. Advantages:

For different mainboards of the same SOC, only the device tree file .dtb needs to be replaced to achieve non-differential support for different mainboards without changing the kernel file.

3. The composition of the device tree

  • DTC:device tree comoiler
  • DTS:device tree source
  • DTB:device tree blob (binary file)

There is also a file in the device tree: dtsi file, because a SOC may have multiple different circuit boards, and each circuit board has a .dts. These dts are bound to have many common parts. In order to reduce code redundancy, the device tree extracts these common parts and saves them in the .dtsi file for common use by different dts.

4. How to use

dts will eventually be compiled into a dtb file, and the bootloader will pass the address of the device tree in memory to the kernel. Then the kernel parses and reads the corresponding hardware resources. Therefore, to support the device tree, not only the kernel support is required, but also the bootloader must support it.

Guess you like

Origin blog.csdn.net/Cloud_1234_5678/article/details/110224535