Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Difference between revisions of "Device Trees"

From eLinux.org
Jump to: navigation, search
m (Introduction: italicize kernel source path)
(Update Introduction section and add Definition of FDT)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
Device trees are a method used by the operating system to determine the hardware
+
The Flattened Device Tree (FDT) is a data structure for describing the
configurationDevice trees were originally developed for the PowerPC OpenFirmware
+
hardware in a system.  It is a derived from the device tree format used
software, as a way to encapsulate platform information and convey it to the  
+
by Open Firmware to encapsulate platform information and convey it to the-
operating system.  The Linux kernel currently can read device tree information
+
operating system.  The operating system uses the FDT data to find and
for x86 and ppc architectures.  There is interest in extending support for
+
register the devices in the system.
 +
 
 +
Currently the Linux kernel can read device tree information in the x86,
 +
PowerPC and Sparc architectures.  There is interest in extending support for
 
device trees to other platforms, to unify the handling of platform description
 
device trees to other platforms, to unify the handling of platform description
 
across kernel architectures.
 
across kernel architectures.
 
A device tree can be built at compile-time and statically linked into the kernel.
 
Or it can be created by the bootloader firmware and passed to the kernel at
 
boot time. The operating system reads the device tree and uses it to figure out
 
such things like how much memory is available, bus layout, list of devices, and
 
how interrupts are connected.
 
  
 
The Linux kernel includes a "compiler" which takes a device tree description
 
The Linux kernel includes a "compiler" which takes a device tree description
in "dts" format and produces a binary, "dtc", format, suitable for linking
+
in "dts" format and produces a binary, "dtb", format, suitable for linking
 
into the kernel.  See <tt>scripts/dtc</tt> in the kernel source directory.
 
into the kernel.  See <tt>scripts/dtc</tt> in the kernel source directory.
  
Line 21: Line 18:
 
Linux kernel source tree at:
 
Linux kernel source tree at:
 
[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/powerpc/booting-without-of.txt;hb=HEAD Documentation/powerpc/booting-without-of.txt]
 
[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/powerpc/booting-without-of.txt;hb=HEAD Documentation/powerpc/booting-without-of.txt]
 +
 +
== The Flattened Device Tree is... ==
 +
The Flattened Device Tree (FDT) is a data structure.  Nothing more.
 +
 +
It describes a machine hardware configuration.  It is
 +
derived from the device tree format used by Open Firmware.  The format is expressive and able to describe
 +
most board design aspects including:
 +
* the number and type of CPUs,
 +
* base addresses and size of RAM,
 +
* busses and bridges,
 +
* peripheral device connections, and
 +
* interrupt controllers and IRQ line connections.
 +
 +
Just like initrd images, an FDT image can either be statically linked into the kernel or passed to the kernel
 +
at boot time.
  
 
== Resources ==
 
== Resources ==

Revision as of 07:34, 3 August 2009

Introduction

The Flattened Device Tree (FDT) is a data structure for describing the hardware in a system. It is a derived from the device tree format used by Open Firmware to encapsulate platform information and convey it to the- operating system. The operating system uses the FDT data to find and register the devices in the system.

Currently the Linux kernel can read device tree information in the x86, PowerPC and Sparc architectures. There is interest in extending support for device trees to other platforms, to unify the handling of platform description across kernel architectures.

The Linux kernel includes a "compiler" which takes a device tree description in "dts" format and produces a binary, "dtb", format, suitable for linking into the kernel. See scripts/dtc in the kernel source directory.

There is documentation describing device tree support (with information current as of 2006) in the Linux kernel source tree at: Documentation/powerpc/booting-without-of.txt

The Flattened Device Tree is...

The Flattened Device Tree (FDT) is a data structure. Nothing more.

It describes a machine hardware configuration. It is derived from the device tree format used by Open Firmware. The format is expressive and able to describe most board design aspects including:

  • the number and type of CPUs,
  • base addresses and size of RAM,
  • busses and bridges,
  • peripheral device connections, and
  • interrupt controllers and IRQ line connections.

Just like initrd images, an FDT image can either be statically linked into the kernel or passed to the kernel at boot time.

Resources

Presentations and Papers

"Using the Device Tree to Describe Embedded Hardware" - Grant Likely, Embedded Linux Conference, 2008 http://www.celinux.org/elc08_presentations/glikely--device-tree.pdf

"A Symphony of Flavours: Using the device tree to describe embedded hardware" - Grant Likely and Josh Boyer - paper for OLS 2008 http://ols.fedoraproject.org/OLS/Reprints-2008/likely2-reprint.pdf

Note from Device Tree Birds of a Feature session at OLS 2008: http://lists.ozlabs.org/pipermail/devicetree-discuss/2008-July/000004.html

Coming Up Soon

Grant's talk at Plumber's conference 2009 - http://linuxplumbersconf.org/ocw/proposals/47

Device-tree Mailing List

https://lists.ozlabs.org/listinfo/devicetree-discuss

Mailing list discussion

Recent discussion of "Flattened Device Tree" work on linux-embedded mailing list: http://www.mail-archive.com/linux-embedded@vger.kernel.org/msg01721.html

Russel King is against adding support for FDT to the ARM platform: http://lkml.indiana.edu/hypermail/linux/kernel/0905.3/01942.html (see whole thread for interesting discussion)

David Gibson defends FDT: http://lkml.indiana.edu/hypermail/linux/kernel/0905.3/02304.html

Xilink device tree generator documentation

Xilinx provides a device-tree generator: http://xilinx.wikidot.com/device-tree-generator "The device tree generator is a Xilinx EDK tool that plugs into the Automatic BSP Generation features of the tool, XPS"