The Linux device tree in my eyes (an overview)

Source: Internet
Author: User

An overview


Device tree is a set of rules for describing hardware zodiac. ARM Linux uses the device tree mechanism from the March 2011 Linux founder Linus Torvalds sent a mail, in which he advocated arm platform should refer to other platforms such as PowerPC device tree mechanism to describe the hardware. As a result of this, the arm platform used the old mechanism to describe the hardware in the Kernel/arch/arm/plat-xxx directory and the kernel/arch/arm/mach-xxx directory, such as registering platform devices, Declare the resource of the device and so on. Because this code is used to describe the chip platform and board-level differences, so for the kernel is garbage code. Because many of the companies in the embedded platform are using the ARM architecture, the code is growing as Android succeeds. It is said that the common platform such as the S3C2410 board level directory below the code has tens of thousands of lines, no wonder Linux Torvalds will say "This whole ARM thing is a fucking pain in the".

The documentation for the device tree in the kernel is located in the kernel/documentation/devicetree/directory. The device tree is a set of specifications defined by Power.org organization, the specification document can be found on the official website, the latest version is https://www.power.org/documentation/epapr-version-1-1/. The device tree-related functions in the kernel are all beginning with the, I guess the reason is that the device tree mechanism originates from the IEEE 1275 Open Firmware Standard specification, and the related code is inherited. If you want to quickly understand how to use the device tree, you can refer to Http://devicetree.org/Device_Tree_Usage.

The device tree describes the hardware from the perspective of software use, not from the hardware design perspective. We do not need to follow the hardware logic mechanically when writing the device tree, nor do we expect to find out how the hardware is designed by reading the device tree. For hardware that can be automatically recognized by software, such as USB devices, PCI devices, is also not necessary through the device tree description.

Specification of the device tree I think it can be divided into two categories according to the stipulated content. The first class is about the organization of the device tree, such as the name of the node is composed of which characters, length, etc., the first type of specification is more basic, is the premise of understanding the second type of norms. The second type of specification is about the contents of the device tree, such as how multicore CPUs are described, and the second type of specification can be seen as a specific application of the first type of specification. And the second type of specification according to the description of the content, the way to define the specification is also different, such as about the CPU, memory, interrupt these basic content, is described in the EPAPR, and the specification of the peripheral is in a special place to explain.

The Linux device tree in my eyes (an overview)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.