blob: a1f83f1c24c97a5e9bfaa3979dbe8c66fc7fd875 [file] [log] [blame]
David Gibsonc125a182006-02-01 03:05:22 -08001 Booting the Linux/ppc kernel without Open Firmware
2 --------------------------------------------------
3
4
5(c) 2005 Benjamin Herrenschmidt <benh at kernel.crashing.org>,
6 IBM Corp.
7(c) 2005 Becky Bruce <becky.bruce at freescale.com>,
8 Freescale Semiconductor, FSL SOC and 32-bit additions
Vitaly Wool28f9ec32006-11-20 16:32:39 +03009(c) 2006 MontaVista Software, Inc.
10 Flash chip node definition
David Gibsonc125a182006-02-01 03:05:22 -080011
12 May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet.
13
14 May 19, 2005: Rev 0.2 - Add chapter III and bits & pieces here or
15 clarifies the fact that a lot of things are
16 optional, the kernel only requires a very
17 small device tree, though it is encouraged
18 to provide an as complete one as possible.
19
20 May 24, 2005: Rev 0.3 - Precise that DT block has to be in RAM
21 - Misc fixes
22 - Define version 3 and new format version 16
23 for the DT block (version 16 needs kernel
24 patches, will be fwd separately).
25 String block now has a size, and full path
26 is replaced by unit name for more
27 compactness.
28 linux,phandle is made optional, only nodes
29 that are referenced by other nodes need it.
30 "name" property is now automatically
31 deduced from the unit name
32
33 June 1, 2005: Rev 0.4 - Correct confusion between OF_DT_END and
34 OF_DT_END_NODE in structure definition.
35 - Change version 16 format to always align
36 property data to 4 bytes. Since tokens are
37 already aligned, that means no specific
Matt LaPlante5d3f0832006-11-30 05:21:10 +010038 required alignment between property size
David Gibsonc125a182006-02-01 03:05:22 -080039 and property data. The old style variable
40 alignment would make it impossible to do
41 "simple" insertion of properties using
42 memove (thanks Milton for
43 noticing). Updated kernel patch as well
Matt LaPlante5d3f0832006-11-30 05:21:10 +010044 - Correct a few more alignment constraints
David Gibsonc125a182006-02-01 03:05:22 -080045 - Add a chapter about the device-tree
46 compiler and the textural representation of
47 the tree that can be "compiled" by dtc.
48
David Gibsonc125a182006-02-01 03:05:22 -080049 November 21, 2005: Rev 0.5
50 - Additions/generalizations for 32-bit
51 - Changed to reflect the new arch/powerpc
52 structure
53 - Added chapter VI
54
55
56 ToDo:
57 - Add some definitions of interrupt tree (simple/complex)
58 - Add some definitions for pci host bridges
59 - Add some common address format examples
60 - Add definitions for standard properties and "compatible"
61 names for cells that are not already defined by the existing
62 OF spec.
63 - Compare FSL SOC use of PCI to standard and make sure no new
64 node definition required.
65 - Add more information about node definitions for SOC devices
66 that currently have no standard, like the FSL CPM.
67
68
69I - Introduction
70================
71
72During the recent development of the Linux/ppc64 kernel, and more
73specifically, the addition of new platform types outside of the old
74IBM pSeries/iSeries pair, it was decided to enforce some strict rules
75regarding the kernel entry and bootloader <-> kernel interfaces, in
76order to avoid the degeneration that had become the ppc32 kernel entry
77point and the way a new platform should be added to the kernel. The
78legacy iSeries platform breaks those rules as it predates this scheme,
79but no new board support will be accepted in the main tree that
80doesn't follows them properly. In addition, since the advent of the
81arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit
82platforms and 32-bit platforms which move into arch/powerpc will be
83required to use these rules as well.
84
85The main requirement that will be defined in more detail below is
86the presence of a device-tree whose format is defined after Open
87Firmware specification. However, in order to make life easier
88to embedded board vendors, the kernel doesn't require the device-tree
89to represent every device in the system and only requires some nodes
90and properties to be present. This will be described in detail in
91section III, but, for example, the kernel does not require you to
92create a node for every PCI device in the system. It is a requirement
93to have a node for PCI host bridges in order to provide interrupt
94routing informations and memory/IO ranges, among others. It is also
95recommended to define nodes for on chip devices and other busses that
96don't specifically fit in an existing OF specification. This creates a
97great flexibility in the way the kernel can then probe those and match
98drivers to device, without having to hard code all sorts of tables. It
99also makes it more flexible for board vendors to do minor hardware
100upgrades without significantly impacting the kernel code or cluttering
101it with special cases.
102
103
1041) Entry point for arch/powerpc
105-------------------------------
106
107 There is one and one single entry point to the kernel, at the start
108 of the kernel image. That entry point supports two calling
109 conventions:
110
111 a) Boot from Open Firmware. If your firmware is compatible
112 with Open Firmware (IEEE 1275) or provides an OF compatible
113 client interface API (support for "interpret" callback of
114 forth words isn't required), you can enter the kernel with:
115
116 r5 : OF callback pointer as defined by IEEE 1275
117 bindings to powerpc. Only the 32 bit client interface
118 is currently supported
119
120 r3, r4 : address & length of an initrd if any or 0
121
122 The MMU is either on or off; the kernel will run the
123 trampoline located in arch/powerpc/kernel/prom_init.c to
124 extract the device-tree and other information from open
125 firmware and build a flattened device-tree as described
126 in b). prom_init() will then re-enter the kernel using
127 the second method. This trampoline code runs in the
128 context of the firmware, which is supposed to handle all
129 exceptions during that time.
130
131 b) Direct entry with a flattened device-tree block. This entry
132 point is called by a) after the OF trampoline and can also be
133 called directly by a bootloader that does not support the Open
134 Firmware client interface. It is also used by "kexec" to
135 implement "hot" booting of a new kernel from a previous
136 running one. This method is what I will describe in more
137 details in this document, as method a) is simply standard Open
138 Firmware, and thus should be implemented according to the
139 various standard documents defining it and its binding to the
140 PowerPC platform. The entry point definition then becomes:
141
142 r3 : physical pointer to the device-tree block
143 (defined in chapter II) in RAM
144
145 r4 : physical pointer to the kernel itself. This is
146 used by the assembly code to properly disable the MMU
147 in case you are entering the kernel with MMU enabled
148 and a non-1:1 mapping.
149
Matt LaPlante2fe0ae72006-10-03 22:50:39 +0200150 r5 : NULL (as to differentiate with method a)
David Gibsonc125a182006-02-01 03:05:22 -0800151
152 Note about SMP entry: Either your firmware puts your other
153 CPUs in some sleep loop or spin loop in ROM where you can get
154 them out via a soft reset or some other means, in which case
155 you don't need to care, or you'll have to enter the kernel
156 with all CPUs. The way to do that with method b) will be
157 described in a later revision of this document.
158
159
1602) Board support
161----------------
162
16364-bit kernels:
164
165 Board supports (platforms) are not exclusive config options. An
166 arbitrary set of board supports can be built in a single kernel
167 image. The kernel will "know" what set of functions to use for a
168 given platform based on the content of the device-tree. Thus, you
169 should:
170
171 a) add your platform support as a _boolean_ option in
172 arch/powerpc/Kconfig, following the example of PPC_PSERIES,
173 PPC_PMAC and PPC_MAPLE. The later is probably a good
174 example of a board support to start from.
175
176 b) create your main platform file as
177 "arch/powerpc/platforms/myplatform/myboard_setup.c" and add it
178 to the Makefile under the condition of your CONFIG_
179 option. This file will define a structure of type "ppc_md"
180 containing the various callbacks that the generic code will
181 use to get to your platform specific code
182
183 c) Add a reference to your "ppc_md" structure in the
184 "machines" table in arch/powerpc/kernel/setup_64.c if you are
185 a 64-bit platform.
186
187 d) request and get assigned a platform number (see PLATFORM_*
188 constants in include/asm-powerpc/processor.h
189
19032-bit embedded kernels:
191
192 Currently, board support is essentially an exclusive config option.
193 The kernel is configured for a single platform. Part of the reason
194 for this is to keep kernels on embedded systems small and efficient;
195 part of this is due to the fact the code is already that way. In the
196 future, a kernel may support multiple platforms, but only if the
197 platforms feature the same core architectire. A single kernel build
198 cannot support both configurations with Book E and configurations
199 with classic Powerpc architectures.
200
201 32-bit embedded platforms that are moved into arch/powerpc using a
202 flattened device tree should adopt the merged tree practice of
203 setting ppc_md up dynamically, even though the kernel is currently
204 built with support for only a single platform at a time. This allows
205 unification of the setup code, and will make it easier to go to a
206 multiple-platform-support model in the future.
207
208NOTE: I believe the above will be true once Ben's done with the merge
209of the boot sequences.... someone speak up if this is wrong!
210
211 To add a 32-bit embedded platform support, follow the instructions
212 for 64-bit platforms above, with the exception that the Kconfig
213 option should be set up such that the kernel builds exclusively for
214 the platform selected. The processor type for the platform should
215 enable another config option to select the specific board
216 supported.
217
218NOTE: If ben doesn't merge the setup files, may need to change this to
219point to setup_32.c
220
221
222 I will describe later the boot process and various callbacks that
223 your platform should implement.
224
225
226II - The DT block format
227========================
228
229
230This chapter defines the actual format of the flattened device-tree
231passed to the kernel. The actual content of it and kernel requirements
232are described later. You can find example of code manipulating that
233format in various places, including arch/powerpc/kernel/prom_init.c
234which will generate a flattened device-tree from the Open Firmware
235representation, or the fs2dt utility which is part of the kexec tools
236which will generate one from a filesystem representation. It is
237expected that a bootloader like uboot provides a bit more support,
238that will be discussed later as well.
239
240Note: The block has to be in main memory. It has to be accessible in
241both real mode and virtual mode with no mapping other than main
242memory. If you are writing a simple flash bootloader, it should copy
243the block to RAM before passing it to the kernel.
244
245
2461) Header
247---------
248
249 The kernel is entered with r3 pointing to an area of memory that is
Matt LaPlanted6bc8ac2006-10-03 22:54:15 +0200250 roughly described in include/asm-powerpc/prom.h by the structure
David Gibsonc125a182006-02-01 03:05:22 -0800251 boot_param_header:
252
253struct boot_param_header {
254 u32 magic; /* magic word OF_DT_HEADER */
255 u32 totalsize; /* total size of DT block */
256 u32 off_dt_struct; /* offset to structure */
257 u32 off_dt_strings; /* offset to strings */
258 u32 off_mem_rsvmap; /* offset to memory reserve map
259*/
260 u32 version; /* format version */
261 u32 last_comp_version; /* last compatible version */
262
263 /* version 2 fields below */
264 u32 boot_cpuid_phys; /* Which physical CPU id we're
265 booting on */
266 /* version 3 fields below */
267 u32 size_dt_strings; /* size of the strings block */
David Gibson0e0293c2007-03-14 11:50:40 +1100268
269 /* version 17 fields below */
270 u32 size_dt_struct; /* size of the DT structure block */
David Gibsonc125a182006-02-01 03:05:22 -0800271};
272
273 Along with the constants:
274
275/* Definitions used by the flattened device tree */
276#define OF_DT_HEADER 0xd00dfeed /* 4: version,
277 4: total size */
278#define OF_DT_BEGIN_NODE 0x1 /* Start node: full name
279*/
280#define OF_DT_END_NODE 0x2 /* End node */
281#define OF_DT_PROP 0x3 /* Property: name off,
282 size, content */
283#define OF_DT_END 0x9
284
285 All values in this header are in big endian format, the various
286 fields in this header are defined more precisely below. All
287 "offset" values are in bytes from the start of the header; that is
288 from the value of r3.
289
290 - magic
291
292 This is a magic value that "marks" the beginning of the
293 device-tree block header. It contains the value 0xd00dfeed and is
294 defined by the constant OF_DT_HEADER
295
296 - totalsize
297
298 This is the total size of the DT block including the header. The
299 "DT" block should enclose all data structures defined in this
300 chapter (who are pointed to by offsets in this header). That is,
301 the device-tree structure, strings, and the memory reserve map.
302
303 - off_dt_struct
304
305 This is an offset from the beginning of the header to the start
306 of the "structure" part the device tree. (see 2) device tree)
307
308 - off_dt_strings
309
310 This is an offset from the beginning of the header to the start
311 of the "strings" part of the device-tree
312
313 - off_mem_rsvmap
314
315 This is an offset from the beginning of the header to the start
316 of the reserved memory map. This map is a list of pairs of 64
317 bit integers. Each pair is a physical address and a size. The
318
319 list is terminated by an entry of size 0. This map provides the
320 kernel with a list of physical memory areas that are "reserved"
321 and thus not to be used for memory allocations, especially during
322 early initialization. The kernel needs to allocate memory during
323 boot for things like un-flattening the device-tree, allocating an
324 MMU hash table, etc... Those allocations must be done in such a
325 way to avoid overriding critical things like, on Open Firmware
326 capable machines, the RTAS instance, or on some pSeries, the TCE
327 tables used for the iommu. Typically, the reserve map should
328 contain _at least_ this DT block itself (header,total_size). If
329 you are passing an initrd to the kernel, you should reserve it as
330 well. You do not need to reserve the kernel image itself. The map
331 should be 64 bit aligned.
332
333 - version
334
335 This is the version of this structure. Version 1 stops
336 here. Version 2 adds an additional field boot_cpuid_phys.
337 Version 3 adds the size of the strings block, allowing the kernel
338 to reallocate it easily at boot and free up the unused flattened
339 structure after expansion. Version 16 introduces a new more
340 "compact" format for the tree itself that is however not backward
David Gibson0e0293c2007-03-14 11:50:40 +1100341 compatible. Version 17 adds an additional field, size_dt_struct,
342 allowing it to be reallocated or moved more easily (this is
343 particularly useful for bootloaders which need to make
344 adjustments to a device tree based on probed information). You
345 should always generate a structure of the highest version defined
346 at the time of your implementation. Currently that is version 17,
347 unless you explicitly aim at being backward compatible.
David Gibsonc125a182006-02-01 03:05:22 -0800348
349 - last_comp_version
350
351 Last compatible version. This indicates down to what version of
352 the DT block you are backward compatible. For example, version 2
353 is backward compatible with version 1 (that is, a kernel build
354 for version 1 will be able to boot with a version 2 format). You
355 should put a 1 in this field if you generate a device tree of
David Gibson0e0293c2007-03-14 11:50:40 +1100356 version 1 to 3, or 16 if you generate a tree of version 16 or 17
David Gibsonc125a182006-02-01 03:05:22 -0800357 using the new unit name format.
358
359 - boot_cpuid_phys
360
361 This field only exist on version 2 headers. It indicate which
362 physical CPU ID is calling the kernel entry point. This is used,
363 among others, by kexec. If you are on an SMP system, this value
364 should match the content of the "reg" property of the CPU node in
365 the device-tree corresponding to the CPU calling the kernel entry
366 point (see further chapters for more informations on the required
367 device-tree contents)
368
David Gibson0e0293c2007-03-14 11:50:40 +1100369 - size_dt_strings
370
371 This field only exists on version 3 and later headers. It
372 gives the size of the "strings" section of the device tree (which
373 starts at the offset given by off_dt_strings).
374
375 - size_dt_struct
376
377 This field only exists on version 17 and later headers. It gives
378 the size of the "structure" section of the device tree (which
379 starts at the offset given by off_dt_struct).
David Gibsonc125a182006-02-01 03:05:22 -0800380
381 So the typical layout of a DT block (though the various parts don't
382 need to be in that order) looks like this (addresses go from top to
383 bottom):
384
385
386 ------------------------------
387 r3 -> | struct boot_param_header |
388 ------------------------------
389 | (alignment gap) (*) |
390 ------------------------------
391 | memory reserve map |
392 ------------------------------
393 | (alignment gap) |
394 ------------------------------
395 | |
396 | device-tree structure |
397 | |
398 ------------------------------
399 | (alignment gap) |
400 ------------------------------
401 | |
402 | device-tree strings |
403 | |
404 -----> ------------------------------
405 |
406 |
407 --- (r3 + totalsize)
408
409 (*) The alignment gaps are not necessarily present; their presence
410 and size are dependent on the various alignment requirements of
411 the individual data blocks.
412
413
4142) Device tree generalities
415---------------------------
416
417This device-tree itself is separated in two different blocks, a
418structure block and a strings block. Both need to be aligned to a 4
419byte boundary.
420
421First, let's quickly describe the device-tree concept before detailing
422the storage format. This chapter does _not_ describe the detail of the
423required types of nodes & properties for the kernel, this is done
424later in chapter III.
425
426The device-tree layout is strongly inherited from the definition of
427the Open Firmware IEEE 1275 device-tree. It's basically a tree of
428nodes, each node having two or more named properties. A property can
429have a value or not.
430
431It is a tree, so each node has one and only one parent except for the
432root node who has no parent.
433
434A node has 2 names. The actual node name is generally contained in a
435property of type "name" in the node property list whose value is a
436zero terminated string and is mandatory for version 1 to 3 of the
David Gibson0e0293c2007-03-14 11:50:40 +1100437format definition (as it is in Open Firmware). Version 16 makes it
David Gibsonc125a182006-02-01 03:05:22 -0800438optional as it can generate it from the unit name defined below.
439
Matt LaPlante2fe0ae72006-10-03 22:50:39 +0200440There is also a "unit name" that is used to differentiate nodes with
David Gibsonc125a182006-02-01 03:05:22 -0800441the same name at the same level, it is usually made of the node
Matt LaPlante2fe0ae72006-10-03 22:50:39 +0200442names, the "@" sign, and a "unit address", which definition is
David Gibsonc125a182006-02-01 03:05:22 -0800443specific to the bus type the node sits on.
444
445The unit name doesn't exist as a property per-se but is included in
446the device-tree structure. It is typically used to represent "path" in
447the device-tree. More details about the actual format of these will be
448below.
449
450The kernel powerpc generic code does not make any formal use of the
451unit address (though some board support code may do) so the only real
452requirement here for the unit address is to ensure uniqueness of
453the node unit name at a given level of the tree. Nodes with no notion
454of address and no possible sibling of the same name (like /memory or
455/cpus) may omit the unit address in the context of this specification,
456or use the "@0" default unit address. The unit name is used to define
457a node "full path", which is the concatenation of all parent node
458unit names separated with "/".
459
460The root node doesn't have a defined name, and isn't required to have
461a name property either if you are using version 3 or earlier of the
462format. It also has no unit address (no @ symbol followed by a unit
463address). The root node unit name is thus an empty string. The full
464path to the root node is "/".
465
466Every node which actually represents an actual device (that is, a node
467which isn't only a virtual "container" for more nodes, like "/cpus"
468is) is also required to have a "device_type" property indicating the
469type of node .
470
471Finally, every node that can be referenced from a property in another
472node is required to have a "linux,phandle" property. Real open
473firmware implementations provide a unique "phandle" value for every
474node that the "prom_init()" trampoline code turns into
475"linux,phandle" properties. However, this is made optional if the
476flattened device tree is used directly. An example of a node
477referencing another node via "phandle" is when laying out the
478interrupt tree which will be described in a further version of this
479document.
480
481This "linux, phandle" property is a 32 bit value that uniquely
482identifies a node. You are free to use whatever values or system of
483values, internal pointers, or whatever to generate these, the only
484requirement is that every node for which you provide that property has
485a unique value for it.
486
487Here is an example of a simple device-tree. In this example, an "o"
488designates a node followed by the node unit name. Properties are
489presented with their name followed by their content. "content"
490represents an ASCII string (zero terminated) value, while <content>
491represents a 32 bit hexadecimal value. The various nodes in this
492example will be discussed in a later chapter. At this point, it is
493only meant to give you a idea of what a device-tree looks like. I have
494purposefully kept the "name" and "linux,phandle" properties which
495aren't necessary in order to give you a better idea of what the tree
496looks like in practice.
497
498 / o device-tree
499 |- name = "device-tree"
500 |- model = "MyBoardName"
501 |- compatible = "MyBoardFamilyName"
502 |- #address-cells = <2>
503 |- #size-cells = <2>
504 |- linux,phandle = <0>
505 |
506 o cpus
507 | | - name = "cpus"
508 | | - linux,phandle = <1>
509 | | - #address-cells = <1>
510 | | - #size-cells = <0>
511 | |
512 | o PowerPC,970@0
513 | |- name = "PowerPC,970"
514 | |- device_type = "cpu"
515 | |- reg = <0>
516 | |- clock-frequency = <5f5e1000>
Timur Tabi32aed2a2007-02-14 15:29:07 -0600517 | |- 64-bit
David Gibsonc125a182006-02-01 03:05:22 -0800518 | |- linux,phandle = <2>
519 |
520 o memory@0
521 | |- name = "memory"
522 | |- device_type = "memory"
523 | |- reg = <00000000 00000000 00000000 20000000>
524 | |- linux,phandle = <3>
525 |
526 o chosen
527 |- name = "chosen"
528 |- bootargs = "root=/dev/sda2"
David Gibsonc125a182006-02-01 03:05:22 -0800529 |- linux,phandle = <4>
530
531This tree is almost a minimal tree. It pretty much contains the
532minimal set of required nodes and properties to boot a linux kernel;
533that is, some basic model informations at the root, the CPUs, and the
534physical memory layout. It also includes misc information passed
535through /chosen, like in this example, the platform type (mandatory)
536and the kernel command line arguments (optional).
537
Timur Tabi32aed2a2007-02-14 15:29:07 -0600538The /cpus/PowerPC,970@0/64-bit property is an example of a
David Gibsonc125a182006-02-01 03:05:22 -0800539property without a value. All other properties have a value. The
540significance of the #address-cells and #size-cells properties will be
541explained in chapter IV which defines precisely the required nodes and
542properties and their content.
543
544
5453) Device tree "structure" block
546
547The structure of the device tree is a linearized tree structure. The
548"OF_DT_BEGIN_NODE" token starts a new node, and the "OF_DT_END_NODE"
549ends that node definition. Child nodes are simply defined before
550"OF_DT_END_NODE" (that is nodes within the node). A 'token' is a 32
551bit value. The tree has to be "finished" with a OF_DT_END token
552
553Here's the basic structure of a single node:
554
555 * token OF_DT_BEGIN_NODE (that is 0x00000001)
556 * for version 1 to 3, this is the node full path as a zero
557 terminated string, starting with "/". For version 16 and later,
558 this is the node unit name only (or an empty string for the
559 root node)
560 * [align gap to next 4 bytes boundary]
561 * for each property:
562 * token OF_DT_PROP (that is 0x00000003)
563 * 32 bit value of property value size in bytes (or 0 of no
564 * value)
565 * 32 bit value of offset in string block of property name
566 * property value data if any
567 * [align gap to next 4 bytes boundary]
568 * [child nodes if any]
569 * token OF_DT_END_NODE (that is 0x00000002)
570
Matt LaPlante53cb4722006-10-03 22:55:17 +0200571So the node content can be summarised as a start token, a full path,
572a list of properties, a list of child nodes, and an end token. Every
David Gibsonc125a182006-02-01 03:05:22 -0800573child node is a full node structure itself as defined above.
574
Matt LaPlante53cb4722006-10-03 22:55:17 +02005754) Device tree "strings" block
David Gibsonc125a182006-02-01 03:05:22 -0800576
577In order to save space, property names, which are generally redundant,
578are stored separately in the "strings" block. This block is simply the
579whole bunch of zero terminated strings for all property names
580concatenated together. The device-tree property definitions in the
581structure block will contain offset values from the beginning of the
582strings block.
583
584
585III - Required content of the device tree
586=========================================
587
588WARNING: All "linux,*" properties defined in this document apply only
589to a flattened device-tree. If your platform uses a real
590implementation of Open Firmware or an implementation compatible with
591the Open Firmware client interface, those properties will be created
592by the trampoline code in the kernel's prom_init() file. For example,
593that's where you'll have to add code to detect your board model and
Matt LaPlantea2ffd272006-10-03 22:49:15 +0200594set the platform number. However, when using the flattened device-tree
David Gibsonc125a182006-02-01 03:05:22 -0800595entry point, there is no prom_init() pass, and thus you have to
596provide those properties yourself.
597
598
5991) Note about cells and address representation
600----------------------------------------------
601
602The general rule is documented in the various Open Firmware
603documentations. If you chose to describe a bus with the device-tree
604and there exist an OF bus binding, then you should follow the
605specification. However, the kernel does not require every single
606device or bus to be described by the device tree.
607
608In general, the format of an address for a device is defined by the
609parent bus type, based on the #address-cells and #size-cells
610property. In the absence of such a property, the parent's parent
611values are used, etc... The kernel requires the root node to have
612those properties defining addresses format for devices directly mapped
613on the processor bus.
614
615Those 2 properties define 'cells' for representing an address and a
616size. A "cell" is a 32 bit number. For example, if both contain 2
617like the example tree given above, then an address and a size are both
618composed of 2 cells, and each is a 64 bit number (cells are
619concatenated and expected to be in big endian format). Another example
620is the way Apple firmware defines them, with 2 cells for an address
621and one cell for a size. Most 32-bit implementations should define
622#address-cells and #size-cells to 1, which represents a 32-bit value.
623Some 32-bit processors allow for physical addresses greater than 32
624bits; these processors should define #address-cells as 2.
625
626"reg" properties are always a tuple of the type "address size" where
627the number of cells of address and size is specified by the bus
628#address-cells and #size-cells. When a bus supports various address
629spaces and other flags relative to a given address allocation (like
630prefetchable, etc...) those flags are usually added to the top level
631bits of the physical address. For example, a PCI physical address is
632made of 3 cells, the bottom two containing the actual address itself
633while the top cell contains address space indication, flags, and pci
634bus & device numbers.
635
636For busses that support dynamic allocation, it's the accepted practice
637to then not provide the address in "reg" (keep it 0) though while
638providing a flag indicating the address is dynamically allocated, and
639then, to provide a separate "assigned-addresses" property that
640contains the fully allocated addresses. See the PCI OF bindings for
641details.
642
643In general, a simple bus with no address space bits and no dynamic
644allocation is preferred if it reflects your hardware, as the existing
645kernel address parsing functions will work out of the box. If you
646define a bus type with a more complex address format, including things
647like address space bits, you'll have to add a bus translator to the
648prom_parse.c file of the recent kernels for your bus type.
649
650The "reg" property only defines addresses and sizes (if #size-cells
Matt LaPlante992caac2006-10-03 22:52:05 +0200651is non-0) within a given bus. In order to translate addresses upward
David Gibsonc125a182006-02-01 03:05:22 -0800652(that is into parent bus addresses, and possibly into cpu physical
653addresses), all busses must contain a "ranges" property. If the
654"ranges" property is missing at a given level, it's assumed that
Matt LaPlante992caac2006-10-03 22:52:05 +0200655translation isn't possible. The format of the "ranges" property for a
David Gibsonc125a182006-02-01 03:05:22 -0800656bus is a list of:
657
658 bus address, parent bus address, size
659
660"bus address" is in the format of the bus this bus node is defining,
661that is, for a PCI bridge, it would be a PCI address. Thus, (bus
662address, size) defines a range of addresses for child devices. "parent
663bus address" is in the format of the parent bus of this bus. For
664example, for a PCI host controller, that would be a CPU address. For a
665PCI<->ISA bridge, that would be a PCI address. It defines the base
666address in the parent bus where the beginning of that range is mapped.
667
668For a new 64 bit powerpc board, I recommend either the 2/2 format or
669Apple's 2/1 format which is slightly more compact since sizes usually
670fit in a single 32 bit word. New 32 bit powerpc boards should use a
6711/1 format, unless the processor supports physical addresses greater
672than 32-bits, in which case a 2/1 format is recommended.
673
674
6752) Note about "compatible" properties
676-------------------------------------
677
678These properties are optional, but recommended in devices and the root
679node. The format of a "compatible" property is a list of concatenated
680zero terminated strings. They allow a device to express its
681compatibility with a family of similar devices, in some cases,
682allowing a single driver to match against several devices regardless
683of their actual names.
684
6853) Note about "name" properties
686-------------------------------
687
688While earlier users of Open Firmware like OldWorld macintoshes tended
689to use the actual device name for the "name" property, it's nowadays
690considered a good practice to use a name that is closer to the device
691class (often equal to device_type). For example, nowadays, ethernet
692controllers are named "ethernet", an additional "model" property
693defining precisely the chip type/model, and "compatible" property
694defining the family in case a single driver can driver more than one
695of these chips. However, the kernel doesn't generally put any
696restriction on the "name" property; it is simply considered good
697practice to follow the standard and its evolutions as closely as
698possible.
699
700Note also that the new format version 16 makes the "name" property
701optional. If it's absent for a node, then the node's unit name is then
702used to reconstruct the name. That is, the part of the unit name
703before the "@" sign is used (or the entire unit name if no "@" sign
704is present).
705
7064) Note about node and property names and character set
707-------------------------------------------------------
708
Matt LaPlantea2ffd272006-10-03 22:49:15 +0200709While open firmware provides more flexible usage of 8859-1, this
David Gibsonc125a182006-02-01 03:05:22 -0800710specification enforces more strict rules. Nodes and properties should
711be comprised only of ASCII characters 'a' to 'z', '0' to
712'9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally
713allow uppercase characters 'A' to 'Z' (property names should be
714lowercase. The fact that vendors like Apple don't respect this rule is
715irrelevant here). Additionally, node and property names should always
716begin with a character in the range 'a' to 'z' (or 'A' to 'Z' for node
717names).
718
719The maximum number of characters for both nodes and property names
720is 31. In the case of node names, this is only the leftmost part of
721a unit name (the pure "name" property), it doesn't include the unit
722address which can extend beyond that limit.
723
724
7255) Required nodes and properties
726--------------------------------
727 These are all that are currently required. However, it is strongly
728 recommended that you expose PCI host bridges as documented in the
729 PCI binding to open firmware, and your interrupt tree as documented
730 in OF interrupt tree specification.
731
732 a) The root node
733
734 The root node requires some properties to be present:
735
736 - model : this is your board name/model
737 - #address-cells : address representation for "root" devices
738 - #size-cells: the size representation for "root" devices
Benjamin Herrenschmidte8222502006-03-28 23:15:54 +1100739 - device_type : This property shouldn't be necessary. However, if
740 you decide to create a device_type for your root node, make sure it
741 is _not_ "chrp" unless your platform is a pSeries or PAPR compliant
742 one for 64-bit, or a CHRP-type machine for 32-bit as this will
743 matched by the kernel this way.
David Gibsonc125a182006-02-01 03:05:22 -0800744
745 Additionally, some recommended properties are:
746
747 - compatible : the board "family" generally finds its way here,
748 for example, if you have 2 board models with a similar layout,
749 that typically get driven by the same platform code in the
750 kernel, you would use a different "model" property but put a
751 value in "compatible". The kernel doesn't directly use that
Stuart Yoder143a42d2007-02-16 11:30:29 -0600752 value but it is generally useful.
David Gibsonc125a182006-02-01 03:05:22 -0800753
754 The root node is also generally where you add additional properties
755 specific to your board like the serial number if any, that sort of
Matt LaPlante6c28f2c2006-10-03 22:46:31 +0200756 thing. It is recommended that if you add any "custom" property whose
David Gibsonc125a182006-02-01 03:05:22 -0800757 name may clash with standard defined ones, you prefix them with your
758 vendor name and a comma.
759
760 b) The /cpus node
761
762 This node is the parent of all individual CPU nodes. It doesn't
763 have any specific requirements, though it's generally good practice
764 to have at least:
765
766 #address-cells = <00000001>
767 #size-cells = <00000000>
768
769 This defines that the "address" for a CPU is a single cell, and has
770 no meaningful size. This is not necessary but the kernel will assume
771 that format when reading the "reg" properties of a CPU node, see
772 below
773
774 c) The /cpus/* nodes
775
776 So under /cpus, you are supposed to create a node for every CPU on
777 the machine. There is no specific restriction on the name of the
778 CPU, though It's common practice to call it PowerPC,<name>. For
779 example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX.
780
781 Required properties:
782
783 - device_type : has to be "cpu"
784 - reg : This is the physical cpu number, it's a single 32 bit cell
785 and is also used as-is as the unit number for constructing the
786 unit name in the full path. For example, with 2 CPUs, you would
787 have the full path:
788 /cpus/PowerPC,970FX@0
789 /cpus/PowerPC,970FX@1
790 (unit addresses do not require leading zeroes)
791 - d-cache-line-size : one cell, L1 data cache line size in bytes
792 - i-cache-line-size : one cell, L1 instruction cache line size in
793 bytes
794 - d-cache-size : one cell, size of L1 data cache in bytes
795 - i-cache-size : one cell, size of L1 instruction cache in bytes
David Gibsonc125a182006-02-01 03:05:22 -0800796
797 Recommended properties:
798
799 - timebase-frequency : a cell indicating the frequency of the
800 timebase in Hz. This is not directly used by the generic code,
801 but you are welcome to copy/paste the pSeries code for setting
802 the kernel timebase/decrementer calibration based on this
803 value.
804 - clock-frequency : a cell indicating the CPU core clock frequency
805 in Hz. A new property will be defined for 64 bit values, but if
806 your frequency is < 4Ghz, one cell is enough. Here as well as
807 for the above, the common code doesn't use that property, but
808 you are welcome to re-use the pSeries or Maple one. A future
809 kernel version might provide a common function for this.
810
811 You are welcome to add any property you find relevant to your board,
812 like some information about the mechanism used to soft-reset the
813 CPUs. For example, Apple puts the GPIO number for CPU soft reset
814 lines in there as a "soft-reset" property since they start secondary
815 CPUs by soft-resetting them.
816
817
818 d) the /memory node(s)
819
820 To define the physical memory layout of your board, you should
821 create one or more memory node(s). You can either create a single
822 node with all memory ranges in its reg property, or you can create
823 several nodes, as you wish. The unit address (@ part) used for the
824 full path is the address of the first range of memory defined by a
825 given node. If you use a single memory node, this will typically be
826 @0.
827
828 Required properties:
829
830 - device_type : has to be "memory"
831 - reg : This property contains all the physical memory ranges of
832 your board. It's a list of addresses/sizes concatenated
833 together, with the number of cells of each defined by the
834 #address-cells and #size-cells of the root node. For example,
Matt LaPlante6c28f2c2006-10-03 22:46:31 +0200835 with both of these properties being 2 like in the example given
David Gibsonc125a182006-02-01 03:05:22 -0800836 earlier, a 970 based machine with 6Gb of RAM could typically
837 have a "reg" property here that looks like:
838
839 00000000 00000000 00000000 80000000
840 00000001 00000000 00000001 00000000
841
842 That is a range starting at 0 of 0x80000000 bytes and a range
843 starting at 0x100000000 and of 0x100000000 bytes. You can see
844 that there is no memory covering the IO hole between 2Gb and
845 4Gb. Some vendors prefer splitting those ranges into smaller
846 segments, but the kernel doesn't care.
847
848 e) The /chosen node
849
850 This node is a bit "special". Normally, that's where open firmware
851 puts some variable environment information, like the arguments, or
Stuart Yoderd1bff9e2007-02-19 11:25:05 -0600852 the default input/output devices.
David Gibsonc125a182006-02-01 03:05:22 -0800853
854 This specification makes a few of these mandatory, but also defines
855 some linux-specific properties that would be normally constructed by
856 the prom_init() trampoline when booting with an OF client interface,
857 but that you have to provide yourself when using the flattened format.
858
David Gibsonc125a182006-02-01 03:05:22 -0800859 Recommended properties:
860
861 - bootargs : This zero-terminated string is passed as the kernel
862 command line
863 - linux,stdout-path : This is the full path to your standard
864 console device if any. Typically, if you have serial devices on
865 your board, you may want to put the full path to the one set as
866 the default console in the firmware here, for the kernel to pick
Matt LaPlante5d3f0832006-11-30 05:21:10 +0100867 it up as its own default console. If you look at the function
David Gibsonc125a182006-02-01 03:05:22 -0800868 set_preferred_console() in arch/ppc64/kernel/setup.c, you'll see
869 that the kernel tries to find out the default console and has
870 knowledge of various types like 8250 serial ports. You may want
871 to extend this function to add your own.
David Gibsonc125a182006-02-01 03:05:22 -0800872
873 Note that u-boot creates and fills in the chosen node for platforms
874 that use it.
875
Stuart Yoderd1bff9e2007-02-19 11:25:05 -0600876 (Note: a practice that is now obsolete was to include a property
877 under /chosen called interrupt-controller which had a phandle value
878 that pointed to the main interrupt controller)
879
David Gibsonc125a182006-02-01 03:05:22 -0800880 f) the /soc<SOCname> node
881
882 This node is used to represent a system-on-a-chip (SOC) and must be
883 present if the processor is a SOC. The top-level soc node contains
884 information that is global to all devices on the SOC. The node name
885 should contain a unit address for the SOC, which is the base address
886 of the memory-mapped register set for the SOC. The name of an soc
887 node should start with "soc", and the remainder of the name should
888 represent the part number for the soc. For example, the MPC8540's
889 soc node would be called "soc8540".
890
891 Required properties:
892
893 - device_type : Should be "soc"
894 - ranges : Should be defined as specified in 1) to describe the
895 translation of SOC addresses for memory mapped SOC registers.
Becky Bruce7d4b95a2006-02-06 14:26:31 -0600896 - bus-frequency: Contains the bus frequency for the SOC node.
897 Typically, the value of this field is filled in by the boot
898 loader.
899
David Gibsonc125a182006-02-01 03:05:22 -0800900
901 Recommended properties:
902
903 - reg : This property defines the address and size of the
904 memory-mapped registers that are used for the SOC node itself.
905 It does not include the child device registers - these will be
906 defined inside each child node. The address specified in the
907 "reg" property should match the unit address of the SOC node.
908 - #address-cells : Address representation for "soc" devices. The
909 format of this field may vary depending on whether or not the
910 device registers are memory mapped. For memory mapped
911 registers, this field represents the number of cells needed to
912 represent the address of the registers. For SOCs that do not
913 use MMIO, a special address format should be defined that
914 contains enough cells to represent the required information.
915 See 1) above for more details on defining #address-cells.
916 - #size-cells : Size representation for "soc" devices
917 - #interrupt-cells : Defines the width of cells used to represent
918 interrupts. Typically this value is <2>, which includes a
919 32-bit number that represents the interrupt number, and a
920 32-bit number that represents the interrupt sense and level.
921 This field is only needed if the SOC contains an interrupt
922 controller.
923
924 The SOC node may contain child nodes for each SOC device that the
925 platform uses. Nodes should not be created for devices which exist
926 on the SOC but are not used by a particular platform. See chapter VI
927 for more information on how to specify devices that are part of an
928SOC.
929
930 Example SOC node for the MPC8540:
931
932 soc8540@e0000000 {
933 #address-cells = <1>;
934 #size-cells = <1>;
935 #interrupt-cells = <2>;
936 device_type = "soc";
937 ranges = <00000000 e0000000 00100000>
938 reg = <e0000000 00003000>;
Becky Bruce7d4b95a2006-02-06 14:26:31 -0600939 bus-frequency = <0>;
David Gibsonc125a182006-02-01 03:05:22 -0800940 }
941
942
943
944IV - "dtc", the device tree compiler
945====================================
946
947
948dtc source code can be found at
949<http://ozlabs.org/~dgibson/dtc/dtc.tar.gz>
950
951WARNING: This version is still in early development stage; the
952resulting device-tree "blobs" have not yet been validated with the
953kernel. The current generated bloc lacks a useful reserve map (it will
954be fixed to generate an empty one, it's up to the bootloader to fill
955it up) among others. The error handling needs work, bugs are lurking,
956etc...
957
958dtc basically takes a device-tree in a given format and outputs a
959device-tree in another format. The currently supported formats are:
960
961 Input formats:
962 -------------
963
964 - "dtb": "blob" format, that is a flattened device-tree block
965 with
966 header all in a binary blob.
967 - "dts": "source" format. This is a text file containing a
968 "source" for a device-tree. The format is defined later in this
969 chapter.
970 - "fs" format. This is a representation equivalent to the
971 output of /proc/device-tree, that is nodes are directories and
972 properties are files
973
974 Output formats:
975 ---------------
976
977 - "dtb": "blob" format
978 - "dts": "source" format
979 - "asm": assembly language file. This is a file that can be
980 sourced by gas to generate a device-tree "blob". That file can
981 then simply be added to your Makefile. Additionally, the
Matt LaPlante6c28f2c2006-10-03 22:46:31 +0200982 assembly file exports some symbols that can be used.
David Gibsonc125a182006-02-01 03:05:22 -0800983
984
985The syntax of the dtc tool is
986
987 dtc [-I <input-format>] [-O <output-format>]
988 [-o output-filename] [-V output_version] input_filename
989
990
991The "output_version" defines what versio of the "blob" format will be
992generated. Supported versions are 1,2,3 and 16. The default is
993currently version 3 but that may change in the future to version 16.
994
995Additionally, dtc performs various sanity checks on the tree, like the
Matt LaPlante6c28f2c2006-10-03 22:46:31 +0200996uniqueness of linux, phandle properties, validity of strings, etc...
David Gibsonc125a182006-02-01 03:05:22 -0800997
998The format of the .dts "source" file is "C" like, supports C and C++
Matt LaPlante6c28f2c2006-10-03 22:46:31 +0200999style comments.
David Gibsonc125a182006-02-01 03:05:22 -08001000
1001/ {
1002}
1003
1004The above is the "device-tree" definition. It's the only statement
1005supported currently at the toplevel.
1006
1007/ {
1008 property1 = "string_value"; /* define a property containing a 0
1009 * terminated string
1010 */
1011
1012 property2 = <1234abcd>; /* define a property containing a
1013 * numerical 32 bits value (hexadecimal)
1014 */
1015
1016 property3 = <12345678 12345678 deadbeef>;
1017 /* define a property containing 3
1018 * numerical 32 bits values (cells) in
1019 * hexadecimal
1020 */
1021 property4 = [0a 0b 0c 0d de ea ad be ef];
1022 /* define a property whose content is
1023 * an arbitrary array of bytes
1024 */
1025
1026 childnode@addresss { /* define a child node named "childnode"
1027 * whose unit name is "childnode at
1028 * address"
1029 */
1030
1031 childprop = "hello\n"; /* define a property "childprop" of
1032 * childnode (in this case, a string)
1033 */
1034 };
1035};
1036
1037Nodes can contain other nodes etc... thus defining the hierarchical
1038structure of the tree.
1039
1040Strings support common escape sequences from C: "\n", "\t", "\r",
1041"\(octal value)", "\x(hex value)".
1042
1043It is also suggested that you pipe your source file through cpp (gcc
1044preprocessor) so you can use #include's, #define for constants, etc...
1045
1046Finally, various options are planned but not yet implemented, like
1047automatic generation of phandles, labels (exported to the asm file so
1048you can point to a property content and change it easily from whatever
1049you link the device-tree with), label or path instead of numeric value
1050in some cells to "point" to a node (replaced by a phandle at compile
1051time), export of reserve map address to the asm file, ability to
1052specify reserve map content at compile time, etc...
1053
1054We may provide a .h include file with common definitions of that
1055proves useful for some properties (like building PCI properties or
1056interrupt maps) though it may be better to add a notion of struct
1057definitions to the compiler...
1058
1059
1060V - Recommendations for a bootloader
1061====================================
1062
1063
1064Here are some various ideas/recommendations that have been proposed
1065while all this has been defined and implemented.
1066
1067 - The bootloader may want to be able to use the device-tree itself
1068 and may want to manipulate it (to add/edit some properties,
1069 like physical memory size or kernel arguments). At this point, 2
1070 choices can be made. Either the bootloader works directly on the
1071 flattened format, or the bootloader has its own internal tree
1072 representation with pointers (similar to the kernel one) and
1073 re-flattens the tree when booting the kernel. The former is a bit
1074 more difficult to edit/modify, the later requires probably a bit
1075 more code to handle the tree structure. Note that the structure
1076 format has been designed so it's relatively easy to "insert"
1077 properties or nodes or delete them by just memmoving things
1078 around. It contains no internal offsets or pointers for this
1079 purpose.
1080
Matt LaPlanted6bc8ac2006-10-03 22:54:15 +02001081 - An example of code for iterating nodes & retrieving properties
David Gibsonc125a182006-02-01 03:05:22 -08001082 directly from the flattened tree format can be found in the kernel
1083 file arch/ppc64/kernel/prom.c, look at scan_flat_dt() function,
Matt LaPlanted6bc8ac2006-10-03 22:54:15 +02001084 its usage in early_init_devtree(), and the corresponding various
David Gibsonc125a182006-02-01 03:05:22 -08001085 early_init_dt_scan_*() callbacks. That code can be re-used in a
1086 GPL bootloader, and as the author of that code, I would be happy
Matt LaPlanted6bc8ac2006-10-03 22:54:15 +02001087 to discuss possible free licencing to any vendor who wishes to
David Gibsonc125a182006-02-01 03:05:22 -08001088 integrate all or part of this code into a non-GPL bootloader.
1089
1090
1091
1092VI - System-on-a-chip devices and nodes
1093=======================================
1094
1095Many companies are now starting to develop system-on-a-chip
1096processors, where the processor core (cpu) and many peripheral devices
1097exist on a single piece of silicon. For these SOCs, an SOC node
1098should be used that defines child nodes for the devices that make
1099up the SOC. While platforms are not required to use this model in
1100order to boot the kernel, it is highly encouraged that all SOC
1101implementations define as complete a flat-device-tree as possible to
1102describe the devices on the SOC. This will allow for the
1103genericization of much of the kernel code.
1104
1105
11061) Defining child nodes of an SOC
1107---------------------------------
1108
1109Each device that is part of an SOC may have its own node entry inside
1110the SOC node. For each device that is included in the SOC, the unit
1111address property represents the address offset for this device's
1112memory-mapped registers in the parent's address space. The parent's
1113address space is defined by the "ranges" property in the top-level soc
1114node. The "reg" property for each node that exists directly under the
1115SOC node should contain the address mapping from the child address space
1116to the parent SOC address space and the size of the device's
1117memory-mapped register file.
1118
1119For many devices that may exist inside an SOC, there are predefined
1120specifications for the format of the device tree node. All SOC child
1121nodes should follow these specifications, except where noted in this
1122document.
1123
1124See appendix A for an example partial SOC node definition for the
1125MPC8540.
1126
1127
Stuart Yoder27565902007-03-02 13:42:33 -060011282) Representing devices without a current OF specification
David Gibsonc125a182006-02-01 03:05:22 -08001129----------------------------------------------------------
1130
1131Currently, there are many devices on SOCs that do not have a standard
1132representation pre-defined as part of the open firmware
1133specifications, mainly because the boards that contain these SOCs are
1134not currently booted using open firmware. This section contains
1135descriptions for the SOC devices for which new nodes have been
1136defined; this list will expand as more and more SOC-containing
1137platforms are moved over to use the flattened-device-tree model.
1138
1139 a) MDIO IO device
1140
1141 The MDIO is a bus to which the PHY devices are connected. For each
1142 device that exists on this bus, a child node should be created. See
1143 the definition of the PHY node below for an example of how to define
1144 a PHY.
1145
1146 Required properties:
1147 - reg : Offset and length of the register set for the device
1148 - device_type : Should be "mdio"
1149 - compatible : Should define the compatible device type for the
1150 mdio. Currently, this is most likely to be "gianfar"
1151
1152 Example:
1153
1154 mdio@24520 {
1155 reg = <24520 20>;
Becky Bruce7d4b95a2006-02-06 14:26:31 -06001156 device_type = "mdio";
1157 compatible = "gianfar";
David Gibsonc125a182006-02-01 03:05:22 -08001158
1159 ethernet-phy@0 {
1160 ......
1161 };
1162 };
1163
1164
1165 b) Gianfar-compatible ethernet nodes
1166
1167 Required properties:
1168
1169 - device_type : Should be "network"
1170 - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
1171 - compatible : Should be "gianfar"
1172 - reg : Offset and length of the register set for the device
Jon Loeligerf5831652006-08-17 08:42:35 -05001173 - mac-address : List of bytes representing the ethernet address of
David Gibsonc125a182006-02-01 03:05:22 -08001174 this controller
1175 - interrupts : <a b> where a is the interrupt number and b is a
1176 field that represents an encoding of the sense and level
1177 information for the interrupt. This should be encoded based on
1178 the information in section 2) depending on the type of interrupt
1179 controller you have.
1180 - interrupt-parent : the phandle for the interrupt controller that
1181 services interrupts for this device.
1182 - phy-handle : The phandle for the PHY connected to this ethernet
1183 controller.
1184
1185 Example:
1186
1187 ethernet@24000 {
1188 #size-cells = <0>;
1189 device_type = "network";
1190 model = "TSEC";
1191 compatible = "gianfar";
1192 reg = <24000 1000>;
Jon Loeligerf5831652006-08-17 08:42:35 -05001193 mac-address = [ 00 E0 0C 00 73 00 ];
David Gibsonc125a182006-02-01 03:05:22 -08001194 interrupts = <d 3 e 3 12 3>;
1195 interrupt-parent = <40000>;
1196 phy-handle = <2452000>
1197 };
1198
1199
1200
1201 c) PHY nodes
1202
1203 Required properties:
1204
1205 - device_type : Should be "ethernet-phy"
1206 - interrupts : <a b> where a is the interrupt number and b is a
1207 field that represents an encoding of the sense and level
1208 information for the interrupt. This should be encoded based on
1209 the information in section 2) depending on the type of interrupt
1210 controller you have.
1211 - interrupt-parent : the phandle for the interrupt controller that
1212 services interrupts for this device.
1213 - reg : The ID number for the phy, usually a small integer
1214 - linux,phandle : phandle for this node; likely referenced by an
1215 ethernet controller node.
1216
1217
1218 Example:
1219
1220 ethernet-phy@0 {
1221 linux,phandle = <2452000>
1222 interrupt-parent = <40000>;
1223 interrupts = <35 1>;
1224 reg = <0>;
1225 device_type = "ethernet-phy";
1226 };
1227
1228
1229 d) Interrupt controllers
1230
1231 Some SOC devices contain interrupt controllers that are different
1232 from the standard Open PIC specification. The SOC device nodes for
1233 these types of controllers should be specified just like a standard
1234 OpenPIC controller. Sense and level information should be encoded
1235 as specified in section 2) of this chapter for each device that
1236 specifies an interrupt.
1237
1238 Example :
1239
1240 pic@40000 {
1241 linux,phandle = <40000>;
1242 clock-frequency = <0>;
1243 interrupt-controller;
1244 #address-cells = <0>;
1245 reg = <40000 40000>;
1246 built-in;
1247 compatible = "chrp,open-pic";
1248 device_type = "open-pic";
1249 big-endian;
1250 };
1251
1252
1253 e) I2C
1254
1255 Required properties :
1256
1257 - device_type : Should be "i2c"
1258 - reg : Offset and length of the register set for the device
1259
1260 Recommended properties :
1261
1262 - compatible : Should be "fsl-i2c" for parts compatible with
1263 Freescale I2C specifications.
1264 - interrupts : <a b> where a is the interrupt number and b is a
1265 field that represents an encoding of the sense and level
1266 information for the interrupt. This should be encoded based on
1267 the information in section 2) depending on the type of interrupt
1268 controller you have.
1269 - interrupt-parent : the phandle for the interrupt controller that
1270 services interrupts for this device.
1271 - dfsrr : boolean; if defined, indicates that this I2C device has
1272 a digital filter sampling rate register
1273 - fsl5200-clocking : boolean; if defined, indicated that this device
1274 uses the FSL 5200 clocking mechanism.
1275
1276 Example :
1277
1278 i2c@3000 {
1279 interrupt-parent = <40000>;
1280 interrupts = <1b 3>;
1281 reg = <3000 18>;
1282 device_type = "i2c";
1283 compatible = "fsl-i2c";
1284 dfsrr;
1285 };
1286
1287
Becky Brucead71f122006-02-07 13:44:08 -06001288 f) Freescale SOC USB controllers
1289
1290 The device node for a USB controller that is part of a Freescale
1291 SOC is as described in the document "Open Firmware Recommended
1292 Practice : Universal Serial Bus" with the following modifications
1293 and additions :
1294
1295 Required properties :
1296 - compatible : Should be "fsl-usb2-mph" for multi port host usb
1297 controllers, or "fsl-usb2-dr" for dual role usb controllers
1298 - phy_type : For multi port host usb controllers, should be one of
1299 "ulpi", or "serial". For dual role usb controllers, should be
1300 one of "ulpi", "utmi", "utmi_wide", or "serial".
1301 - reg : Offset and length of the register set for the device
1302 - port0 : boolean; if defined, indicates port0 is connected for
1303 fsl-usb2-mph compatible controllers. Either this property or
1304 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
1305 controllers.
1306 - port1 : boolean; if defined, indicates port1 is connected for
1307 fsl-usb2-mph compatible controllers. Either this property or
1308 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
1309 controllers.
Li Yangea5b7a62007-02-07 13:51:09 +08001310 - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
1311 controllers. Can be "host", "peripheral", or "otg". Default to
1312 "host" if not defined for backward compatibility.
Becky Brucead71f122006-02-07 13:44:08 -06001313
1314 Recommended properties :
1315 - interrupts : <a b> where a is the interrupt number and b is a
1316 field that represents an encoding of the sense and level
1317 information for the interrupt. This should be encoded based on
1318 the information in section 2) depending on the type of interrupt
1319 controller you have.
1320 - interrupt-parent : the phandle for the interrupt controller that
1321 services interrupts for this device.
1322
1323 Example multi port host usb controller device node :
1324 usb@22000 {
1325 device_type = "usb";
1326 compatible = "fsl-usb2-mph";
1327 reg = <22000 1000>;
1328 #address-cells = <1>;
1329 #size-cells = <0>;
1330 interrupt-parent = <700>;
1331 interrupts = <27 1>;
1332 phy_type = "ulpi";
1333 port0;
1334 port1;
1335 };
1336
1337 Example dual role usb controller device node :
1338 usb@23000 {
1339 device_type = "usb";
1340 compatible = "fsl-usb2-dr";
1341 reg = <23000 1000>;
1342 #address-cells = <1>;
1343 #size-cells = <0>;
1344 interrupt-parent = <700>;
1345 interrupts = <26 1>;
Li Yangea5b7a62007-02-07 13:51:09 +08001346 dr_mode = "otg";
Becky Brucead71f122006-02-07 13:44:08 -06001347 phy = "ulpi";
1348 };
1349
1350
Kim Phillipsb88a0b12006-03-22 14:39:03 -06001351 g) Freescale SOC SEC Security Engines
1352
1353 Required properties:
1354
1355 - device_type : Should be "crypto"
1356 - model : Model of the device. Should be "SEC1" or "SEC2"
1357 - compatible : Should be "talitos"
1358 - reg : Offset and length of the register set for the device
1359 - interrupts : <a b> where a is the interrupt number and b is a
1360 field that represents an encoding of the sense and level
1361 information for the interrupt. This should be encoded based on
1362 the information in section 2) depending on the type of interrupt
1363 controller you have.
1364 - interrupt-parent : the phandle for the interrupt controller that
1365 services interrupts for this device.
1366 - num-channels : An integer representing the number of channels
1367 available.
1368 - channel-fifo-len : An integer representing the number of
1369 descriptor pointers each channel fetch fifo can hold.
1370 - exec-units-mask : The bitmask representing what execution units
1371 (EUs) are available. It's a single 32 bit cell. EU information
1372 should be encoded following the SEC's Descriptor Header Dword
1373 EU_SEL0 field documentation, i.e. as follows:
1374
1375 bit 0 = reserved - should be 0
1376 bit 1 = set if SEC has the ARC4 EU (AFEU)
1377 bit 2 = set if SEC has the DES/3DES EU (DEU)
1378 bit 3 = set if SEC has the message digest EU (MDEU)
1379 bit 4 = set if SEC has the random number generator EU (RNG)
1380 bit 5 = set if SEC has the public key EU (PKEU)
1381 bit 6 = set if SEC has the AES EU (AESU)
1382 bit 7 = set if SEC has the Kasumi EU (KEU)
1383
1384 bits 8 through 31 are reserved for future SEC EUs.
1385
1386 - descriptor-types-mask : The bitmask representing what descriptors
1387 are available. It's a single 32 bit cell. Descriptor type
1388 information should be encoded following the SEC's Descriptor
1389 Header Dword DESC_TYPE field documentation, i.e. as follows:
1390
1391 bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
1392 bit 1 = set if SEC supports the ipsec_esp descriptor type
1393 bit 2 = set if SEC supports the common_nonsnoop desc. type
1394 bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
1395 bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
1396 bit 5 = set if SEC supports the srtp descriptor type
1397 bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
1398 bit 7 = set if SEC supports the pkeu_assemble descriptor type
1399 bit 8 = set if SEC supports the aesu_key_expand_output desc.type
1400 bit 9 = set if SEC supports the pkeu_ptmul descriptor type
1401 bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
1402 bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
1403
1404 ..and so on and so forth.
1405
1406 Example:
1407
1408 /* MPC8548E */
1409 crypto@30000 {
1410 device_type = "crypto";
1411 model = "SEC2";
1412 compatible = "talitos";
1413 reg = <30000 10000>;
1414 interrupts = <1d 3>;
1415 interrupt-parent = <40000>;
1416 num-channels = <4>;
Kim Phillipscbdb54d2006-07-03 15:10:14 -05001417 channel-fifo-len = <18>;
Kim Phillipsb88a0b12006-03-22 14:39:03 -06001418 exec-units-mask = <000000fe>;
Kim Phillipscbdb54d2006-07-03 15:10:14 -05001419 descriptor-types-mask = <012b0ebf>;
Kim Phillipsb88a0b12006-03-22 14:39:03 -06001420 };
1421
Li Yang9a1ab882006-10-02 20:08:59 -05001422 h) Board Control and Status (BCSR)
1423
1424 Required properties:
1425
1426 - device_type : Should be "board-control"
1427 - reg : Offset and length of the register set for the device
1428
1429 Example:
1430
1431 bcsr@f8000000 {
1432 device_type = "board-control";
1433 reg = <f8000000 8000>;
1434 };
1435
1436 i) Freescale QUICC Engine module (QE)
1437 This represents qe module that is installed on PowerQUICC II Pro.
1438 Hopefully it will merge backward compatibility with CPM/CPM2.
1439 Basically, it is a bus of devices, that could act more or less
1440 as a complete entity (UCC, USB etc ). All of them should be siblings on
1441 the "root" qe node, using the common properties from there.
1442 The description below applies to the the qe of MPC8360 and
1443 more nodes and properties would be extended in the future.
1444
1445 i) Root QE device
1446
1447 Required properties:
1448 - device_type : should be "qe";
1449 - model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
1450 - reg : offset and length of the device registers.
1451 - bus-frequency : the clock frequency for QUICC Engine.
1452
1453 Recommended properties
1454 - brg-frequency : the internal clock source frequency for baud-rate
1455 generators in Hz.
1456
1457 Example:
1458 qe@e0100000 {
1459 #address-cells = <1>;
1460 #size-cells = <1>;
1461 #interrupt-cells = <2>;
1462 device_type = "qe";
1463 model = "QE";
1464 ranges = <0 e0100000 00100000>;
1465 reg = <e0100000 480>;
1466 brg-frequency = <0>;
1467 bus-frequency = <179A7B00>;
1468 }
1469
1470
1471 ii) SPI (Serial Peripheral Interface)
1472
1473 Required properties:
1474 - device_type : should be "spi".
1475 - compatible : should be "fsl_spi".
1476 - mode : the spi operation mode, it can be "cpu" or "qe".
1477 - reg : Offset and length of the register set for the device
1478 - interrupts : <a b> where a is the interrupt number and b is a
1479 field that represents an encoding of the sense and level
1480 information for the interrupt. This should be encoded based on
1481 the information in section 2) depending on the type of interrupt
1482 controller you have.
1483 - interrupt-parent : the phandle for the interrupt controller that
1484 services interrupts for this device.
1485
1486 Example:
1487 spi@4c0 {
1488 device_type = "spi";
1489 compatible = "fsl_spi";
1490 reg = <4c0 40>;
1491 interrupts = <82 0>;
1492 interrupt-parent = <700>;
1493 mode = "cpu";
1494 };
1495
1496
1497 iii) USB (Universal Serial Bus Controller)
1498
1499 Required properties:
1500 - device_type : should be "usb".
1501 - compatible : could be "qe_udc" or "fhci-hcd".
1502 - mode : the could be "host" or "slave".
1503 - reg : Offset and length of the register set for the device
1504 - interrupts : <a b> where a is the interrupt number and b is a
1505 field that represents an encoding of the sense and level
1506 information for the interrupt. This should be encoded based on
1507 the information in section 2) depending on the type of interrupt
1508 controller you have.
1509 - interrupt-parent : the phandle for the interrupt controller that
1510 services interrupts for this device.
1511
1512 Example(slave):
1513 usb@6c0 {
1514 device_type = "usb";
1515 compatible = "qe_udc";
1516 reg = <6c0 40>;
1517 interrupts = <8b 0>;
1518 interrupt-parent = <700>;
1519 mode = "slave";
1520 };
1521
1522
1523 iv) UCC (Unified Communications Controllers)
1524
1525 Required properties:
1526 - device_type : should be "network", "hldc", "uart", "transparent"
1527 "bisync" or "atm".
1528 - compatible : could be "ucc_geth" or "fsl_atm" and so on.
1529 - model : should be "UCC".
1530 - device-id : the ucc number(1-8), corresponding to UCCx in UM.
1531 - reg : Offset and length of the register set for the device
1532 - interrupts : <a b> where a is the interrupt number and b is a
1533 field that represents an encoding of the sense and level
1534 information for the interrupt. This should be encoded based on
1535 the information in section 2) depending on the type of interrupt
1536 controller you have.
1537 - interrupt-parent : the phandle for the interrupt controller that
1538 services interrupts for this device.
1539 - pio-handle : The phandle for the Parallel I/O port configuration.
1540 - rx-clock : represents the UCC receive clock source.
1541 0x00 : clock source is disabled;
1542 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1543 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1544 - tx-clock: represents the UCC transmit clock source;
1545 0x00 : clock source is disabled;
1546 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1547 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1548
1549 Required properties for network device_type:
1550 - mac-address : list of bytes representing the ethernet address.
1551 - phy-handle : The phandle for the PHY connected to this controller.
1552
1553 Example:
1554 ucc@2000 {
1555 device_type = "network";
1556 compatible = "ucc_geth";
1557 model = "UCC";
1558 device-id = <1>;
1559 reg = <2000 200>;
1560 interrupts = <a0 0>;
1561 interrupt-parent = <700>;
1562 mac-address = [ 00 04 9f 00 23 23 ];
1563 rx-clock = "none";
1564 tx-clock = "clk9";
1565 phy-handle = <212000>;
1566 pio-handle = <140001>;
1567 };
1568
1569
1570 v) Parallel I/O Ports
1571
1572 This node configures Parallel I/O ports for CPUs with QE support.
1573 The node should reside in the "soc" node of the tree. For each
1574 device that using parallel I/O ports, a child node should be created.
1575 See the definition of the Pin configuration nodes below for more
1576 information.
1577
1578 Required properties:
1579 - device_type : should be "par_io".
1580 - reg : offset to the register set and its length.
1581 - num-ports : number of Parallel I/O ports
1582
1583 Example:
1584 par_io@1400 {
1585 reg = <1400 100>;
1586 #address-cells = <1>;
1587 #size-cells = <0>;
1588 device_type = "par_io";
1589 num-ports = <7>;
1590 ucc_pin@01 {
1591 ......
1592 };
1593
1594
1595 vi) Pin configuration nodes
1596
1597 Required properties:
1598 - linux,phandle : phandle of this node; likely referenced by a QE
1599 device.
1600 - pio-map : array of pin configurations. Each pin is defined by 6
1601 integers. The six numbers are respectively: port, pin, dir,
1602 open_drain, assignment, has_irq.
1603 - port : port number of the pin; 0-6 represent port A-G in UM.
1604 - pin : pin number in the port.
1605 - dir : direction of the pin, should encode as follows:
1606
1607 0 = The pin is disabled
1608 1 = The pin is an output
1609 2 = The pin is an input
1610 3 = The pin is I/O
1611
1612 - open_drain : indicates the pin is normal or wired-OR:
1613
1614 0 = The pin is actively driven as an output
1615 1 = The pin is an open-drain driver. As an output, the pin is
1616 driven active-low, otherwise it is three-stated.
1617
1618 - assignment : function number of the pin according to the Pin Assignment
1619 tables in User Manual. Each pin can have up to 4 possible functions in
1620 QE and two options for CPM.
1621 - has_irq : indicates if the pin is used as source of exteral
1622 interrupts.
1623
1624 Example:
1625 ucc_pin@01 {
1626 linux,phandle = <140001>;
1627 pio-map = <
1628 /* port pin dir open_drain assignment has_irq */
1629 0 3 1 0 1 0 /* TxD0 */
1630 0 4 1 0 1 0 /* TxD1 */
1631 0 5 1 0 1 0 /* TxD2 */
1632 0 6 1 0 1 0 /* TxD3 */
1633 1 6 1 0 3 0 /* TxD4 */
1634 1 7 1 0 1 0 /* TxD5 */
1635 1 9 1 0 2 0 /* TxD6 */
1636 1 a 1 0 2 0 /* TxD7 */
1637 0 9 2 0 1 0 /* RxD0 */
1638 0 a 2 0 1 0 /* RxD1 */
1639 0 b 2 0 1 0 /* RxD2 */
1640 0 c 2 0 1 0 /* RxD3 */
1641 0 d 2 0 1 0 /* RxD4 */
1642 1 1 2 0 2 0 /* RxD5 */
1643 1 0 2 0 2 0 /* RxD6 */
1644 1 4 2 0 2 0 /* RxD7 */
1645 0 7 1 0 1 0 /* TX_EN */
1646 0 8 1 0 1 0 /* TX_ER */
1647 0 f 2 0 1 0 /* RX_DV */
1648 0 10 2 0 1 0 /* RX_ER */
1649 0 0 2 0 1 0 /* RX_CLK */
1650 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
1651 2 8 2 0 1 0>; /* GTX125 - CLK9 */
1652 };
1653
1654 vii) Multi-User RAM (MURAM)
1655
1656 Required properties:
1657 - device_type : should be "muram".
1658 - mode : the could be "host" or "slave".
1659 - ranges : Should be defined as specified in 1) to describe the
1660 translation of MURAM addresses.
1661 - data-only : sub-node which defines the address area under MURAM
1662 bus that can be allocated as data/parameter
1663
1664 Example:
1665
1666 muram@10000 {
1667 device_type = "muram";
1668 ranges = <0 00010000 0000c000>;
1669
1670 data-only@0{
1671 reg = <0 c000>;
1672 };
1673 };
Kim Phillipsb88a0b12006-03-22 14:39:03 -06001674
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001675 g) Flash chip nodes
1676
1677 Flash chips (Memory Technology Devices) are often used for solid state
1678 file systems on embedded devices.
1679
1680 Required properties:
1681
1682 - device_type : has to be "rom"
Vitaly Wool173935f2006-12-19 18:44:25 +03001683 - compatible : Should specify what this flash device is compatible with.
1684 Currently, this is most likely to be "direct-mapped" (which
1685 corresponds to the MTD physmap mapping driver).
1686 - reg : Offset and length of the register set (or memory mapping) for
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001687 the device.
Vitaly Wool173935f2006-12-19 18:44:25 +03001688 - bank-width : Width of the flash data bus in bytes. Required
1689 for the NOR flashes (compatible == "direct-mapped" and others) ONLY.
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001690
1691 Recommended properties :
1692
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001693 - partitions : Several pairs of 32-bit values where the first value is
1694 partition's offset from the start of the device and the second one is
1695 partition size in bytes with LSB used to signify a read only
Vitaly Wool173935f2006-12-19 18:44:25 +03001696 partition (so, the parition size should always be an even number).
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001697 - partition-names : The list of concatenated zero terminated strings
1698 representing the partition names.
Vitaly Wool173935f2006-12-19 18:44:25 +03001699 - probe-type : The type of probe which should be done for the chip
1700 (JEDEC vs CFI actually). Valid ONLY for NOR flashes.
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001701
1702 Example:
1703
1704 flash@ff000000 {
1705 device_type = "rom";
1706 compatible = "direct-mapped";
Vitaly Wool173935f2006-12-19 18:44:25 +03001707 probe-type = "CFI";
1708 reg = <ff000000 01000000>;
Vitaly Wool28f9ec32006-11-20 16:32:39 +03001709 bank-width = <4>;
1710 partitions = <00000000 00f80000
1711 00f80000 00080001>;
1712 partition-names = "fs\0firmware";
1713 };
1714
David Gibsonc125a182006-02-01 03:05:22 -08001715 More devices will be defined as this spec matures.
1716
Stuart Yoder27565902007-03-02 13:42:33 -06001717VII - Specifying interrupt information for devices
1718===================================================
1719
1720The device tree represents the busses and devices of a hardware
1721system in a form similar to the physical bus topology of the
1722hardware.
1723
1724In addition, a logical 'interrupt tree' exists which represents the
1725hierarchy and routing of interrupts in the hardware.
1726
1727The interrupt tree model is fully described in the
1728document "Open Firmware Recommended Practice: Interrupt
1729Mapping Version 0.9". The document is available at:
1730<http://playground.sun.com/1275/practice>.
1731
17321) interrupts property
1733----------------------
1734
1735Devices that generate interrupts to a single interrupt controller
1736should use the conventional OF representation described in the
1737OF interrupt mapping documentation.
1738
1739Each device which generates interrupts must have an 'interrupt'
1740property. The interrupt property value is an arbitrary number of
1741of 'interrupt specifier' values which describe the interrupt or
1742interrupts for the device.
1743
1744The encoding of an interrupt specifier is determined by the
1745interrupt domain in which the device is located in the
1746interrupt tree. The root of an interrupt domain specifies in
1747its #interrupt-cells property the number of 32-bit cells
1748required to encode an interrupt specifier. See the OF interrupt
1749mapping documentation for a detailed description of domains.
1750
1751For example, the binding for the OpenPIC interrupt controller
1752specifies an #interrupt-cells value of 2 to encode the interrupt
1753number and level/sense information. All interrupt children in an
1754OpenPIC interrupt domain use 2 cells per interrupt in their interrupts
1755property.
1756
1757The PCI bus binding specifies a #interrupt-cell value of 1 to encode
1758which interrupt pin (INTA,INTB,INTC,INTD) is used.
1759
17602) interrupt-parent property
1761----------------------------
1762
1763The interrupt-parent property is specified to define an explicit
1764link between a device node and its interrupt parent in
1765the interrupt tree. The value of interrupt-parent is the
1766phandle of the parent node.
1767
1768If the interrupt-parent property is not defined for a node, it's
1769interrupt parent is assumed to be an ancestor in the node's
1770_device tree_ hierarchy.
1771
17723) OpenPIC Interrupt Controllers
1773--------------------------------
1774
1775OpenPIC interrupt controllers require 2 cells to encode
1776interrupt information. The first cell defines the interrupt
1777number. The second cell defines the sense and level
1778information.
1779
1780Sense and level information should be encoded as follows:
1781
1782 0 = low to high edge sensitive type enabled
1783 1 = active low level sensitive type enabled
1784 2 = active high level sensitive type enabled
1785 3 = high to low edge sensitive type enabled
1786
17874) ISA Interrupt Controllers
1788----------------------------
1789
1790ISA PIC interrupt controllers require 2 cells to encode
1791interrupt information. The first cell defines the interrupt
1792number. The second cell defines the sense and level
1793information.
1794
1795ISA PIC interrupt controllers should adhere to the ISA PIC
1796encodings listed below:
1797
1798 0 = active low level sensitive type enabled
1799 1 = active high level sensitive type enabled
1800 2 = high to low edge sensitive type enabled
1801 3 = low to high edge sensitive type enabled
1802
David Gibsonc125a182006-02-01 03:05:22 -08001803
1804Appendix A - Sample SOC node for MPC8540
1805========================================
1806
1807Note that the #address-cells and #size-cells for the SoC node
1808in this example have been explicitly listed; these are likely
1809not necessary as they are usually the same as the root node.
1810
1811 soc8540@e0000000 {
1812 #address-cells = <1>;
1813 #size-cells = <1>;
1814 #interrupt-cells = <2>;
1815 device_type = "soc";
1816 ranges = <00000000 e0000000 00100000>
1817 reg = <e0000000 00003000>;
Becky Bruce7d4b95a2006-02-06 14:26:31 -06001818 bus-frequency = <0>;
David Gibsonc125a182006-02-01 03:05:22 -08001819
1820 mdio@24520 {
1821 reg = <24520 20>;
1822 device_type = "mdio";
1823 compatible = "gianfar";
1824
1825 ethernet-phy@0 {
1826 linux,phandle = <2452000>
1827 interrupt-parent = <40000>;
1828 interrupts = <35 1>;
1829 reg = <0>;
1830 device_type = "ethernet-phy";
1831 };
1832
1833 ethernet-phy@1 {
1834 linux,phandle = <2452001>
1835 interrupt-parent = <40000>;
1836 interrupts = <35 1>;
1837 reg = <1>;
1838 device_type = "ethernet-phy";
1839 };
1840
1841 ethernet-phy@3 {
1842 linux,phandle = <2452002>
1843 interrupt-parent = <40000>;
1844 interrupts = <35 1>;
1845 reg = <3>;
1846 device_type = "ethernet-phy";
1847 };
1848
1849 };
1850
1851 ethernet@24000 {
1852 #size-cells = <0>;
1853 device_type = "network";
1854 model = "TSEC";
1855 compatible = "gianfar";
1856 reg = <24000 1000>;
Jon Loeligerf5831652006-08-17 08:42:35 -05001857 mac-address = [ 00 E0 0C 00 73 00 ];
David Gibsonc125a182006-02-01 03:05:22 -08001858 interrupts = <d 3 e 3 12 3>;
1859 interrupt-parent = <40000>;
1860 phy-handle = <2452000>;
1861 };
1862
1863 ethernet@25000 {
1864 #address-cells = <1>;
1865 #size-cells = <0>;
1866 device_type = "network";
1867 model = "TSEC";
1868 compatible = "gianfar";
1869 reg = <25000 1000>;
Jon Loeligerf5831652006-08-17 08:42:35 -05001870 mac-address = [ 00 E0 0C 00 73 01 ];
David Gibsonc125a182006-02-01 03:05:22 -08001871 interrupts = <13 3 14 3 18 3>;
1872 interrupt-parent = <40000>;
1873 phy-handle = <2452001>;
1874 };
1875
1876 ethernet@26000 {
1877 #address-cells = <1>;
1878 #size-cells = <0>;
1879 device_type = "network";
1880 model = "FEC";
1881 compatible = "gianfar";
1882 reg = <26000 1000>;
Jon Loeligerf5831652006-08-17 08:42:35 -05001883 mac-address = [ 00 E0 0C 00 73 02 ];
David Gibsonc125a182006-02-01 03:05:22 -08001884 interrupts = <19 3>;
1885 interrupt-parent = <40000>;
1886 phy-handle = <2452002>;
1887 };
1888
1889 serial@4500 {
1890 device_type = "serial";
1891 compatible = "ns16550";
1892 reg = <4500 100>;
1893 clock-frequency = <0>;
1894 interrupts = <1a 3>;
1895 interrupt-parent = <40000>;
1896 };
1897
1898 pic@40000 {
1899 linux,phandle = <40000>;
1900 clock-frequency = <0>;
1901 interrupt-controller;
1902 #address-cells = <0>;
1903 reg = <40000 40000>;
1904 built-in;
1905 compatible = "chrp,open-pic";
1906 device_type = "open-pic";
1907 big-endian;
1908 };
1909
1910 i2c@3000 {
1911 interrupt-parent = <40000>;
1912 interrupts = <1b 3>;
1913 reg = <3000 18>;
1914 device_type = "i2c";
1915 compatible = "fsl-i2c";
1916 dfsrr;
1917 };
1918
1919 };