Devicetree: Difference between revisions

Content deleted Content added
Introiboad (talk | contribs)
No edit summary
Citation bot (talk | contribs)
Removed URL that duplicated identifier. | Use this bot. Report bugs. | #UCB_CommandLine
 
Line 22:
Given the correct device tree, the same compiled kernel can support different hardware configurations within a wider architecture family. The [[Linux kernel]] for the [[ARC (processor)|ARC]], [[ARM architecture|ARM]], [[C6x]], [[H8/300]], [[MicroBlaze]], [[MIPS architecture|MIPS]], NDS32, [[Nios II]], [[OpenRISC]], [[PowerPC]], [[Power ISA]], [[RISC-V]], [[SuperH]], and [[Xtensa]] architectures reads device tree information; on ARM, device trees have been mandatory for all new [[System on chip|SoCs]] since 2012.<ref name="Arm-soc-checklist">{{cite web |title=ARM SoC Linux support checklist |url=http://www.elinux.org/images/a/ad/Arm-soc-checklist.pdf}}</ref> This can be seen as a remedy to the vast number of forks (of Linux and Das U-Boot) that have historically been created to support (marginally) different ARM boards. 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 (programming language)|C]] [[source code|source files]] and compile-time options in the kernel.<ref name="Arm-soc-checklist"/>
 
It is specified in a Devicetree Source file (.dts) and is compiled into a Devicetree Blob or device tree binary (.dtb) file (also known as the flattened device tree)<ref>{{cite web |url=https://developer.arm.com/documentation/den0013/d/Boot-Code/Booting-Linux/Kernel-parameters-using-Flattened-Device-Trees |title=Kernel parameters using Flattened Device Trees |publisher=[[Arm Developer]]}}</ref> through the Devicetree compiler (DTC). Device tree source files can [[Include directive|include]] other files, referred to as device tree source includes.<ref>{{Cite book|last=Simmonds|first=Chris|url=https://www.worldcat.org/oclc/995052708|title=Mastering embedded Linux programming : unleash the full potential of embedded Linux|date=2017|isbn=978-1-78728-885-0|edition=Second|___location=Birmingham, UK|oclc=995052708}}</ref><ref name="dtv03"/>
 
It has been customary for ARM-based [[Linux distribution]]s to include a boot loader that necessarily was customized 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.<ref>{{cite web |title=u-boot update for Ezurio's boards |date=8 November 2013 |url=https://www.ezurio.com/resources/blog/u-boot-2013-10-release}}</ref>
Line 37:
 
=== Coreboot ===
The [[coreboot]] project makes use of device trees, but they are different from the flattened device trees used in the Linux kernel.<ref>{{Cite book |last=Sun |first=Jiming |url=https://www.worldcat.org/oclc/902804314 |title=Embedded firmware solutions: development best practices for the internet of things |date=2015 |others=Vincent Zimmer, Marc Jones, Stefan Reinauer |isbn=978-1-4842-0070-4 |___location=[United States] |pages=82 |oclc=902804314}}</ref>
 
== Example ==