what is Device Tree in Linux ? what is the Advantages and Disadvantages of Device Tree?
If anyone know Device Tree in details ,Please help answering above questions .
A device tree is a tree-structured data format that represents information about the devices on a board. For developing a product with the platform, the device tree data is automatically included in the flashed image.
The device tree is a set of text files in the Linux kernel source tree that describe the hardware of a certain platform. They are located at arch/arm/boot/dts/ and can have two extensions: *. dtsi files are device tree source include files.
A device tree is a tree data structure that describes the hardware configuration of the system to the Linux operating system. During boot, the Linux kernel will use the information in the device tree to recognize, load appropriate drivers and manage the hardware devices in the system.
A utility called device tree compiler (DTC) is used to compile the DTS file into a DTB file. DTC is part of the Linux source directory. linux-xlnx/scripts/dtc/ contains the source code for DTC and needs to be compiled in order to be used. One way to compile the DTC is to build the Linux tree.
The device tree is a description of hardware components in a system, here is the list of device tree files in linux for the arm arch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts?id=refs/tags/v3.10
From here:
http://devicetree.org/Device_Tree_Usage
The device tree is a simple tree structure of nodes and properties. Properties are key-value pairs, and node may contain both properties and child nodes
The nodes of the tree describe parameters that the linux kernel, or other software systems like u-boot, uses to init hardware.
Some of the advantages include:
Some of the disadvantages includes:
For me writing a .dts file is almost 100% trial and error, pulling examples from other .dts files and see what it does and if it gets closer to what I want... Often times the examples are all I have to work with, and there isn't much in the way of an explanation of what is going on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With