herunterladen
![](https://oss-datasheet.aipcba.com/html/5338BF45F5319DEAEBA1073626CF2336/bg1.png)
1 Introduction
A device tree is a tree structure used to describe the physical
hardware in a system. Each node in the tree describes the
characteristics of the device being represented. The purpose of
the device tree is to describe device information in a system
that cannot necessarily be dynamically detected or discovered
by a client program. For example, a PCI host may be able to
probe and detect attached devices; and so a device tree node
describing PCI devices may not be required. However, a
device node is required to describe the PCI host bridge in the
system, if that cannot be detected by probing.
Before the advent of the device tree, the kernel contained
device specific code. A small change, such as the modification
of an I2C peripheral’s address would force a recompilation of
the kernel image to be run.
The boot loader (for example, U-Boot) would load a single
binary, the kernel image, and execute it.
Prior to device trees, several attempts were made to reduce
complexity and pass small amounts of information to the
kernel. The boot loader would typically prepare some
additional information and place it in system ram at a location
pointed to by a predefined register. This information would
contain some basic information, such as memory size and
location, and kernel command line information, such as IP
address. The goal was to allow the kernel to configure
Freescale Semiconductor
Document Number: AN5125
Application Note
Rev. 0, 09/2015
Introduction to Device Trees
© 2015 Freescale Semiconductor, Inc.
Contents
1 Introduction.............................. .............................. 1
2 Basic device tree......................................................2
3 Syntax................................ ..................................... 3
4 Memory mapping and addressing..... ..................... 4
5 Interrupts.................................................................7
6 Example: Device tree node............... ......................8
7 Device tree inclusion..................... ......................... 9
8 Device tree compiler............................................. 11
9 U-Boot................................................................... 11
10 Linux..................................................................... 12
11 Examples...............................................................15
12 Revision history.................................................... 33