Device tree

The device tree is a data structure for describing hardware, which originated from Open Firmware. The data structure can hold any kind of data as internally it is a tree of named nodes and properties. Nodes contain properties and child nodes, while properties are name–value pairs.

Device trees are used by operating system software, particularly operating system kernels. Boot loaders can pass a device tree structure stored in flash (common) or one might be generated at boot time (rarely). As an example, Das U-Boot and kexec include support for device trees. Alternatively, device trees can be built into software such as the Linux kernel to handle cases where the boot loader is not device tree aware.

Usage in Linux

Given the correct device tree, the same compiled kernel can support different hardware configurations within a wider architecture family. The Linux kernel can read device tree information in the ARM, x86, MicroBlaze, PowerPC, and SPARC architectures. For ARM, use of device trees has become mandatory for all new SoCs.[1] This can be seen as a remedy to the vast number of forks (of Linux and Das U-boot) that has historically been created to support (marginally) different ARM boards. Allegedly, the purpose is to move a significant part of the hardware description out of the kernel binary, and into the compiled device tree blob, which is handed to the kernel by the boot loader, replacing a range of board-specific C source files and compile-time options in the kernel.[2]

It has been customary of ARM-based Linux distributions to include a boot loader, that necessarily was customised for specific boards, for example Raspberry Pi or Hackberry A10. This has created problems for the creators of Linux distributions as some part of the operating system must be compiled specifically for every board variant, or updated to support new boards. However, some modern SoCs (for example, Freescale i.MX6) have a vendor-provided boot loader with device tree on a separate chip from the operating system.[3]

A proprietary configuration file format used for similar purposes, the FEX file format,[4] is a de facto standard among Allwinner SoCs.

See also

References


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.