Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi
[deliverable/linux.git] / Documentation / powerpc / booting-without-of.txt
1 Booting the Linux/ppc kernel without Open Firmware
2 --------------------------------------------------
3
4 (c) 2005 Benjamin Herrenschmidt <benh at kernel.crashing.org>,
5 IBM Corp.
6 (c) 2005 Becky Bruce <becky.bruce at freescale.com>,
7 Freescale Semiconductor, FSL SOC and 32-bit additions
8 (c) 2006 MontaVista Software, Inc.
9 Flash chip node definition
10
11 Table of Contents
12 =================
13
14 I - Introduction
15 1) Entry point for arch/powerpc
16 2) Board support
17
18 II - The DT block format
19 1) Header
20 2) Device tree generalities
21 3) Device tree "structure" block
22 4) Device tree "strings" block
23
24 III - Required content of the device tree
25 1) Note about cells and address representation
26 2) Note about "compatible" properties
27 3) Note about "name" properties
28 4) Note about node and property names and character set
29 5) Required nodes and properties
30 a) The root node
31 b) The /cpus node
32 c) The /cpus/* nodes
33 d) the /memory node(s)
34 e) The /chosen node
35 f) the /soc<SOCname> node
36
37 IV - "dtc", the device tree compiler
38
39 V - Recommendations for a bootloader
40
41 VI - System-on-a-chip devices and nodes
42 1) Defining child nodes of an SOC
43 2) Representing devices without a current OF specification
44 a) MDIO IO device
45 b) Gianfar-compatible ethernet nodes
46 c) PHY nodes
47 d) Interrupt controllers
48 e) I2C
49 f) Freescale SOC USB controllers
50 g) Freescale SOC SEC Security Engines
51 h) Board Control and Status (BCSR)
52 i) Freescale QUICC Engine module (QE)
53 j) CFI or JEDEC memory-mapped NOR flash
54 k) Global Utilities Block
55 l) Freescale Communications Processor Module
56 m) Chipselect/Local Bus
57 n) 4xx/Axon EMAC ethernet nodes
58 o) Xilinx IP cores
59 p) Freescale Synchronous Serial Interface
60 q) USB EHCI controllers
61
62 VII - Marvell Discovery mv64[345]6x System Controller chips
63 1) The /system-controller node
64 2) Child nodes of /system-controller
65 a) Marvell Discovery MDIO bus
66 b) Marvell Discovery ethernet controller
67 c) Marvell Discovery PHY nodes
68 d) Marvell Discovery SDMA nodes
69 e) Marvell Discovery BRG nodes
70 f) Marvell Discovery CUNIT nodes
71 g) Marvell Discovery MPSCROUTING nodes
72 h) Marvell Discovery MPSCINTR nodes
73 i) Marvell Discovery MPSC nodes
74 j) Marvell Discovery Watch Dog Timer nodes
75 k) Marvell Discovery I2C nodes
76 l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
77 m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
78 n) Marvell Discovery GPP (General Purpose Pins) nodes
79 o) Marvell Discovery PCI host bridge node
80 p) Marvell Discovery CPU Error nodes
81 q) Marvell Discovery SRAM Controller nodes
82 r) Marvell Discovery PCI Error Handler nodes
83 s) Marvell Discovery Memory Controller nodes
84
85 VIII - Specifying interrupt information for devices
86 1) interrupts property
87 2) interrupt-parent property
88 3) OpenPIC Interrupt Controllers
89 4) ISA Interrupt Controllers
90
91 Appendix A - Sample SOC node for MPC8540
92
93
94 Revision Information
95 ====================
96
97 May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet.
98
99 May 19, 2005: Rev 0.2 - Add chapter III and bits & pieces here or
100 clarifies the fact that a lot of things are
101 optional, the kernel only requires a very
102 small device tree, though it is encouraged
103 to provide an as complete one as possible.
104
105 May 24, 2005: Rev 0.3 - Precise that DT block has to be in RAM
106 - Misc fixes
107 - Define version 3 and new format version 16
108 for the DT block (version 16 needs kernel
109 patches, will be fwd separately).
110 String block now has a size, and full path
111 is replaced by unit name for more
112 compactness.
113 linux,phandle is made optional, only nodes
114 that are referenced by other nodes need it.
115 "name" property is now automatically
116 deduced from the unit name
117
118 June 1, 2005: Rev 0.4 - Correct confusion between OF_DT_END and
119 OF_DT_END_NODE in structure definition.
120 - Change version 16 format to always align
121 property data to 4 bytes. Since tokens are
122 already aligned, that means no specific
123 required alignment between property size
124 and property data. The old style variable
125 alignment would make it impossible to do
126 "simple" insertion of properties using
127 memmove (thanks Milton for
128 noticing). Updated kernel patch as well
129 - Correct a few more alignment constraints
130 - Add a chapter about the device-tree
131 compiler and the textural representation of
132 the tree that can be "compiled" by dtc.
133
134 November 21, 2005: Rev 0.5
135 - Additions/generalizations for 32-bit
136 - Changed to reflect the new arch/powerpc
137 structure
138 - Added chapter VI
139
140
141 ToDo:
142 - Add some definitions of interrupt tree (simple/complex)
143 - Add some definitions for PCI host bridges
144 - Add some common address format examples
145 - Add definitions for standard properties and "compatible"
146 names for cells that are not already defined by the existing
147 OF spec.
148 - Compare FSL SOC use of PCI to standard and make sure no new
149 node definition required.
150 - Add more information about node definitions for SOC devices
151 that currently have no standard, like the FSL CPM.
152
153
154 I - Introduction
155 ================
156
157 During the recent development of the Linux/ppc64 kernel, and more
158 specifically, the addition of new platform types outside of the old
159 IBM pSeries/iSeries pair, it was decided to enforce some strict rules
160 regarding the kernel entry and bootloader <-> kernel interfaces, in
161 order to avoid the degeneration that had become the ppc32 kernel entry
162 point and the way a new platform should be added to the kernel. The
163 legacy iSeries platform breaks those rules as it predates this scheme,
164 but no new board support will be accepted in the main tree that
165 doesn't follows them properly. In addition, since the advent of the
166 arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit
167 platforms and 32-bit platforms which move into arch/powerpc will be
168 required to use these rules as well.
169
170 The main requirement that will be defined in more detail below is
171 the presence of a device-tree whose format is defined after Open
172 Firmware specification. However, in order to make life easier
173 to embedded board vendors, the kernel doesn't require the device-tree
174 to represent every device in the system and only requires some nodes
175 and properties to be present. This will be described in detail in
176 section III, but, for example, the kernel does not require you to
177 create a node for every PCI device in the system. It is a requirement
178 to have a node for PCI host bridges in order to provide interrupt
179 routing informations and memory/IO ranges, among others. It is also
180 recommended to define nodes for on chip devices and other busses that
181 don't specifically fit in an existing OF specification. This creates a
182 great flexibility in the way the kernel can then probe those and match
183 drivers to device, without having to hard code all sorts of tables. It
184 also makes it more flexible for board vendors to do minor hardware
185 upgrades without significantly impacting the kernel code or cluttering
186 it with special cases.
187
188
189 1) Entry point for arch/powerpc
190 -------------------------------
191
192 There is one and one single entry point to the kernel, at the start
193 of the kernel image. That entry point supports two calling
194 conventions:
195
196 a) Boot from Open Firmware. If your firmware is compatible
197 with Open Firmware (IEEE 1275) or provides an OF compatible
198 client interface API (support for "interpret" callback of
199 forth words isn't required), you can enter the kernel with:
200
201 r5 : OF callback pointer as defined by IEEE 1275
202 bindings to powerpc. Only the 32-bit client interface
203 is currently supported
204
205 r3, r4 : address & length of an initrd if any or 0
206
207 The MMU is either on or off; the kernel will run the
208 trampoline located in arch/powerpc/kernel/prom_init.c to
209 extract the device-tree and other information from open
210 firmware and build a flattened device-tree as described
211 in b). prom_init() will then re-enter the kernel using
212 the second method. This trampoline code runs in the
213 context of the firmware, which is supposed to handle all
214 exceptions during that time.
215
216 b) Direct entry with a flattened device-tree block. This entry
217 point is called by a) after the OF trampoline and can also be
218 called directly by a bootloader that does not support the Open
219 Firmware client interface. It is also used by "kexec" to
220 implement "hot" booting of a new kernel from a previous
221 running one. This method is what I will describe in more
222 details in this document, as method a) is simply standard Open
223 Firmware, and thus should be implemented according to the
224 various standard documents defining it and its binding to the
225 PowerPC platform. The entry point definition then becomes:
226
227 r3 : physical pointer to the device-tree block
228 (defined in chapter II) in RAM
229
230 r4 : physical pointer to the kernel itself. This is
231 used by the assembly code to properly disable the MMU
232 in case you are entering the kernel with MMU enabled
233 and a non-1:1 mapping.
234
235 r5 : NULL (as to differentiate with method a)
236
237 Note about SMP entry: Either your firmware puts your other
238 CPUs in some sleep loop or spin loop in ROM where you can get
239 them out via a soft reset or some other means, in which case
240 you don't need to care, or you'll have to enter the kernel
241 with all CPUs. The way to do that with method b) will be
242 described in a later revision of this document.
243
244
245 2) Board support
246 ----------------
247
248 64-bit kernels:
249
250 Board supports (platforms) are not exclusive config options. An
251 arbitrary set of board supports can be built in a single kernel
252 image. The kernel will "know" what set of functions to use for a
253 given platform based on the content of the device-tree. Thus, you
254 should:
255
256 a) add your platform support as a _boolean_ option in
257 arch/powerpc/Kconfig, following the example of PPC_PSERIES,
258 PPC_PMAC and PPC_MAPLE. The later is probably a good
259 example of a board support to start from.
260
261 b) create your main platform file as
262 "arch/powerpc/platforms/myplatform/myboard_setup.c" and add it
263 to the Makefile under the condition of your CONFIG_
264 option. This file will define a structure of type "ppc_md"
265 containing the various callbacks that the generic code will
266 use to get to your platform specific code
267
268 c) Add a reference to your "ppc_md" structure in the
269 "machines" table in arch/powerpc/kernel/setup_64.c if you are
270 a 64-bit platform.
271
272 d) request and get assigned a platform number (see PLATFORM_*
273 constants in include/asm-powerpc/processor.h
274
275 32-bit embedded kernels:
276
277 Currently, board support is essentially an exclusive config option.
278 The kernel is configured for a single platform. Part of the reason
279 for this is to keep kernels on embedded systems small and efficient;
280 part of this is due to the fact the code is already that way. In the
281 future, a kernel may support multiple platforms, but only if the
282 platforms feature the same core architecture. A single kernel build
283 cannot support both configurations with Book E and configurations
284 with classic Powerpc architectures.
285
286 32-bit embedded platforms that are moved into arch/powerpc using a
287 flattened device tree should adopt the merged tree practice of
288 setting ppc_md up dynamically, even though the kernel is currently
289 built with support for only a single platform at a time. This allows
290 unification of the setup code, and will make it easier to go to a
291 multiple-platform-support model in the future.
292
293 NOTE: I believe the above will be true once Ben's done with the merge
294 of the boot sequences.... someone speak up if this is wrong!
295
296 To add a 32-bit embedded platform support, follow the instructions
297 for 64-bit platforms above, with the exception that the Kconfig
298 option should be set up such that the kernel builds exclusively for
299 the platform selected. The processor type for the platform should
300 enable another config option to select the specific board
301 supported.
302
303 NOTE: If Ben doesn't merge the setup files, may need to change this to
304 point to setup_32.c
305
306
307 I will describe later the boot process and various callbacks that
308 your platform should implement.
309
310
311 II - The DT block format
312 ========================
313
314
315 This chapter defines the actual format of the flattened device-tree
316 passed to the kernel. The actual content of it and kernel requirements
317 are described later. You can find example of code manipulating that
318 format in various places, including arch/powerpc/kernel/prom_init.c
319 which will generate a flattened device-tree from the Open Firmware
320 representation, or the fs2dt utility which is part of the kexec tools
321 which will generate one from a filesystem representation. It is
322 expected that a bootloader like uboot provides a bit more support,
323 that will be discussed later as well.
324
325 Note: The block has to be in main memory. It has to be accessible in
326 both real mode and virtual mode with no mapping other than main
327 memory. If you are writing a simple flash bootloader, it should copy
328 the block to RAM before passing it to the kernel.
329
330
331 1) Header
332 ---------
333
334 The kernel is entered with r3 pointing to an area of memory that is
335 roughly described in include/asm-powerpc/prom.h by the structure
336 boot_param_header:
337
338 struct boot_param_header {
339 u32 magic; /* magic word OF_DT_HEADER */
340 u32 totalsize; /* total size of DT block */
341 u32 off_dt_struct; /* offset to structure */
342 u32 off_dt_strings; /* offset to strings */
343 u32 off_mem_rsvmap; /* offset to memory reserve map
344 */
345 u32 version; /* format version */
346 u32 last_comp_version; /* last compatible version */
347
348 /* version 2 fields below */
349 u32 boot_cpuid_phys; /* Which physical CPU id we're
350 booting on */
351 /* version 3 fields below */
352 u32 size_dt_strings; /* size of the strings block */
353
354 /* version 17 fields below */
355 u32 size_dt_struct; /* size of the DT structure block */
356 };
357
358 Along with the constants:
359
360 /* Definitions used by the flattened device tree */
361 #define OF_DT_HEADER 0xd00dfeed /* 4: version,
362 4: total size */
363 #define OF_DT_BEGIN_NODE 0x1 /* Start node: full name
364 */
365 #define OF_DT_END_NODE 0x2 /* End node */
366 #define OF_DT_PROP 0x3 /* Property: name off,
367 size, content */
368 #define OF_DT_END 0x9
369
370 All values in this header are in big endian format, the various
371 fields in this header are defined more precisely below. All
372 "offset" values are in bytes from the start of the header; that is
373 from the value of r3.
374
375 - magic
376
377 This is a magic value that "marks" the beginning of the
378 device-tree block header. It contains the value 0xd00dfeed and is
379 defined by the constant OF_DT_HEADER
380
381 - totalsize
382
383 This is the total size of the DT block including the header. The
384 "DT" block should enclose all data structures defined in this
385 chapter (who are pointed to by offsets in this header). That is,
386 the device-tree structure, strings, and the memory reserve map.
387
388 - off_dt_struct
389
390 This is an offset from the beginning of the header to the start
391 of the "structure" part the device tree. (see 2) device tree)
392
393 - off_dt_strings
394
395 This is an offset from the beginning of the header to the start
396 of the "strings" part of the device-tree
397
398 - off_mem_rsvmap
399
400 This is an offset from the beginning of the header to the start
401 of the reserved memory map. This map is a list of pairs of 64-
402 bit integers. Each pair is a physical address and a size. The
403 list is terminated by an entry of size 0. This map provides the
404 kernel with a list of physical memory areas that are "reserved"
405 and thus not to be used for memory allocations, especially during
406 early initialization. The kernel needs to allocate memory during
407 boot for things like un-flattening the device-tree, allocating an
408 MMU hash table, etc... Those allocations must be done in such a
409 way to avoid overriding critical things like, on Open Firmware
410 capable machines, the RTAS instance, or on some pSeries, the TCE
411 tables used for the iommu. Typically, the reserve map should
412 contain _at least_ this DT block itself (header,total_size). If
413 you are passing an initrd to the kernel, you should reserve it as
414 well. You do not need to reserve the kernel image itself. The map
415 should be 64-bit aligned.
416
417 - version
418
419 This is the version of this structure. Version 1 stops
420 here. Version 2 adds an additional field boot_cpuid_phys.
421 Version 3 adds the size of the strings block, allowing the kernel
422 to reallocate it easily at boot and free up the unused flattened
423 structure after expansion. Version 16 introduces a new more
424 "compact" format for the tree itself that is however not backward
425 compatible. Version 17 adds an additional field, size_dt_struct,
426 allowing it to be reallocated or moved more easily (this is
427 particularly useful for bootloaders which need to make
428 adjustments to a device tree based on probed information). You
429 should always generate a structure of the highest version defined
430 at the time of your implementation. Currently that is version 17,
431 unless you explicitly aim at being backward compatible.
432
433 - last_comp_version
434
435 Last compatible version. This indicates down to what version of
436 the DT block you are backward compatible. For example, version 2
437 is backward compatible with version 1 (that is, a kernel build
438 for version 1 will be able to boot with a version 2 format). You
439 should put a 1 in this field if you generate a device tree of
440 version 1 to 3, or 16 if you generate a tree of version 16 or 17
441 using the new unit name format.
442
443 - boot_cpuid_phys
444
445 This field only exist on version 2 headers. It indicate which
446 physical CPU ID is calling the kernel entry point. This is used,
447 among others, by kexec. If you are on an SMP system, this value
448 should match the content of the "reg" property of the CPU node in
449 the device-tree corresponding to the CPU calling the kernel entry
450 point (see further chapters for more informations on the required
451 device-tree contents)
452
453 - size_dt_strings
454
455 This field only exists on version 3 and later headers. It
456 gives the size of the "strings" section of the device tree (which
457 starts at the offset given by off_dt_strings).
458
459 - size_dt_struct
460
461 This field only exists on version 17 and later headers. It gives
462 the size of the "structure" section of the device tree (which
463 starts at the offset given by off_dt_struct).
464
465 So the typical layout of a DT block (though the various parts don't
466 need to be in that order) looks like this (addresses go from top to
467 bottom):
468
469
470 ------------------------------
471 r3 -> | struct boot_param_header |
472 ------------------------------
473 | (alignment gap) (*) |
474 ------------------------------
475 | memory reserve map |
476 ------------------------------
477 | (alignment gap) |
478 ------------------------------
479 | |
480 | device-tree structure |
481 | |
482 ------------------------------
483 | (alignment gap) |
484 ------------------------------
485 | |
486 | device-tree strings |
487 | |
488 -----> ------------------------------
489 |
490 |
491 --- (r3 + totalsize)
492
493 (*) The alignment gaps are not necessarily present; their presence
494 and size are dependent on the various alignment requirements of
495 the individual data blocks.
496
497
498 2) Device tree generalities
499 ---------------------------
500
501 This device-tree itself is separated in two different blocks, a
502 structure block and a strings block. Both need to be aligned to a 4
503 byte boundary.
504
505 First, let's quickly describe the device-tree concept before detailing
506 the storage format. This chapter does _not_ describe the detail of the
507 required types of nodes & properties for the kernel, this is done
508 later in chapter III.
509
510 The device-tree layout is strongly inherited from the definition of
511 the Open Firmware IEEE 1275 device-tree. It's basically a tree of
512 nodes, each node having two or more named properties. A property can
513 have a value or not.
514
515 It is a tree, so each node has one and only one parent except for the
516 root node who has no parent.
517
518 A node has 2 names. The actual node name is generally contained in a
519 property of type "name" in the node property list whose value is a
520 zero terminated string and is mandatory for version 1 to 3 of the
521 format definition (as it is in Open Firmware). Version 16 makes it
522 optional as it can generate it from the unit name defined below.
523
524 There is also a "unit name" that is used to differentiate nodes with
525 the same name at the same level, it is usually made of the node
526 names, the "@" sign, and a "unit address", which definition is
527 specific to the bus type the node sits on.
528
529 The unit name doesn't exist as a property per-se but is included in
530 the device-tree structure. It is typically used to represent "path" in
531 the device-tree. More details about the actual format of these will be
532 below.
533
534 The kernel powerpc generic code does not make any formal use of the
535 unit address (though some board support code may do) so the only real
536 requirement here for the unit address is to ensure uniqueness of
537 the node unit name at a given level of the tree. Nodes with no notion
538 of address and no possible sibling of the same name (like /memory or
539 /cpus) may omit the unit address in the context of this specification,
540 or use the "@0" default unit address. The unit name is used to define
541 a node "full path", which is the concatenation of all parent node
542 unit names separated with "/".
543
544 The root node doesn't have a defined name, and isn't required to have
545 a name property either if you are using version 3 or earlier of the
546 format. It also has no unit address (no @ symbol followed by a unit
547 address). The root node unit name is thus an empty string. The full
548 path to the root node is "/".
549
550 Every node which actually represents an actual device (that is, a node
551 which isn't only a virtual "container" for more nodes, like "/cpus"
552 is) is also required to have a "device_type" property indicating the
553 type of node .
554
555 Finally, every node that can be referenced from a property in another
556 node is required to have a "linux,phandle" property. Real open
557 firmware implementations provide a unique "phandle" value for every
558 node that the "prom_init()" trampoline code turns into
559 "linux,phandle" properties. However, this is made optional if the
560 flattened device tree is used directly. An example of a node
561 referencing another node via "phandle" is when laying out the
562 interrupt tree which will be described in a further version of this
563 document.
564
565 This "linux, phandle" property is a 32-bit value that uniquely
566 identifies a node. You are free to use whatever values or system of
567 values, internal pointers, or whatever to generate these, the only
568 requirement is that every node for which you provide that property has
569 a unique value for it.
570
571 Here is an example of a simple device-tree. In this example, an "o"
572 designates a node followed by the node unit name. Properties are
573 presented with their name followed by their content. "content"
574 represents an ASCII string (zero terminated) value, while <content>
575 represents a 32-bit hexadecimal value. The various nodes in this
576 example will be discussed in a later chapter. At this point, it is
577 only meant to give you a idea of what a device-tree looks like. I have
578 purposefully kept the "name" and "linux,phandle" properties which
579 aren't necessary in order to give you a better idea of what the tree
580 looks like in practice.
581
582 / o device-tree
583 |- name = "device-tree"
584 |- model = "MyBoardName"
585 |- compatible = "MyBoardFamilyName"
586 |- #address-cells = <2>
587 |- #size-cells = <2>
588 |- linux,phandle = <0>
589 |
590 o cpus
591 | | - name = "cpus"
592 | | - linux,phandle = <1>
593 | | - #address-cells = <1>
594 | | - #size-cells = <0>
595 | |
596 | o PowerPC,970@0
597 | |- name = "PowerPC,970"
598 | |- device_type = "cpu"
599 | |- reg = <0>
600 | |- clock-frequency = <5f5e1000>
601 | |- 64-bit
602 | |- linux,phandle = <2>
603 |
604 o memory@0
605 | |- name = "memory"
606 | |- device_type = "memory"
607 | |- reg = <00000000 00000000 00000000 20000000>
608 | |- linux,phandle = <3>
609 |
610 o chosen
611 |- name = "chosen"
612 |- bootargs = "root=/dev/sda2"
613 |- linux,phandle = <4>
614
615 This tree is almost a minimal tree. It pretty much contains the
616 minimal set of required nodes and properties to boot a linux kernel;
617 that is, some basic model informations at the root, the CPUs, and the
618 physical memory layout. It also includes misc information passed
619 through /chosen, like in this example, the platform type (mandatory)
620 and the kernel command line arguments (optional).
621
622 The /cpus/PowerPC,970@0/64-bit property is an example of a
623 property without a value. All other properties have a value. The
624 significance of the #address-cells and #size-cells properties will be
625 explained in chapter IV which defines precisely the required nodes and
626 properties and their content.
627
628
629 3) Device tree "structure" block
630
631 The structure of the device tree is a linearized tree structure. The
632 "OF_DT_BEGIN_NODE" token starts a new node, and the "OF_DT_END_NODE"
633 ends that node definition. Child nodes are simply defined before
634 "OF_DT_END_NODE" (that is nodes within the node). A 'token' is a 32
635 bit value. The tree has to be "finished" with a OF_DT_END token
636
637 Here's the basic structure of a single node:
638
639 * token OF_DT_BEGIN_NODE (that is 0x00000001)
640 * for version 1 to 3, this is the node full path as a zero
641 terminated string, starting with "/". For version 16 and later,
642 this is the node unit name only (or an empty string for the
643 root node)
644 * [align gap to next 4 bytes boundary]
645 * for each property:
646 * token OF_DT_PROP (that is 0x00000003)
647 * 32-bit value of property value size in bytes (or 0 if no
648 value)
649 * 32-bit value of offset in string block of property name
650 * property value data if any
651 * [align gap to next 4 bytes boundary]
652 * [child nodes if any]
653 * token OF_DT_END_NODE (that is 0x00000002)
654
655 So the node content can be summarized as a start token, a full path,
656 a list of properties, a list of child nodes, and an end token. Every
657 child node is a full node structure itself as defined above.
658
659 NOTE: The above definition requires that all property definitions for
660 a particular node MUST precede any subnode definitions for that node.
661 Although the structure would not be ambiguous if properties and
662 subnodes were intermingled, the kernel parser requires that the
663 properties come first (up until at least 2.6.22). Any tools
664 manipulating a flattened tree must take care to preserve this
665 constraint.
666
667 4) Device tree "strings" block
668
669 In order to save space, property names, which are generally redundant,
670 are stored separately in the "strings" block. This block is simply the
671 whole bunch of zero terminated strings for all property names
672 concatenated together. The device-tree property definitions in the
673 structure block will contain offset values from the beginning of the
674 strings block.
675
676
677 III - Required content of the device tree
678 =========================================
679
680 WARNING: All "linux,*" properties defined in this document apply only
681 to a flattened device-tree. If your platform uses a real
682 implementation of Open Firmware or an implementation compatible with
683 the Open Firmware client interface, those properties will be created
684 by the trampoline code in the kernel's prom_init() file. For example,
685 that's where you'll have to add code to detect your board model and
686 set the platform number. However, when using the flattened device-tree
687 entry point, there is no prom_init() pass, and thus you have to
688 provide those properties yourself.
689
690
691 1) Note about cells and address representation
692 ----------------------------------------------
693
694 The general rule is documented in the various Open Firmware
695 documentations. If you choose to describe a bus with the device-tree
696 and there exist an OF bus binding, then you should follow the
697 specification. However, the kernel does not require every single
698 device or bus to be described by the device tree.
699
700 In general, the format of an address for a device is defined by the
701 parent bus type, based on the #address-cells and #size-cells
702 properties. Note that the parent's parent definitions of #address-cells
703 and #size-cells are not inhereted so every node with children must specify
704 them. The kernel requires the root node to have those properties defining
705 addresses format for devices directly mapped on the processor bus.
706
707 Those 2 properties define 'cells' for representing an address and a
708 size. A "cell" is a 32-bit number. For example, if both contain 2
709 like the example tree given above, then an address and a size are both
710 composed of 2 cells, and each is a 64-bit number (cells are
711 concatenated and expected to be in big endian format). Another example
712 is the way Apple firmware defines them, with 2 cells for an address
713 and one cell for a size. Most 32-bit implementations should define
714 #address-cells and #size-cells to 1, which represents a 32-bit value.
715 Some 32-bit processors allow for physical addresses greater than 32
716 bits; these processors should define #address-cells as 2.
717
718 "reg" properties are always a tuple of the type "address size" where
719 the number of cells of address and size is specified by the bus
720 #address-cells and #size-cells. When a bus supports various address
721 spaces and other flags relative to a given address allocation (like
722 prefetchable, etc...) those flags are usually added to the top level
723 bits of the physical address. For example, a PCI physical address is
724 made of 3 cells, the bottom two containing the actual address itself
725 while the top cell contains address space indication, flags, and pci
726 bus & device numbers.
727
728 For busses that support dynamic allocation, it's the accepted practice
729 to then not provide the address in "reg" (keep it 0) though while
730 providing a flag indicating the address is dynamically allocated, and
731 then, to provide a separate "assigned-addresses" property that
732 contains the fully allocated addresses. See the PCI OF bindings for
733 details.
734
735 In general, a simple bus with no address space bits and no dynamic
736 allocation is preferred if it reflects your hardware, as the existing
737 kernel address parsing functions will work out of the box. If you
738 define a bus type with a more complex address format, including things
739 like address space bits, you'll have to add a bus translator to the
740 prom_parse.c file of the recent kernels for your bus type.
741
742 The "reg" property only defines addresses and sizes (if #size-cells is
743 non-0) within a given bus. In order to translate addresses upward
744 (that is into parent bus addresses, and possibly into CPU physical
745 addresses), all busses must contain a "ranges" property. If the
746 "ranges" property is missing at a given level, it's assumed that
747 translation isn't possible, i.e., the registers are not visible on the
748 parent bus. The format of the "ranges" property for a bus is a list
749 of:
750
751 bus address, parent bus address, size
752
753 "bus address" is in the format of the bus this bus node is defining,
754 that is, for a PCI bridge, it would be a PCI address. Thus, (bus
755 address, size) defines a range of addresses for child devices. "parent
756 bus address" is in the format of the parent bus of this bus. For
757 example, for a PCI host controller, that would be a CPU address. For a
758 PCI<->ISA bridge, that would be a PCI address. It defines the base
759 address in the parent bus where the beginning of that range is mapped.
760
761 For a new 64-bit powerpc board, I recommend either the 2/2 format or
762 Apple's 2/1 format which is slightly more compact since sizes usually
763 fit in a single 32-bit word. New 32-bit powerpc boards should use a
764 1/1 format, unless the processor supports physical addresses greater
765 than 32-bits, in which case a 2/1 format is recommended.
766
767 Alternatively, the "ranges" property may be empty, indicating that the
768 registers are visible on the parent bus using an identity mapping
769 translation. In other words, the parent bus address space is the same
770 as the child bus address space.
771
772 2) Note about "compatible" properties
773 -------------------------------------
774
775 These properties are optional, but recommended in devices and the root
776 node. The format of a "compatible" property is a list of concatenated
777 zero terminated strings. They allow a device to express its
778 compatibility with a family of similar devices, in some cases,
779 allowing a single driver to match against several devices regardless
780 of their actual names.
781
782 3) Note about "name" properties
783 -------------------------------
784
785 While earlier users of Open Firmware like OldWorld macintoshes tended
786 to use the actual device name for the "name" property, it's nowadays
787 considered a good practice to use a name that is closer to the device
788 class (often equal to device_type). For example, nowadays, ethernet
789 controllers are named "ethernet", an additional "model" property
790 defining precisely the chip type/model, and "compatible" property
791 defining the family in case a single driver can driver more than one
792 of these chips. However, the kernel doesn't generally put any
793 restriction on the "name" property; it is simply considered good
794 practice to follow the standard and its evolutions as closely as
795 possible.
796
797 Note also that the new format version 16 makes the "name" property
798 optional. If it's absent for a node, then the node's unit name is then
799 used to reconstruct the name. That is, the part of the unit name
800 before the "@" sign is used (or the entire unit name if no "@" sign
801 is present).
802
803 4) Note about node and property names and character set
804 -------------------------------------------------------
805
806 While open firmware provides more flexible usage of 8859-1, this
807 specification enforces more strict rules. Nodes and properties should
808 be comprised only of ASCII characters 'a' to 'z', '0' to
809 '9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally
810 allow uppercase characters 'A' to 'Z' (property names should be
811 lowercase. The fact that vendors like Apple don't respect this rule is
812 irrelevant here). Additionally, node and property names should always
813 begin with a character in the range 'a' to 'z' (or 'A' to 'Z' for node
814 names).
815
816 The maximum number of characters for both nodes and property names
817 is 31. In the case of node names, this is only the leftmost part of
818 a unit name (the pure "name" property), it doesn't include the unit
819 address which can extend beyond that limit.
820
821
822 5) Required nodes and properties
823 --------------------------------
824 These are all that are currently required. However, it is strongly
825 recommended that you expose PCI host bridges as documented in the
826 PCI binding to open firmware, and your interrupt tree as documented
827 in OF interrupt tree specification.
828
829 a) The root node
830
831 The root node requires some properties to be present:
832
833 - model : this is your board name/model
834 - #address-cells : address representation for "root" devices
835 - #size-cells: the size representation for "root" devices
836 - device_type : This property shouldn't be necessary. However, if
837 you decide to create a device_type for your root node, make sure it
838 is _not_ "chrp" unless your platform is a pSeries or PAPR compliant
839 one for 64-bit, or a CHRP-type machine for 32-bit as this will
840 matched by the kernel this way.
841
842 Additionally, some recommended properties are:
843
844 - compatible : the board "family" generally finds its way here,
845 for example, if you have 2 board models with a similar layout,
846 that typically get driven by the same platform code in the
847 kernel, you would use a different "model" property but put a
848 value in "compatible". The kernel doesn't directly use that
849 value but it is generally useful.
850
851 The root node is also generally where you add additional properties
852 specific to your board like the serial number if any, that sort of
853 thing. It is recommended that if you add any "custom" property whose
854 name may clash with standard defined ones, you prefix them with your
855 vendor name and a comma.
856
857 b) The /cpus node
858
859 This node is the parent of all individual CPU nodes. It doesn't
860 have any specific requirements, though it's generally good practice
861 to have at least:
862
863 #address-cells = <00000001>
864 #size-cells = <00000000>
865
866 This defines that the "address" for a CPU is a single cell, and has
867 no meaningful size. This is not necessary but the kernel will assume
868 that format when reading the "reg" properties of a CPU node, see
869 below
870
871 c) The /cpus/* nodes
872
873 So under /cpus, you are supposed to create a node for every CPU on
874 the machine. There is no specific restriction on the name of the
875 CPU, though It's common practice to call it PowerPC,<name>. For
876 example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX.
877
878 Required properties:
879
880 - device_type : has to be "cpu"
881 - reg : This is the physical CPU number, it's a single 32-bit cell
882 and is also used as-is as the unit number for constructing the
883 unit name in the full path. For example, with 2 CPUs, you would
884 have the full path:
885 /cpus/PowerPC,970FX@0
886 /cpus/PowerPC,970FX@1
887 (unit addresses do not require leading zeroes)
888 - d-cache-block-size : one cell, L1 data cache block size in bytes (*)
889 - i-cache-block-size : one cell, L1 instruction cache block size in
890 bytes
891 - d-cache-size : one cell, size of L1 data cache in bytes
892 - i-cache-size : one cell, size of L1 instruction cache in bytes
893
894 (*) The cache "block" size is the size on which the cache management
895 instructions operate. Historically, this document used the cache
896 "line" size here which is incorrect. The kernel will prefer the cache
897 block size and will fallback to cache line size for backward
898 compatibility.
899
900 Recommended properties:
901
902 - timebase-frequency : a cell indicating the frequency of the
903 timebase in Hz. This is not directly used by the generic code,
904 but you are welcome to copy/paste the pSeries code for setting
905 the kernel timebase/decrementer calibration based on this
906 value.
907 - clock-frequency : a cell indicating the CPU core clock frequency
908 in Hz. A new property will be defined for 64-bit values, but if
909 your frequency is < 4Ghz, one cell is enough. Here as well as
910 for the above, the common code doesn't use that property, but
911 you are welcome to re-use the pSeries or Maple one. A future
912 kernel version might provide a common function for this.
913 - d-cache-line-size : one cell, L1 data cache line size in bytes
914 if different from the block size
915 - i-cache-line-size : one cell, L1 instruction cache line size in
916 bytes if different from the block size
917
918 You are welcome to add any property you find relevant to your board,
919 like some information about the mechanism used to soft-reset the
920 CPUs. For example, Apple puts the GPIO number for CPU soft reset
921 lines in there as a "soft-reset" property since they start secondary
922 CPUs by soft-resetting them.
923
924
925 d) the /memory node(s)
926
927 To define the physical memory layout of your board, you should
928 create one or more memory node(s). You can either create a single
929 node with all memory ranges in its reg property, or you can create
930 several nodes, as you wish. The unit address (@ part) used for the
931 full path is the address of the first range of memory defined by a
932 given node. If you use a single memory node, this will typically be
933 @0.
934
935 Required properties:
936
937 - device_type : has to be "memory"
938 - reg : This property contains all the physical memory ranges of
939 your board. It's a list of addresses/sizes concatenated
940 together, with the number of cells of each defined by the
941 #address-cells and #size-cells of the root node. For example,
942 with both of these properties being 2 like in the example given
943 earlier, a 970 based machine with 6Gb of RAM could typically
944 have a "reg" property here that looks like:
945
946 00000000 00000000 00000000 80000000
947 00000001 00000000 00000001 00000000
948
949 That is a range starting at 0 of 0x80000000 bytes and a range
950 starting at 0x100000000 and of 0x100000000 bytes. You can see
951 that there is no memory covering the IO hole between 2Gb and
952 4Gb. Some vendors prefer splitting those ranges into smaller
953 segments, but the kernel doesn't care.
954
955 e) The /chosen node
956
957 This node is a bit "special". Normally, that's where open firmware
958 puts some variable environment information, like the arguments, or
959 the default input/output devices.
960
961 This specification makes a few of these mandatory, but also defines
962 some linux-specific properties that would be normally constructed by
963 the prom_init() trampoline when booting with an OF client interface,
964 but that you have to provide yourself when using the flattened format.
965
966 Recommended properties:
967
968 - bootargs : This zero-terminated string is passed as the kernel
969 command line
970 - linux,stdout-path : This is the full path to your standard
971 console device if any. Typically, if you have serial devices on
972 your board, you may want to put the full path to the one set as
973 the default console in the firmware here, for the kernel to pick
974 it up as its own default console. If you look at the function
975 set_preferred_console() in arch/ppc64/kernel/setup.c, you'll see
976 that the kernel tries to find out the default console and has
977 knowledge of various types like 8250 serial ports. You may want
978 to extend this function to add your own.
979
980 Note that u-boot creates and fills in the chosen node for platforms
981 that use it.
982
983 (Note: a practice that is now obsolete was to include a property
984 under /chosen called interrupt-controller which had a phandle value
985 that pointed to the main interrupt controller)
986
987 f) the /soc<SOCname> node
988
989 This node is used to represent a system-on-a-chip (SOC) and must be
990 present if the processor is a SOC. The top-level soc node contains
991 information that is global to all devices on the SOC. The node name
992 should contain a unit address for the SOC, which is the base address
993 of the memory-mapped register set for the SOC. The name of an soc
994 node should start with "soc", and the remainder of the name should
995 represent the part number for the soc. For example, the MPC8540's
996 soc node would be called "soc8540".
997
998 Required properties:
999
1000 - device_type : Should be "soc"
1001 - ranges : Should be defined as specified in 1) to describe the
1002 translation of SOC addresses for memory mapped SOC registers.
1003 - bus-frequency: Contains the bus frequency for the SOC node.
1004 Typically, the value of this field is filled in by the boot
1005 loader.
1006
1007
1008 Recommended properties:
1009
1010 - reg : This property defines the address and size of the
1011 memory-mapped registers that are used for the SOC node itself.
1012 It does not include the child device registers - these will be
1013 defined inside each child node. The address specified in the
1014 "reg" property should match the unit address of the SOC node.
1015 - #address-cells : Address representation for "soc" devices. The
1016 format of this field may vary depending on whether or not the
1017 device registers are memory mapped. For memory mapped
1018 registers, this field represents the number of cells needed to
1019 represent the address of the registers. For SOCs that do not
1020 use MMIO, a special address format should be defined that
1021 contains enough cells to represent the required information.
1022 See 1) above for more details on defining #address-cells.
1023 - #size-cells : Size representation for "soc" devices
1024 - #interrupt-cells : Defines the width of cells used to represent
1025 interrupts. Typically this value is <2>, which includes a
1026 32-bit number that represents the interrupt number, and a
1027 32-bit number that represents the interrupt sense and level.
1028 This field is only needed if the SOC contains an interrupt
1029 controller.
1030
1031 The SOC node may contain child nodes for each SOC device that the
1032 platform uses. Nodes should not be created for devices which exist
1033 on the SOC but are not used by a particular platform. See chapter VI
1034 for more information on how to specify devices that are part of a SOC.
1035
1036 Example SOC node for the MPC8540:
1037
1038 soc8540@e0000000 {
1039 #address-cells = <1>;
1040 #size-cells = <1>;
1041 #interrupt-cells = <2>;
1042 device_type = "soc";
1043 ranges = <00000000 e0000000 00100000>
1044 reg = <e0000000 00003000>;
1045 bus-frequency = <0>;
1046 }
1047
1048
1049
1050 IV - "dtc", the device tree compiler
1051 ====================================
1052
1053
1054 dtc source code can be found at
1055 <http://ozlabs.org/~dgibson/dtc/dtc.tar.gz>
1056
1057 WARNING: This version is still in early development stage; the
1058 resulting device-tree "blobs" have not yet been validated with the
1059 kernel. The current generated bloc lacks a useful reserve map (it will
1060 be fixed to generate an empty one, it's up to the bootloader to fill
1061 it up) among others. The error handling needs work, bugs are lurking,
1062 etc...
1063
1064 dtc basically takes a device-tree in a given format and outputs a
1065 device-tree in another format. The currently supported formats are:
1066
1067 Input formats:
1068 -------------
1069
1070 - "dtb": "blob" format, that is a flattened device-tree block
1071 with
1072 header all in a binary blob.
1073 - "dts": "source" format. This is a text file containing a
1074 "source" for a device-tree. The format is defined later in this
1075 chapter.
1076 - "fs" format. This is a representation equivalent to the
1077 output of /proc/device-tree, that is nodes are directories and
1078 properties are files
1079
1080 Output formats:
1081 ---------------
1082
1083 - "dtb": "blob" format
1084 - "dts": "source" format
1085 - "asm": assembly language file. This is a file that can be
1086 sourced by gas to generate a device-tree "blob". That file can
1087 then simply be added to your Makefile. Additionally, the
1088 assembly file exports some symbols that can be used.
1089
1090
1091 The syntax of the dtc tool is
1092
1093 dtc [-I <input-format>] [-O <output-format>]
1094 [-o output-filename] [-V output_version] input_filename
1095
1096
1097 The "output_version" defines what version of the "blob" format will be
1098 generated. Supported versions are 1,2,3 and 16. The default is
1099 currently version 3 but that may change in the future to version 16.
1100
1101 Additionally, dtc performs various sanity checks on the tree, like the
1102 uniqueness of linux, phandle properties, validity of strings, etc...
1103
1104 The format of the .dts "source" file is "C" like, supports C and C++
1105 style comments.
1106
1107 / {
1108 }
1109
1110 The above is the "device-tree" definition. It's the only statement
1111 supported currently at the toplevel.
1112
1113 / {
1114 property1 = "string_value"; /* define a property containing a 0
1115 * terminated string
1116 */
1117
1118 property2 = <1234abcd>; /* define a property containing a
1119 * numerical 32-bit value (hexadecimal)
1120 */
1121
1122 property3 = <12345678 12345678 deadbeef>;
1123 /* define a property containing 3
1124 * numerical 32-bit values (cells) in
1125 * hexadecimal
1126 */
1127 property4 = [0a 0b 0c 0d de ea ad be ef];
1128 /* define a property whose content is
1129 * an arbitrary array of bytes
1130 */
1131
1132 childnode@addresss { /* define a child node named "childnode"
1133 * whose unit name is "childnode at
1134 * address"
1135 */
1136
1137 childprop = "hello\n"; /* define a property "childprop" of
1138 * childnode (in this case, a string)
1139 */
1140 };
1141 };
1142
1143 Nodes can contain other nodes etc... thus defining the hierarchical
1144 structure of the tree.
1145
1146 Strings support common escape sequences from C: "\n", "\t", "\r",
1147 "\(octal value)", "\x(hex value)".
1148
1149 It is also suggested that you pipe your source file through cpp (gcc
1150 preprocessor) so you can use #include's, #define for constants, etc...
1151
1152 Finally, various options are planned but not yet implemented, like
1153 automatic generation of phandles, labels (exported to the asm file so
1154 you can point to a property content and change it easily from whatever
1155 you link the device-tree with), label or path instead of numeric value
1156 in some cells to "point" to a node (replaced by a phandle at compile
1157 time), export of reserve map address to the asm file, ability to
1158 specify reserve map content at compile time, etc...
1159
1160 We may provide a .h include file with common definitions of that
1161 proves useful for some properties (like building PCI properties or
1162 interrupt maps) though it may be better to add a notion of struct
1163 definitions to the compiler...
1164
1165
1166 V - Recommendations for a bootloader
1167 ====================================
1168
1169
1170 Here are some various ideas/recommendations that have been proposed
1171 while all this has been defined and implemented.
1172
1173 - The bootloader may want to be able to use the device-tree itself
1174 and may want to manipulate it (to add/edit some properties,
1175 like physical memory size or kernel arguments). At this point, 2
1176 choices can be made. Either the bootloader works directly on the
1177 flattened format, or the bootloader has its own internal tree
1178 representation with pointers (similar to the kernel one) and
1179 re-flattens the tree when booting the kernel. The former is a bit
1180 more difficult to edit/modify, the later requires probably a bit
1181 more code to handle the tree structure. Note that the structure
1182 format has been designed so it's relatively easy to "insert"
1183 properties or nodes or delete them by just memmoving things
1184 around. It contains no internal offsets or pointers for this
1185 purpose.
1186
1187 - An example of code for iterating nodes & retrieving properties
1188 directly from the flattened tree format can be found in the kernel
1189 file arch/ppc64/kernel/prom.c, look at scan_flat_dt() function,
1190 its usage in early_init_devtree(), and the corresponding various
1191 early_init_dt_scan_*() callbacks. That code can be re-used in a
1192 GPL bootloader, and as the author of that code, I would be happy
1193 to discuss possible free licensing to any vendor who wishes to
1194 integrate all or part of this code into a non-GPL bootloader.
1195
1196
1197
1198 VI - System-on-a-chip devices and nodes
1199 =======================================
1200
1201 Many companies are now starting to develop system-on-a-chip
1202 processors, where the processor core (CPU) and many peripheral devices
1203 exist on a single piece of silicon. For these SOCs, an SOC node
1204 should be used that defines child nodes for the devices that make
1205 up the SOC. While platforms are not required to use this model in
1206 order to boot the kernel, it is highly encouraged that all SOC
1207 implementations define as complete a flat-device-tree as possible to
1208 describe the devices on the SOC. This will allow for the
1209 genericization of much of the kernel code.
1210
1211
1212 1) Defining child nodes of an SOC
1213 ---------------------------------
1214
1215 Each device that is part of an SOC may have its own node entry inside
1216 the SOC node. For each device that is included in the SOC, the unit
1217 address property represents the address offset for this device's
1218 memory-mapped registers in the parent's address space. The parent's
1219 address space is defined by the "ranges" property in the top-level soc
1220 node. The "reg" property for each node that exists directly under the
1221 SOC node should contain the address mapping from the child address space
1222 to the parent SOC address space and the size of the device's
1223 memory-mapped register file.
1224
1225 For many devices that may exist inside an SOC, there are predefined
1226 specifications for the format of the device tree node. All SOC child
1227 nodes should follow these specifications, except where noted in this
1228 document.
1229
1230 See appendix A for an example partial SOC node definition for the
1231 MPC8540.
1232
1233
1234 2) Representing devices without a current OF specification
1235 ----------------------------------------------------------
1236
1237 Currently, there are many devices on SOCs that do not have a standard
1238 representation pre-defined as part of the open firmware
1239 specifications, mainly because the boards that contain these SOCs are
1240 not currently booted using open firmware. This section contains
1241 descriptions for the SOC devices for which new nodes have been
1242 defined; this list will expand as more and more SOC-containing
1243 platforms are moved over to use the flattened-device-tree model.
1244
1245 a) MDIO IO device
1246
1247 The MDIO is a bus to which the PHY devices are connected. For each
1248 device that exists on this bus, a child node should be created. See
1249 the definition of the PHY node below for an example of how to define
1250 a PHY.
1251
1252 Required properties:
1253 - reg : Offset and length of the register set for the device
1254 - compatible : Should define the compatible device type for the
1255 mdio. Currently, this is most likely to be "fsl,gianfar-mdio"
1256
1257 Example:
1258
1259 mdio@24520 {
1260 reg = <24520 20>;
1261 compatible = "fsl,gianfar-mdio";
1262
1263 ethernet-phy@0 {
1264 ......
1265 };
1266 };
1267
1268
1269 b) Gianfar-compatible ethernet nodes
1270
1271 Required properties:
1272
1273 - device_type : Should be "network"
1274 - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
1275 - compatible : Should be "gianfar"
1276 - reg : Offset and length of the register set for the device
1277 - mac-address : List of bytes representing the ethernet address of
1278 this controller
1279 - interrupts : <a b> where a is the interrupt number and b is a
1280 field that represents an encoding of the sense and level
1281 information for the interrupt. This should be encoded based on
1282 the information in section 2) depending on the type of interrupt
1283 controller you have.
1284 - interrupt-parent : the phandle for the interrupt controller that
1285 services interrupts for this device.
1286 - phy-handle : The phandle for the PHY connected to this ethernet
1287 controller.
1288 - fixed-link : <a b c d e> where a is emulated phy id - choose any,
1289 but unique to the all specified fixed-links, b is duplex - 0 half,
1290 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
1291 pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
1292
1293 Recommended properties:
1294
1295 - phy-connection-type : a string naming the controller/PHY interface type,
1296 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
1297 "tbi", or "rtbi". This property is only really needed if the connection
1298 is of type "rgmii-id", as all other connection types are detected by
1299 hardware.
1300
1301
1302 Example:
1303
1304 ethernet@24000 {
1305 #size-cells = <0>;
1306 device_type = "network";
1307 model = "TSEC";
1308 compatible = "gianfar";
1309 reg = <24000 1000>;
1310 mac-address = [ 00 E0 0C 00 73 00 ];
1311 interrupts = <d 3 e 3 12 3>;
1312 interrupt-parent = <40000>;
1313 phy-handle = <2452000>
1314 };
1315
1316
1317
1318 c) PHY nodes
1319
1320 Required properties:
1321
1322 - device_type : Should be "ethernet-phy"
1323 - interrupts : <a b> where a is the interrupt number and b is a
1324 field that represents an encoding of the sense and level
1325 information for the interrupt. This should be encoded based on
1326 the information in section 2) depending on the type of interrupt
1327 controller you have.
1328 - interrupt-parent : the phandle for the interrupt controller that
1329 services interrupts for this device.
1330 - reg : The ID number for the phy, usually a small integer
1331 - linux,phandle : phandle for this node; likely referenced by an
1332 ethernet controller node.
1333
1334
1335 Example:
1336
1337 ethernet-phy@0 {
1338 linux,phandle = <2452000>
1339 interrupt-parent = <40000>;
1340 interrupts = <35 1>;
1341 reg = <0>;
1342 device_type = "ethernet-phy";
1343 };
1344
1345
1346 d) Interrupt controllers
1347
1348 Some SOC devices contain interrupt controllers that are different
1349 from the standard Open PIC specification. The SOC device nodes for
1350 these types of controllers should be specified just like a standard
1351 OpenPIC controller. Sense and level information should be encoded
1352 as specified in section 2) of this chapter for each device that
1353 specifies an interrupt.
1354
1355 Example :
1356
1357 pic@40000 {
1358 linux,phandle = <40000>;
1359 clock-frequency = <0>;
1360 interrupt-controller;
1361 #address-cells = <0>;
1362 reg = <40000 40000>;
1363 built-in;
1364 compatible = "chrp,open-pic";
1365 device_type = "open-pic";
1366 big-endian;
1367 };
1368
1369
1370 e) I2C
1371
1372 Required properties :
1373
1374 - device_type : Should be "i2c"
1375 - reg : Offset and length of the register set for the device
1376
1377 Recommended properties :
1378
1379 - compatible : Should be "fsl-i2c" for parts compatible with
1380 Freescale I2C specifications.
1381 - interrupts : <a b> where a is the interrupt number and b is a
1382 field that represents an encoding of the sense and level
1383 information for the interrupt. This should be encoded based on
1384 the information in section 2) depending on the type of interrupt
1385 controller you have.
1386 - interrupt-parent : the phandle for the interrupt controller that
1387 services interrupts for this device.
1388 - dfsrr : boolean; if defined, indicates that this I2C device has
1389 a digital filter sampling rate register
1390 - fsl5200-clocking : boolean; if defined, indicated that this device
1391 uses the FSL 5200 clocking mechanism.
1392
1393 Example :
1394
1395 i2c@3000 {
1396 interrupt-parent = <40000>;
1397 interrupts = <1b 3>;
1398 reg = <3000 18>;
1399 device_type = "i2c";
1400 compatible = "fsl-i2c";
1401 dfsrr;
1402 };
1403
1404
1405 f) Freescale SOC USB controllers
1406
1407 The device node for a USB controller that is part of a Freescale
1408 SOC is as described in the document "Open Firmware Recommended
1409 Practice : Universal Serial Bus" with the following modifications
1410 and additions :
1411
1412 Required properties :
1413 - compatible : Should be "fsl-usb2-mph" for multi port host USB
1414 controllers, or "fsl-usb2-dr" for dual role USB controllers
1415 - phy_type : For multi port host USB controllers, should be one of
1416 "ulpi", or "serial". For dual role USB controllers, should be
1417 one of "ulpi", "utmi", "utmi_wide", or "serial".
1418 - reg : Offset and length of the register set for the device
1419 - port0 : boolean; if defined, indicates port0 is connected for
1420 fsl-usb2-mph compatible controllers. Either this property or
1421 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
1422 controllers.
1423 - port1 : boolean; if defined, indicates port1 is connected for
1424 fsl-usb2-mph compatible controllers. Either this property or
1425 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
1426 controllers.
1427 - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
1428 controllers. Can be "host", "peripheral", or "otg". Default to
1429 "host" if not defined for backward compatibility.
1430
1431 Recommended properties :
1432 - interrupts : <a b> where a is the interrupt number and b is a
1433 field that represents an encoding of the sense and level
1434 information for the interrupt. This should be encoded based on
1435 the information in section 2) depending on the type of interrupt
1436 controller you have.
1437 - interrupt-parent : the phandle for the interrupt controller that
1438 services interrupts for this device.
1439
1440 Example multi port host USB controller device node :
1441 usb@22000 {
1442 compatible = "fsl-usb2-mph";
1443 reg = <22000 1000>;
1444 #address-cells = <1>;
1445 #size-cells = <0>;
1446 interrupt-parent = <700>;
1447 interrupts = <27 1>;
1448 phy_type = "ulpi";
1449 port0;
1450 port1;
1451 };
1452
1453 Example dual role USB controller device node :
1454 usb@23000 {
1455 compatible = "fsl-usb2-dr";
1456 reg = <23000 1000>;
1457 #address-cells = <1>;
1458 #size-cells = <0>;
1459 interrupt-parent = <700>;
1460 interrupts = <26 1>;
1461 dr_mode = "otg";
1462 phy = "ulpi";
1463 };
1464
1465
1466 g) Freescale SOC SEC Security Engines
1467
1468 Required properties:
1469
1470 - device_type : Should be "crypto"
1471 - model : Model of the device. Should be "SEC1" or "SEC2"
1472 - compatible : Should be "talitos"
1473 - reg : Offset and length of the register set for the device
1474 - interrupts : <a b> where a is the interrupt number and b is a
1475 field that represents an encoding of the sense and level
1476 information for the interrupt. This should be encoded based on
1477 the information in section 2) depending on the type of interrupt
1478 controller you have.
1479 - interrupt-parent : the phandle for the interrupt controller that
1480 services interrupts for this device.
1481 - num-channels : An integer representing the number of channels
1482 available.
1483 - channel-fifo-len : An integer representing the number of
1484 descriptor pointers each channel fetch fifo can hold.
1485 - exec-units-mask : The bitmask representing what execution units
1486 (EUs) are available. It's a single 32-bit cell. EU information
1487 should be encoded following the SEC's Descriptor Header Dword
1488 EU_SEL0 field documentation, i.e. as follows:
1489
1490 bit 0 = reserved - should be 0
1491 bit 1 = set if SEC has the ARC4 EU (AFEU)
1492 bit 2 = set if SEC has the DES/3DES EU (DEU)
1493 bit 3 = set if SEC has the message digest EU (MDEU)
1494 bit 4 = set if SEC has the random number generator EU (RNG)
1495 bit 5 = set if SEC has the public key EU (PKEU)
1496 bit 6 = set if SEC has the AES EU (AESU)
1497 bit 7 = set if SEC has the Kasumi EU (KEU)
1498
1499 bits 8 through 31 are reserved for future SEC EUs.
1500
1501 - descriptor-types-mask : The bitmask representing what descriptors
1502 are available. It's a single 32-bit cell. Descriptor type
1503 information should be encoded following the SEC's Descriptor
1504 Header Dword DESC_TYPE field documentation, i.e. as follows:
1505
1506 bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
1507 bit 1 = set if SEC supports the ipsec_esp descriptor type
1508 bit 2 = set if SEC supports the common_nonsnoop desc. type
1509 bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
1510 bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
1511 bit 5 = set if SEC supports the srtp descriptor type
1512 bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
1513 bit 7 = set if SEC supports the pkeu_assemble descriptor type
1514 bit 8 = set if SEC supports the aesu_key_expand_output desc.type
1515 bit 9 = set if SEC supports the pkeu_ptmul descriptor type
1516 bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
1517 bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
1518
1519 ..and so on and so forth.
1520
1521 Example:
1522
1523 /* MPC8548E */
1524 crypto@30000 {
1525 device_type = "crypto";
1526 model = "SEC2";
1527 compatible = "talitos";
1528 reg = <30000 10000>;
1529 interrupts = <1d 3>;
1530 interrupt-parent = <40000>;
1531 num-channels = <4>;
1532 channel-fifo-len = <18>;
1533 exec-units-mask = <000000fe>;
1534 descriptor-types-mask = <012b0ebf>;
1535 };
1536
1537 h) Board Control and Status (BCSR)
1538
1539 Required properties:
1540
1541 - device_type : Should be "board-control"
1542 - reg : Offset and length of the register set for the device
1543
1544 Example:
1545
1546 bcsr@f8000000 {
1547 device_type = "board-control";
1548 reg = <f8000000 8000>;
1549 };
1550
1551 i) Freescale QUICC Engine module (QE)
1552 This represents qe module that is installed on PowerQUICC II Pro.
1553
1554 NOTE: This is an interim binding; it should be updated to fit
1555 in with the CPM binding later in this document.
1556
1557 Basically, it is a bus of devices, that could act more or less
1558 as a complete entity (UCC, USB etc ). All of them should be siblings on
1559 the "root" qe node, using the common properties from there.
1560 The description below applies to the qe of MPC8360 and
1561 more nodes and properties would be extended in the future.
1562
1563 i) Root QE device
1564
1565 Required properties:
1566 - compatible : should be "fsl,qe";
1567 - model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
1568 - reg : offset and length of the device registers.
1569 - bus-frequency : the clock frequency for QUICC Engine.
1570
1571 Recommended properties
1572 - brg-frequency : the internal clock source frequency for baud-rate
1573 generators in Hz.
1574
1575 Example:
1576 qe@e0100000 {
1577 #address-cells = <1>;
1578 #size-cells = <1>;
1579 #interrupt-cells = <2>;
1580 compatible = "fsl,qe";
1581 ranges = <0 e0100000 00100000>;
1582 reg = <e0100000 480>;
1583 brg-frequency = <0>;
1584 bus-frequency = <179A7B00>;
1585 }
1586
1587
1588 ii) SPI (Serial Peripheral Interface)
1589
1590 Required properties:
1591 - cell-index : SPI controller index.
1592 - compatible : should be "fsl,spi".
1593 - mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
1594 - reg : Offset and length of the register set for the device
1595 - interrupts : <a b> where a is the interrupt number and b is a
1596 field that represents an encoding of the sense and level
1597 information for the interrupt. This should be encoded based on
1598 the information in section 2) depending on the type of interrupt
1599 controller you have.
1600 - interrupt-parent : the phandle for the interrupt controller that
1601 services interrupts for this device.
1602
1603 Example:
1604 spi@4c0 {
1605 cell-index = <0>;
1606 compatible = "fsl,spi";
1607 reg = <4c0 40>;
1608 interrupts = <82 0>;
1609 interrupt-parent = <700>;
1610 mode = "cpu";
1611 };
1612
1613
1614 iii) USB (Universal Serial Bus Controller)
1615
1616 Required properties:
1617 - compatible : could be "qe_udc" or "fhci-hcd".
1618 - mode : the could be "host" or "slave".
1619 - reg : Offset and length of the register set for the device
1620 - interrupts : <a b> where a is the interrupt number and b is a
1621 field that represents an encoding of the sense and level
1622 information for the interrupt. This should be encoded based on
1623 the information in section 2) depending on the type of interrupt
1624 controller you have.
1625 - interrupt-parent : the phandle for the interrupt controller that
1626 services interrupts for this device.
1627
1628 Example(slave):
1629 usb@6c0 {
1630 compatible = "qe_udc";
1631 reg = <6c0 40>;
1632 interrupts = <8b 0>;
1633 interrupt-parent = <700>;
1634 mode = "slave";
1635 };
1636
1637
1638 iv) UCC (Unified Communications Controllers)
1639
1640 Required properties:
1641 - device_type : should be "network", "hldc", "uart", "transparent"
1642 "bisync", "atm", or "serial".
1643 - compatible : could be "ucc_geth" or "fsl_atm" and so on.
1644 - model : should be "UCC".
1645 - device-id : the ucc number(1-8), corresponding to UCCx in UM.
1646 - reg : Offset and length of the register set for the device
1647 - interrupts : <a b> where a is the interrupt number and b is a
1648 field that represents an encoding of the sense and level
1649 information for the interrupt. This should be encoded based on
1650 the information in section 2) depending on the type of interrupt
1651 controller you have.
1652 - interrupt-parent : the phandle for the interrupt controller that
1653 services interrupts for this device.
1654 - pio-handle : The phandle for the Parallel I/O port configuration.
1655 - port-number : for UART drivers, the port number to use, between 0 and 3.
1656 This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
1657 The port number is added to the minor number of the device. Unlike the
1658 CPM UART driver, the port-number is required for the QE UART driver.
1659 - soft-uart : for UART drivers, if specified this means the QE UART device
1660 driver should use "Soft-UART" mode, which is needed on some SOCs that have
1661 broken UART hardware. Soft-UART is provided via a microcode upload.
1662 - rx-clock-name: the UCC receive clock source
1663 "none": clock source is disabled
1664 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
1665 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
1666 - tx-clock-name: the UCC transmit clock source
1667 "none": clock source is disabled
1668 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
1669 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
1670 The following two properties are deprecated. rx-clock has been replaced
1671 with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
1672 Drivers that currently use the deprecated properties should continue to
1673 do so, in order to support older device trees, but they should be updated
1674 to check for the new properties first.
1675 - rx-clock : represents the UCC receive clock source.
1676 0x00 : clock source is disabled;
1677 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1678 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1679 - tx-clock: represents the UCC transmit clock source;
1680 0x00 : clock source is disabled;
1681 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1682 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1683
1684 Required properties for network device_type:
1685 - mac-address : list of bytes representing the ethernet address.
1686 - phy-handle : The phandle for the PHY connected to this controller.
1687
1688 Recommended properties:
1689 - phy-connection-type : a string naming the controller/PHY interface type,
1690 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
1691 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
1692 "tbi", or "rtbi".
1693
1694 Example:
1695 ucc@2000 {
1696 device_type = "network";
1697 compatible = "ucc_geth";
1698 model = "UCC";
1699 device-id = <1>;
1700 reg = <2000 200>;
1701 interrupts = <a0 0>;
1702 interrupt-parent = <700>;
1703 mac-address = [ 00 04 9f 00 23 23 ];
1704 rx-clock = "none";
1705 tx-clock = "clk9";
1706 phy-handle = <212000>;
1707 phy-connection-type = "gmii";
1708 pio-handle = <140001>;
1709 };
1710
1711
1712 v) Parallel I/O Ports
1713
1714 This node configures Parallel I/O ports for CPUs with QE support.
1715 The node should reside in the "soc" node of the tree. For each
1716 device that using parallel I/O ports, a child node should be created.
1717 See the definition of the Pin configuration nodes below for more
1718 information.
1719
1720 Required properties:
1721 - device_type : should be "par_io".
1722 - reg : offset to the register set and its length.
1723 - num-ports : number of Parallel I/O ports
1724
1725 Example:
1726 par_io@1400 {
1727 reg = <1400 100>;
1728 #address-cells = <1>;
1729 #size-cells = <0>;
1730 device_type = "par_io";
1731 num-ports = <7>;
1732 ucc_pin@01 {
1733 ......
1734 };
1735
1736
1737 vi) Pin configuration nodes
1738
1739 Required properties:
1740 - linux,phandle : phandle of this node; likely referenced by a QE
1741 device.
1742 - pio-map : array of pin configurations. Each pin is defined by 6
1743 integers. The six numbers are respectively: port, pin, dir,
1744 open_drain, assignment, has_irq.
1745 - port : port number of the pin; 0-6 represent port A-G in UM.
1746 - pin : pin number in the port.
1747 - dir : direction of the pin, should encode as follows:
1748
1749 0 = The pin is disabled
1750 1 = The pin is an output
1751 2 = The pin is an input
1752 3 = The pin is I/O
1753
1754 - open_drain : indicates the pin is normal or wired-OR:
1755
1756 0 = The pin is actively driven as an output
1757 1 = The pin is an open-drain driver. As an output, the pin is
1758 driven active-low, otherwise it is three-stated.
1759
1760 - assignment : function number of the pin according to the Pin Assignment
1761 tables in User Manual. Each pin can have up to 4 possible functions in
1762 QE and two options for CPM.
1763 - has_irq : indicates if the pin is used as source of external
1764 interrupts.
1765
1766 Example:
1767 ucc_pin@01 {
1768 linux,phandle = <140001>;
1769 pio-map = <
1770 /* port pin dir open_drain assignment has_irq */
1771 0 3 1 0 1 0 /* TxD0 */
1772 0 4 1 0 1 0 /* TxD1 */
1773 0 5 1 0 1 0 /* TxD2 */
1774 0 6 1 0 1 0 /* TxD3 */
1775 1 6 1 0 3 0 /* TxD4 */
1776 1 7 1 0 1 0 /* TxD5 */
1777 1 9 1 0 2 0 /* TxD6 */
1778 1 a 1 0 2 0 /* TxD7 */
1779 0 9 2 0 1 0 /* RxD0 */
1780 0 a 2 0 1 0 /* RxD1 */
1781 0 b 2 0 1 0 /* RxD2 */
1782 0 c 2 0 1 0 /* RxD3 */
1783 0 d 2 0 1 0 /* RxD4 */
1784 1 1 2 0 2 0 /* RxD5 */
1785 1 0 2 0 2 0 /* RxD6 */
1786 1 4 2 0 2 0 /* RxD7 */
1787 0 7 1 0 1 0 /* TX_EN */
1788 0 8 1 0 1 0 /* TX_ER */
1789 0 f 2 0 1 0 /* RX_DV */
1790 0 10 2 0 1 0 /* RX_ER */
1791 0 0 2 0 1 0 /* RX_CLK */
1792 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
1793 2 8 2 0 1 0>; /* GTX125 - CLK9 */
1794 };
1795
1796 vii) Multi-User RAM (MURAM)
1797
1798 Required properties:
1799 - compatible : should be "fsl,qe-muram", "fsl,cpm-muram".
1800 - mode : the could be "host" or "slave".
1801 - ranges : Should be defined as specified in 1) to describe the
1802 translation of MURAM addresses.
1803 - data-only : sub-node which defines the address area under MURAM
1804 bus that can be allocated as data/parameter
1805
1806 Example:
1807
1808 muram@10000 {
1809 compatible = "fsl,qe-muram", "fsl,cpm-muram";
1810 ranges = <0 00010000 0000c000>;
1811
1812 data-only@0{
1813 compatible = "fsl,qe-muram-data",
1814 "fsl,cpm-muram-data";
1815 reg = <0 c000>;
1816 };
1817 };
1818
1819 viii) Uploaded QE firmware
1820
1821 If a new firwmare has been uploaded to the QE (usually by the
1822 boot loader), then a 'firmware' child node should be added to the QE
1823 node. This node provides information on the uploaded firmware that
1824 device drivers may need.
1825
1826 Required properties:
1827 - id: The string name of the firmware. This is taken from the 'id'
1828 member of the qe_firmware structure of the uploaded firmware.
1829 Device drivers can search this string to determine if the
1830 firmware they want is already present.
1831 - extended-modes: The Extended Modes bitfield, taken from the
1832 firmware binary. It is a 64-bit number represented
1833 as an array of two 32-bit numbers.
1834 - virtual-traps: The virtual traps, taken from the firmware binary.
1835 It is an array of 8 32-bit numbers.
1836
1837 Example:
1838
1839 firmware {
1840 id = "Soft-UART";
1841 extended-modes = <0 0>;
1842 virtual-traps = <0 0 0 0 0 0 0 0>;
1843 }
1844
1845 j) CFI or JEDEC memory-mapped NOR flash
1846
1847 Flash chips (Memory Technology Devices) are often used for solid state
1848 file systems on embedded devices.
1849
1850 - compatible : should contain the specific model of flash chip(s)
1851 used, if known, followed by either "cfi-flash" or "jedec-flash"
1852 - reg : Address range of the flash chip
1853 - bank-width : Width (in bytes) of the flash bank. Equal to the
1854 device width times the number of interleaved chips.
1855 - device-width : (optional) Width of a single flash chip. If
1856 omitted, assumed to be equal to 'bank-width'.
1857 - #address-cells, #size-cells : Must be present if the flash has
1858 sub-nodes representing partitions (see below). In this case
1859 both #address-cells and #size-cells must be equal to 1.
1860
1861 For JEDEC compatible devices, the following additional properties
1862 are defined:
1863
1864 - vendor-id : Contains the flash chip's vendor id (1 byte).
1865 - device-id : Contains the flash chip's device id (1 byte).
1866
1867 In addition to the information on the flash bank itself, the
1868 device tree may optionally contain additional information
1869 describing partitions of the flash address space. This can be
1870 used on platforms which have strong conventions about which
1871 portions of the flash are used for what purposes, but which don't
1872 use an on-flash partition table such as RedBoot.
1873
1874 Each partition is represented as a sub-node of the flash device.
1875 Each node's name represents the name of the corresponding
1876 partition of the flash device.
1877
1878 Flash partitions
1879 - reg : The partition's offset and size within the flash bank.
1880 - label : (optional) The label / name for this flash partition.
1881 If omitted, the label is taken from the node name (excluding
1882 the unit address).
1883 - read-only : (optional) This parameter, if present, is a hint to
1884 Linux that this flash partition should only be mounted
1885 read-only. This is usually used for flash partitions
1886 containing early-boot firmware images or data which should not
1887 be clobbered.
1888
1889 Example:
1890
1891 flash@ff000000 {
1892 compatible = "amd,am29lv128ml", "cfi-flash";
1893 reg = <ff000000 01000000>;
1894 bank-width = <4>;
1895 device-width = <1>;
1896 #address-cells = <1>;
1897 #size-cells = <1>;
1898 fs@0 {
1899 label = "fs";
1900 reg = <0 f80000>;
1901 };
1902 firmware@f80000 {
1903 label ="firmware";
1904 reg = <f80000 80000>;
1905 read-only;
1906 };
1907 };
1908
1909 k) Global Utilities Block
1910
1911 The global utilities block controls power management, I/O device
1912 enabling, power-on-reset configuration monitoring, general-purpose
1913 I/O signal configuration, alternate function selection for multiplexed
1914 signals, and clock control.
1915
1916 Required properties:
1917
1918 - compatible : Should define the compatible device type for
1919 global-utilities.
1920 - reg : Offset and length of the register set for the device.
1921
1922 Recommended properties:
1923
1924 - fsl,has-rstcr : Indicates that the global utilities register set
1925 contains a functioning "reset control register" (i.e. the board
1926 is wired to reset upon setting the HRESET_REQ bit in this register).
1927
1928 Example:
1929
1930 global-utilities@e0000 { /* global utilities block */
1931 compatible = "fsl,mpc8548-guts";
1932 reg = <e0000 1000>;
1933 fsl,has-rstcr;
1934 };
1935
1936 l) Freescale Communications Processor Module
1937
1938 NOTE: This is an interim binding, and will likely change slightly,
1939 as more devices are supported. The QE bindings especially are
1940 incomplete.
1941
1942 i) Root CPM node
1943
1944 Properties:
1945 - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
1946 - reg : A 48-byte region beginning with CPCR.
1947
1948 Example:
1949 cpm@119c0 {
1950 #address-cells = <1>;
1951 #size-cells = <1>;
1952 #interrupt-cells = <2>;
1953 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
1954 reg = <119c0 30>;
1955 }
1956
1957 ii) Properties common to mulitple CPM/QE devices
1958
1959 - fsl,cpm-command : This value is ORed with the opcode and command flag
1960 to specify the device on which a CPM command operates.
1961
1962 - fsl,cpm-brg : Indicates which baud rate generator the device
1963 is associated with. If absent, an unused BRG
1964 should be dynamically allocated. If zero, the
1965 device uses an external clock rather than a BRG.
1966
1967 - reg : Unless otherwise specified, the first resource represents the
1968 scc/fcc/ucc registers, and the second represents the device's
1969 parameter RAM region (if it has one).
1970
1971 iii) Serial
1972
1973 Currently defined compatibles:
1974 - fsl,cpm1-smc-uart
1975 - fsl,cpm2-smc-uart
1976 - fsl,cpm1-scc-uart
1977 - fsl,cpm2-scc-uart
1978 - fsl,qe-uart
1979
1980 Example:
1981
1982 serial@11a00 {
1983 device_type = "serial";
1984 compatible = "fsl,mpc8272-scc-uart",
1985 "fsl,cpm2-scc-uart";
1986 reg = <11a00 20 8000 100>;
1987 interrupts = <28 8>;
1988 interrupt-parent = <&PIC>;
1989 fsl,cpm-brg = <1>;
1990 fsl,cpm-command = <00800000>;
1991 };
1992
1993 iii) Network
1994
1995 Currently defined compatibles:
1996 - fsl,cpm1-scc-enet
1997 - fsl,cpm2-scc-enet
1998 - fsl,cpm1-fec-enet
1999 - fsl,cpm2-fcc-enet (third resource is GFEMR)
2000 - fsl,qe-enet
2001
2002 Example:
2003
2004 ethernet@11300 {
2005 device_type = "network";
2006 compatible = "fsl,mpc8272-fcc-enet",
2007 "fsl,cpm2-fcc-enet";
2008 reg = <11300 20 8400 100 11390 1>;
2009 local-mac-address = [ 00 00 00 00 00 00 ];
2010 interrupts = <20 8>;
2011 interrupt-parent = <&PIC>;
2012 phy-handle = <&PHY0>;
2013 fsl,cpm-command = <12000300>;
2014 };
2015
2016 iv) MDIO
2017
2018 Currently defined compatibles:
2019 fsl,pq1-fec-mdio (reg is same as first resource of FEC device)
2020 fsl,cpm2-mdio-bitbang (reg is port C registers)
2021
2022 Properties for fsl,cpm2-mdio-bitbang:
2023 fsl,mdio-pin : pin of port C controlling mdio data
2024 fsl,mdc-pin : pin of port C controlling mdio clock
2025
2026 Example:
2027
2028 mdio@10d40 {
2029 device_type = "mdio";
2030 compatible = "fsl,mpc8272ads-mdio-bitbang",
2031 "fsl,mpc8272-mdio-bitbang",
2032 "fsl,cpm2-mdio-bitbang";
2033 reg = <10d40 14>;
2034 #address-cells = <1>;
2035 #size-cells = <0>;
2036 fsl,mdio-pin = <12>;
2037 fsl,mdc-pin = <13>;
2038 };
2039
2040 v) Baud Rate Generators
2041
2042 Currently defined compatibles:
2043 fsl,cpm-brg
2044 fsl,cpm1-brg
2045 fsl,cpm2-brg
2046
2047 Properties:
2048 - reg : There may be an arbitrary number of reg resources; BRG
2049 numbers are assigned to these in order.
2050 - clock-frequency : Specifies the base frequency driving
2051 the BRG.
2052
2053 Example:
2054
2055 brg@119f0 {
2056 compatible = "fsl,mpc8272-brg",
2057 "fsl,cpm2-brg",
2058 "fsl,cpm-brg";
2059 reg = <119f0 10 115f0 10>;
2060 clock-frequency = <d#25000000>;
2061 };
2062
2063 vi) Interrupt Controllers
2064
2065 Currently defined compatibles:
2066 - fsl,cpm1-pic
2067 - only one interrupt cell
2068 - fsl,pq1-pic
2069 - fsl,cpm2-pic
2070 - second interrupt cell is level/sense:
2071 - 2 is falling edge
2072 - 8 is active low
2073
2074 Example:
2075
2076 interrupt-controller@10c00 {
2077 #interrupt-cells = <2>;
2078 interrupt-controller;
2079 reg = <10c00 80>;
2080 compatible = "mpc8272-pic", "fsl,cpm2-pic";
2081 };
2082
2083 vii) USB (Universal Serial Bus Controller)
2084
2085 Properties:
2086 - compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb"
2087
2088 Example:
2089 usb@11bc0 {
2090 #address-cells = <1>;
2091 #size-cells = <0>;
2092 compatible = "fsl,cpm2-usb";
2093 reg = <11b60 18 8b00 100>;
2094 interrupts = <b 8>;
2095 interrupt-parent = <&PIC>;
2096 fsl,cpm-command = <2e600000>;
2097 };
2098
2099 viii) Multi-User RAM (MURAM)
2100
2101 The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
2102
2103 Ranges must be set up subject to the following restrictions:
2104
2105 - Children's reg nodes must be offsets from the start of all muram, even
2106 if the user-data area does not begin at zero.
2107 - If multiple range entries are used, the difference between the parent
2108 address and the child address must be the same in all, so that a single
2109 mapping can cover them all while maintaining the ability to determine
2110 CPM-side offsets with pointer subtraction. It is recommended that
2111 multiple range entries not be used.
2112 - A child address of zero must be translatable, even if no reg resources
2113 contain it.
2114
2115 A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
2116 indicate the portion of muram that is usable by the OS for arbitrary
2117 purposes. The data node may have an arbitrary number of reg resources,
2118 all of which contribute to the allocatable muram pool.
2119
2120 Example, based on mpc8272:
2121
2122 muram@0 {
2123 #address-cells = <1>;
2124 #size-cells = <1>;
2125 ranges = <0 0 10000>;
2126
2127 data@0 {
2128 compatible = "fsl,cpm-muram-data";
2129 reg = <0 2000 9800 800>;
2130 };
2131 };
2132
2133 m) Chipselect/Local Bus
2134
2135 Properties:
2136 - name : Should be localbus
2137 - #address-cells : Should be either two or three. The first cell is the
2138 chipselect number, and the remaining cells are the
2139 offset into the chipselect.
2140 - #size-cells : Either one or two, depending on how large each chipselect
2141 can be.
2142 - ranges : Each range corresponds to a single chipselect, and cover
2143 the entire access window as configured.
2144
2145 Example:
2146 localbus@f0010100 {
2147 compatible = "fsl,mpc8272-localbus",
2148 "fsl,pq2-localbus";
2149 #address-cells = <2>;
2150 #size-cells = <1>;
2151 reg = <f0010100 40>;
2152
2153 ranges = <0 0 fe000000 02000000
2154 1 0 f4500000 00008000>;
2155
2156 flash@0,0 {
2157 compatible = "jedec-flash";
2158 reg = <0 0 2000000>;
2159 bank-width = <4>;
2160 device-width = <1>;
2161 };
2162
2163 board-control@1,0 {
2164 reg = <1 0 20>;
2165 compatible = "fsl,mpc8272ads-bcsr";
2166 };
2167 };
2168
2169
2170 n) 4xx/Axon EMAC ethernet nodes
2171
2172 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
2173 the Axon bridge. To operate this needs to interact with a ths
2174 special McMAL DMA controller, and sometimes an RGMII or ZMII
2175 interface. In addition to the nodes and properties described
2176 below, the node for the OPB bus on which the EMAC sits must have a
2177 correct clock-frequency property.
2178
2179 i) The EMAC node itself
2180
2181 Required properties:
2182 - device_type : "network"
2183
2184 - compatible : compatible list, contains 2 entries, first is
2185 "ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
2186 405gp, Axon) and second is either "ibm,emac" or
2187 "ibm,emac4". For Axon, thus, we have: "ibm,emac-axon",
2188 "ibm,emac4"
2189 - interrupts : <interrupt mapping for EMAC IRQ and WOL IRQ>
2190 - interrupt-parent : optional, if needed for interrupt mapping
2191 - reg : <registers mapping>
2192 - local-mac-address : 6 bytes, MAC address
2193 - mal-device : phandle of the associated McMAL node
2194 - mal-tx-channel : 1 cell, index of the tx channel on McMAL associated
2195 with this EMAC
2196 - mal-rx-channel : 1 cell, index of the rx channel on McMAL associated
2197 with this EMAC
2198 - cell-index : 1 cell, hardware index of the EMAC cell on a given
2199 ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
2200 each Axon chip)
2201 - max-frame-size : 1 cell, maximum frame size supported in bytes
2202 - rx-fifo-size : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
2203 operations.
2204 For Axon, 2048
2205 - tx-fifo-size : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
2206 operations.
2207 For Axon, 2048.
2208 - fifo-entry-size : 1 cell, size of a fifo entry (used to calculate
2209 thresholds).
2210 For Axon, 0x00000010
2211 - mal-burst-size : 1 cell, MAL burst size (used to calculate thresholds)
2212 in bytes.
2213 For Axon, 0x00000100 (I think ...)
2214 - phy-mode : string, mode of operations of the PHY interface.
2215 Supported values are: "mii", "rmii", "smii", "rgmii",
2216 "tbi", "gmii", rtbi", "sgmii".
2217 For Axon on CAB, it is "rgmii"
2218 - mdio-device : 1 cell, required iff using shared MDIO registers
2219 (440EP). phandle of the EMAC to use to drive the
2220 MDIO lines for the PHY used by this EMAC.
2221 - zmii-device : 1 cell, required iff connected to a ZMII. phandle of
2222 the ZMII device node
2223 - zmii-channel : 1 cell, required iff connected to a ZMII. Which ZMII
2224 channel or 0xffffffff if ZMII is only used for MDIO.
2225 - rgmii-device : 1 cell, required iff connected to an RGMII. phandle
2226 of the RGMII device node.
2227 For Axon: phandle of plb5/plb4/opb/rgmii
2228 - rgmii-channel : 1 cell, required iff connected to an RGMII. Which
2229 RGMII channel is used by this EMAC.
2230 Fox Axon: present, whatever value is appropriate for each
2231 EMAC, that is the content of the current (bogus) "phy-port"
2232 property.
2233
2234 Optional properties:
2235 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
2236 a search is performed.
2237 - phy-map : 1 cell, optional, bitmap of addresses to probe the PHY
2238 for, used if phy-address is absent. bit 0x00000001 is
2239 MDIO address 0.
2240 For Axon it can be absent, thouugh my current driver
2241 doesn't handle phy-address yet so for now, keep
2242 0x00ffffff in it.
2243 - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
2244 operations (if absent the value is the same as
2245 rx-fifo-size). For Axon, either absent or 2048.
2246 - tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
2247 operations (if absent the value is the same as
2248 tx-fifo-size). For Axon, either absent or 2048.
2249 - tah-device : 1 cell, optional. If connected to a TAH engine for
2250 offload, phandle of the TAH device node.
2251 - tah-channel : 1 cell, optional. If appropriate, channel used on the
2252 TAH engine.
2253
2254 Example:
2255
2256 EMAC0: ethernet@40000800 {
2257 device_type = "network";
2258 compatible = "ibm,emac-440gp", "ibm,emac";
2259 interrupt-parent = <&UIC1>;
2260 interrupts = <1c 4 1d 4>;
2261 reg = <40000800 70>;
2262 local-mac-address = [00 04 AC E3 1B 1E];
2263 mal-device = <&MAL0>;
2264 mal-tx-channel = <0 1>;
2265 mal-rx-channel = <0>;
2266 cell-index = <0>;
2267 max-frame-size = <5dc>;
2268 rx-fifo-size = <1000>;
2269 tx-fifo-size = <800>;
2270 phy-mode = "rmii";
2271 phy-map = <00000001>;
2272 zmii-device = <&ZMII0>;
2273 zmii-channel = <0>;
2274 };
2275
2276 ii) McMAL node
2277
2278 Required properties:
2279 - device_type : "dma-controller"
2280 - compatible : compatible list, containing 2 entries, first is
2281 "ibm,mcmal-CHIP" where CHIP is the host ASIC (like
2282 emac) and the second is either "ibm,mcmal" or
2283 "ibm,mcmal2".
2284 For Axon, "ibm,mcmal-axon","ibm,mcmal2"
2285 - interrupts : <interrupt mapping for the MAL interrupts sources:
2286 5 sources: tx_eob, rx_eob, serr, txde, rxde>.
2287 For Axon: This is _different_ from the current
2288 firmware. We use the "delayed" interrupts for txeob
2289 and rxeob. Thus we end up with mapping those 5 MPIC
2290 interrupts, all level positive sensitive: 10, 11, 32,
2291 33, 34 (in decimal)
2292 - dcr-reg : < DCR registers range >
2293 - dcr-parent : if needed for dcr-reg
2294 - num-tx-chans : 1 cell, number of Tx channels
2295 - num-rx-chans : 1 cell, number of Rx channels
2296
2297 iii) ZMII node
2298
2299 Required properties:
2300 - compatible : compatible list, containing 2 entries, first is
2301 "ibm,zmii-CHIP" where CHIP is the host ASIC (like
2302 EMAC) and the second is "ibm,zmii".
2303 For Axon, there is no ZMII node.
2304 - reg : <registers mapping>
2305
2306 iv) RGMII node
2307
2308 Required properties:
2309 - compatible : compatible list, containing 2 entries, first is
2310 "ibm,rgmii-CHIP" where CHIP is the host ASIC (like
2311 EMAC) and the second is "ibm,rgmii".
2312 For Axon, "ibm,rgmii-axon","ibm,rgmii"
2313 - reg : <registers mapping>
2314 - revision : as provided by the RGMII new version register if
2315 available.
2316 For Axon: 0x0000012a
2317
2318 o) Xilinx IP cores
2319
2320 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
2321 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range
2322 of standard device types (network, serial, etc.) and miscellanious
2323 devices (gpio, LCD, spi, etc). Also, since these devices are
2324 implemented within the fpga fabric every instance of the device can be
2325 synthesised with different options that change the behaviour.
2326
2327 Each IP-core has a set of parameters which the FPGA designer can use to
2328 control how the core is synthesized. Historically, the EDK tool would
2329 extract the device parameters relevant to device drivers and copy them
2330 into an 'xparameters.h' in the form of #define symbols. This tells the
2331 device drivers how the IP cores are configured, but it requres the kernel
2332 to be recompiled every time the FPGA bitstream is resynthesized.
2333
2334 The new approach is to export the parameters into the device tree and
2335 generate a new device tree each time the FPGA bitstream changes. The
2336 parameters which used to be exported as #defines will now become
2337 properties of the device node. In general, device nodes for IP-cores
2338 will take the following form:
2339
2340 (name): (generic-name)@(base-address) {
2341 compatible = "xlnx,(ip-core-name)-(HW_VER)"
2342 [, (list of compatible devices), ...];
2343 reg = <(baseaddr) (size)>;
2344 interrupt-parent = <&interrupt-controller-phandle>;
2345 interrupts = < ... >;
2346 xlnx,(parameter1) = "(string-value)";
2347 xlnx,(parameter2) = <(int-value)>;
2348 };
2349
2350 (generic-name): an open firmware-style name that describes the
2351 generic class of device. Preferably, this is one word, such
2352 as 'serial' or 'ethernet'.
2353 (ip-core-name): the name of the ip block (given after the BEGIN
2354 directive in system.mhs). Should be in lowercase
2355 and all underscores '_' converted to dashes '-'.
2356 (name): is derived from the "PARAMETER INSTANCE" value.
2357 (parameter#): C_* parameters from system.mhs. The C_ prefix is
2358 dropped from the parameter name, the name is converted
2359 to lowercase and all underscore '_' characters are
2360 converted to dashes '-'.
2361 (baseaddr): the baseaddr parameter value (often named C_BASEADDR).
2362 (HW_VER): from the HW_VER parameter.
2363 (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1).
2364
2365 Typically, the compatible list will include the exact IP core version
2366 followed by an older IP core version which implements the same
2367 interface or any other device with the same interface.
2368
2369 'reg', 'interrupt-parent' and 'interrupts' are all optional properties.
2370
2371 For example, the following block from system.mhs:
2372
2373 BEGIN opb_uartlite
2374 PARAMETER INSTANCE = opb_uartlite_0
2375 PARAMETER HW_VER = 1.00.b
2376 PARAMETER C_BAUDRATE = 115200
2377 PARAMETER C_DATA_BITS = 8
2378 PARAMETER C_ODD_PARITY = 0
2379 PARAMETER C_USE_PARITY = 0
2380 PARAMETER C_CLK_FREQ = 50000000
2381 PARAMETER C_BASEADDR = 0xEC100000
2382 PARAMETER C_HIGHADDR = 0xEC10FFFF
2383 BUS_INTERFACE SOPB = opb_7
2384 PORT OPB_Clk = CLK_50MHz
2385 PORT Interrupt = opb_uartlite_0_Interrupt
2386 PORT RX = opb_uartlite_0_RX
2387 PORT TX = opb_uartlite_0_TX
2388 PORT OPB_Rst = sys_bus_reset_0
2389 END
2390
2391 becomes the following device tree node:
2392
2393 opb_uartlite_0: serial@ec100000 {
2394 device_type = "serial";
2395 compatible = "xlnx,opb-uartlite-1.00.b";
2396 reg = <ec100000 10000>;
2397 interrupt-parent = <&opb_intc_0>;
2398 interrupts = <1 0>; // got this from the opb_intc parameters
2399 current-speed = <d#115200>; // standard serial device prop
2400 clock-frequency = <d#50000000>; // standard serial device prop
2401 xlnx,data-bits = <8>;
2402 xlnx,odd-parity = <0>;
2403 xlnx,use-parity = <0>;
2404 };
2405
2406 Some IP cores actually implement 2 or more logical devices. In
2407 this case, the device should still describe the whole IP core with
2408 a single node and add a child node for each logical device. The
2409 ranges property can be used to translate from parent IP-core to the
2410 registers of each device. In addition, the parent node should be
2411 compatible with the bus type 'xlnx,compound', and should contain
2412 #address-cells and #size-cells, as with any other bus. (Note: this
2413 makes the assumption that both logical devices have the same bus
2414 binding. If this is not true, then separate nodes should be used
2415 for each logical device). The 'cell-index' property can be used to
2416 enumerate logical devices within an IP core. For example, the
2417 following is the system.mhs entry for the dual ps2 controller found
2418 on the ml403 reference design.
2419
2420 BEGIN opb_ps2_dual_ref
2421 PARAMETER INSTANCE = opb_ps2_dual_ref_0
2422 PARAMETER HW_VER = 1.00.a
2423 PARAMETER C_BASEADDR = 0xA9000000
2424 PARAMETER C_HIGHADDR = 0xA9001FFF
2425 BUS_INTERFACE SOPB = opb_v20_0
2426 PORT Sys_Intr1 = ps2_1_intr
2427 PORT Sys_Intr2 = ps2_2_intr
2428 PORT Clkin1 = ps2_clk_rx_1
2429 PORT Clkin2 = ps2_clk_rx_2
2430 PORT Clkpd1 = ps2_clk_tx_1
2431 PORT Clkpd2 = ps2_clk_tx_2
2432 PORT Rx1 = ps2_d_rx_1
2433 PORT Rx2 = ps2_d_rx_2
2434 PORT Txpd1 = ps2_d_tx_1
2435 PORT Txpd2 = ps2_d_tx_2
2436 END
2437
2438 It would result in the following device tree nodes:
2439
2440 opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
2441 #address-cells = <1>;
2442 #size-cells = <1>;
2443 compatible = "xlnx,compound";
2444 ranges = <0 a9000000 2000>;
2445 // If this device had extra parameters, then they would
2446 // go here.
2447 ps2@0 {
2448 compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
2449 reg = <0 40>;
2450 interrupt-parent = <&opb_intc_0>;
2451 interrupts = <3 0>;
2452 cell-index = <0>;
2453 };
2454 ps2@1000 {
2455 compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
2456 reg = <1000 40>;
2457 interrupt-parent = <&opb_intc_0>;
2458 interrupts = <3 0>;
2459 cell-index = <0>;
2460 };
2461 };
2462
2463 Also, the system.mhs file defines bus attachments from the processor
2464 to the devices. The device tree structure should reflect the bus
2465 attachments. Again an example; this system.mhs fragment:
2466
2467 BEGIN ppc405_virtex4
2468 PARAMETER INSTANCE = ppc405_0
2469 PARAMETER HW_VER = 1.01.a
2470 BUS_INTERFACE DPLB = plb_v34_0
2471 BUS_INTERFACE IPLB = plb_v34_0
2472 END
2473
2474 BEGIN opb_intc
2475 PARAMETER INSTANCE = opb_intc_0
2476 PARAMETER HW_VER = 1.00.c
2477 PARAMETER C_BASEADDR = 0xD1000FC0
2478 PARAMETER C_HIGHADDR = 0xD1000FDF
2479 BUS_INTERFACE SOPB = opb_v20_0
2480 END
2481
2482 BEGIN opb_uart16550
2483 PARAMETER INSTANCE = opb_uart16550_0
2484 PARAMETER HW_VER = 1.00.d
2485 PARAMETER C_BASEADDR = 0xa0000000
2486 PARAMETER C_HIGHADDR = 0xa0001FFF
2487 BUS_INTERFACE SOPB = opb_v20_0
2488 END
2489
2490 BEGIN plb_v34
2491 PARAMETER INSTANCE = plb_v34_0
2492 PARAMETER HW_VER = 1.02.a
2493 END
2494
2495 BEGIN plb_bram_if_cntlr
2496 PARAMETER INSTANCE = plb_bram_if_cntlr_0
2497 PARAMETER HW_VER = 1.00.b
2498 PARAMETER C_BASEADDR = 0xFFFF0000
2499 PARAMETER C_HIGHADDR = 0xFFFFFFFF
2500 BUS_INTERFACE SPLB = plb_v34_0
2501 END
2502
2503 BEGIN plb2opb_bridge
2504 PARAMETER INSTANCE = plb2opb_bridge_0
2505 PARAMETER HW_VER = 1.01.a
2506 PARAMETER C_RNG0_BASEADDR = 0x20000000
2507 PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
2508 PARAMETER C_RNG1_BASEADDR = 0x60000000
2509 PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
2510 PARAMETER C_RNG2_BASEADDR = 0x80000000
2511 PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
2512 PARAMETER C_RNG3_BASEADDR = 0xC0000000
2513 PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
2514 BUS_INTERFACE SPLB = plb_v34_0
2515 BUS_INTERFACE MOPB = opb_v20_0
2516 END
2517
2518 Gives this device tree (some properties removed for clarity):
2519
2520 plb@0 {
2521 #address-cells = <1>;
2522 #size-cells = <1>;
2523 compatible = "xlnx,plb-v34-1.02.a";
2524 device_type = "ibm,plb";
2525 ranges; // 1:1 translation
2526
2527 plb_bram_if_cntrl_0: bram@ffff0000 {
2528 reg = <ffff0000 10000>;
2529 }
2530
2531 opb@20000000 {
2532 #address-cells = <1>;
2533 #size-cells = <1>;
2534 ranges = <20000000 20000000 20000000
2535 60000000 60000000 20000000
2536 80000000 80000000 40000000
2537 c0000000 c0000000 20000000>;
2538
2539 opb_uart16550_0: serial@a0000000 {
2540 reg = <a00000000 2000>;
2541 };
2542
2543 opb_intc_0: interrupt-controller@d1000fc0 {
2544 reg = <d1000fc0 20>;
2545 };
2546 };
2547 };
2548
2549 That covers the general approach to binding xilinx IP cores into the
2550 device tree. The following are bindings for specific devices:
2551
2552 i) Xilinx ML300 Framebuffer
2553
2554 Simple framebuffer device from the ML300 reference design (also on the
2555 ML403 reference design as well as others).
2556
2557 Optional properties:
2558 - resolution = <xres yres> : pixel resolution of framebuffer. Some
2559 implementations use a different resolution.
2560 Default is <d#640 d#480>
2561 - virt-resolution = <xvirt yvirt> : Size of framebuffer in memory.
2562 Default is <d#1024 d#480>.
2563 - rotate-display (empty) : rotate display 180 degrees.
2564
2565 ii) Xilinx SystemACE
2566
2567 The Xilinx SystemACE device is used to program FPGAs from an FPGA
2568 bitstream stored on a CF card. It can also be used as a generic CF
2569 interface device.
2570
2571 Optional properties:
2572 - 8-bit (empty) : Set this property for SystemACE in 8 bit mode
2573
2574 iii) Xilinx EMAC and Xilinx TEMAC
2575
2576 Xilinx Ethernet devices. In addition to general xilinx properties
2577 listed above, nodes for these devices should include a phy-handle
2578 property, and may include other common network device properties
2579 like local-mac-address.
2580
2581 iv) Xilinx Uartlite
2582
2583 Xilinx uartlite devices are simple fixed speed serial ports.
2584
2585 Requred properties:
2586 - current-speed : Baud rate of uartlite
2587
2588 v) Xilinx hwicap
2589
2590 Xilinx hwicap devices provide access to the configuration logic
2591 of the FPGA through the Internal Configuration Access Port
2592 (ICAP). The ICAP enables partial reconfiguration of the FPGA,
2593 readback of the configuration information, and some control over
2594 'warm boots' of the FPGA fabric.
2595
2596 Required properties:
2597 - xlnx,family : The family of the FPGA, necessary since the
2598 capabilities of the underlying ICAP hardware
2599 differ between different families. May be
2600 'virtex2p', 'virtex4', or 'virtex5'.
2601
2602 p) Freescale Synchronous Serial Interface
2603
2604 The SSI is a serial device that communicates with audio codecs. It can
2605 be programmed in AC97, I2S, left-justified, or right-justified modes.
2606
2607 Required properties:
2608 - compatible : compatible list, containing "fsl,ssi"
2609 - cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on
2610 - reg : offset and length of the register set for the device
2611 - interrupts : <a b> where a is the interrupt number and b is a
2612 field that represents an encoding of the sense and
2613 level information for the interrupt. This should be
2614 encoded based on the information in section 2)
2615 depending on the type of interrupt controller you
2616 have.
2617 - interrupt-parent : the phandle for the interrupt controller that
2618 services interrupts for this device.
2619 - fsl,mode : the operating mode for the SSI interface
2620 "i2s-slave" - I2S mode, SSI is clock slave
2621 "i2s-master" - I2S mode, SSI is clock master
2622 "lj-slave" - left-justified mode, SSI is clock slave
2623 "lj-master" - l.j. mode, SSI is clock master
2624 "rj-slave" - right-justified mode, SSI is clock slave
2625 "rj-master" - r.j., SSI is clock master
2626 "ac97-slave" - AC97 mode, SSI is clock slave
2627 "ac97-master" - AC97 mode, SSI is clock master
2628
2629 Optional properties:
2630 - codec-handle : phandle to a 'codec' node that defines an audio
2631 codec connected to this SSI. This node is typically
2632 a child of an I2C or other control node.
2633
2634 Child 'codec' node required properties:
2635 - compatible : compatible list, contains the name of the codec
2636
2637 Child 'codec' node optional properties:
2638 - clock-frequency : The frequency of the input clock, which typically
2639 comes from an on-board dedicated oscillator.
2640
2641 * Freescale 83xx DMA Controller
2642
2643 Freescale PowerPC 83xx have on chip general purpose DMA controllers.
2644
2645 Required properties:
2646
2647 - compatible : compatible list, contains 2 entries, first is
2648 "fsl,CHIP-dma", where CHIP is the processor
2649 (mpc8349, mpc8360, etc.) and the second is
2650 "fsl,elo-dma"
2651 - reg : <registers mapping for DMA general status reg>
2652 - ranges : Should be defined as specified in 1) to describe the
2653 DMA controller channels.
2654 - cell-index : controller index. 0 for controller @ 0x8100
2655 - interrupts : <interrupt mapping for DMA IRQ>
2656 - interrupt-parent : optional, if needed for interrupt mapping
2657
2658
2659 - DMA channel nodes:
2660 - compatible : compatible list, contains 2 entries, first is
2661 "fsl,CHIP-dma-channel", where CHIP is the processor
2662 (mpc8349, mpc8350, etc.) and the second is
2663 "fsl,elo-dma-channel"
2664 - reg : <registers mapping for channel>
2665 - cell-index : dma channel index starts at 0.
2666
2667 Optional properties:
2668 - interrupts : <interrupt mapping for DMA channel IRQ>
2669 (on 83xx this is expected to be identical to
2670 the interrupts property of the parent node)
2671 - interrupt-parent : optional, if needed for interrupt mapping
2672
2673 Example:
2674 dma@82a8 {
2675 #address-cells = <1>;
2676 #size-cells = <1>;
2677 compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
2678 reg = <82a8 4>;
2679 ranges = <0 8100 1a4>;
2680 interrupt-parent = <&ipic>;
2681 interrupts = <47 8>;
2682 cell-index = <0>;
2683 dma-channel@0 {
2684 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2685 cell-index = <0>;
2686 reg = <0 80>;
2687 };
2688 dma-channel@80 {
2689 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2690 cell-index = <1>;
2691 reg = <80 80>;
2692 };
2693 dma-channel@100 {
2694 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2695 cell-index = <2>;
2696 reg = <100 80>;
2697 };
2698 dma-channel@180 {
2699 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2700 cell-index = <3>;
2701 reg = <180 80>;
2702 };
2703 };
2704
2705 * Freescale 85xx/86xx DMA Controller
2706
2707 Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
2708
2709 Required properties:
2710
2711 - compatible : compatible list, contains 2 entries, first is
2712 "fsl,CHIP-dma", where CHIP is the processor
2713 (mpc8540, mpc8540, etc.) and the second is
2714 "fsl,eloplus-dma"
2715 - reg : <registers mapping for DMA general status reg>
2716 - cell-index : controller index. 0 for controller @ 0x21000,
2717 1 for controller @ 0xc000
2718 - ranges : Should be defined as specified in 1) to describe the
2719 DMA controller channels.
2720
2721 - DMA channel nodes:
2722 - compatible : compatible list, contains 2 entries, first is
2723 "fsl,CHIP-dma-channel", where CHIP is the processor
2724 (mpc8540, mpc8560, etc.) and the second is
2725 "fsl,eloplus-dma-channel"
2726 - cell-index : dma channel index starts at 0.
2727 - reg : <registers mapping for channel>
2728 - interrupts : <interrupt mapping for DMA channel IRQ>
2729 - interrupt-parent : optional, if needed for interrupt mapping
2730
2731 Example:
2732 dma@21300 {
2733 #address-cells = <1>;
2734 #size-cells = <1>;
2735 compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
2736 reg = <21300 4>;
2737 ranges = <0 21100 200>;
2738 cell-index = <0>;
2739 dma-channel@0 {
2740 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2741 reg = <0 80>;
2742 cell-index = <0>;
2743 interrupt-parent = <&mpic>;
2744 interrupts = <14 2>;
2745 };
2746 dma-channel@80 {
2747 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2748 reg = <80 80>;
2749 cell-index = <1>;
2750 interrupt-parent = <&mpic>;
2751 interrupts = <15 2>;
2752 };
2753 dma-channel@100 {
2754 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2755 reg = <100 80>;
2756 cell-index = <2>;
2757 interrupt-parent = <&mpic>;
2758 interrupts = <16 2>;
2759 };
2760 dma-channel@180 {
2761 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2762 reg = <180 80>;
2763 cell-index = <3>;
2764 interrupt-parent = <&mpic>;
2765 interrupts = <17 2>;
2766 };
2767 };
2768
2769 * Freescale 8xxx/3.0 Gb/s SATA nodes
2770
2771 SATA nodes are defined to describe on-chip Serial ATA controllers.
2772 Each SATA port should have its own node.
2773
2774 Required properties:
2775 - compatible : compatible list, contains 2 entries, first is
2776 "fsl,CHIP-sata", where CHIP is the processor
2777 (mpc8315, mpc8379, etc.) and the second is
2778 "fsl,pq-sata"
2779 - interrupts : <interrupt mapping for SATA IRQ>
2780 - cell-index : controller index.
2781 1 for controller @ 0x18000
2782 2 for controller @ 0x19000
2783 3 for controller @ 0x1a000
2784 4 for controller @ 0x1b000
2785
2786 Optional properties:
2787 - interrupt-parent : optional, if needed for interrupt mapping
2788 - reg : <registers mapping>
2789
2790 Example:
2791
2792 sata@18000 {
2793 compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
2794 reg = <0x18000 0x1000>;
2795 cell-index = <1>;
2796 interrupts = <2c 8>;
2797 interrupt-parent = < &ipic >;
2798 };
2799
2800 q) USB EHCI controllers
2801
2802 Required properties:
2803 - compatible : should be "usb-ehci".
2804 - reg : should contain at least address and length of the standard EHCI
2805 register set for the device. Optional platform-dependent registers
2806 (debug-port or other) can be also specified here, but only after
2807 definition of standard EHCI registers.
2808 - interrupts : one EHCI interrupt should be described here.
2809 If device registers are implemented in big endian mode, the device
2810 node should have "big-endian-regs" property.
2811 If controller implementation operates with big endian descriptors,
2812 "big-endian-desc" property should be specified.
2813 If both big endian registers and descriptors are used by the controller
2814 implementation, "big-endian" property can be specified instead of having
2815 both "big-endian-regs" and "big-endian-desc".
2816
2817 Example (Sequoia 440EPx):
2818 ehci@e0000300 {
2819 compatible = "ibm,usb-ehci-440epx", "usb-ehci";
2820 interrupt-parent = <&UIC0>;
2821 interrupts = <1a 4>;
2822 reg = <0 e0000300 90 0 e0000390 70>;
2823 big-endian;
2824 };
2825
2826
2827 VII - Marvell Discovery mv64[345]6x System Controller chips
2828 ===========================================================
2829
2830 The Marvell mv64[345]60 series of system controller chips contain
2831 many of the peripherals needed to implement a complete computer
2832 system. In this section, we define device tree nodes to describe
2833 the system controller chip itself and each of the peripherals
2834 which it contains. Compatible string values for each node are
2835 prefixed with the string "marvell,", for Marvell Technology Group Ltd.
2836
2837 1) The /system-controller node
2838
2839 This node is used to represent the system-controller and must be
2840 present when the system uses a system contller chip. The top-level
2841 system-controller node contains information that is global to all
2842 devices within the system controller chip. The node name begins
2843 with "system-controller" followed by the unit address, which is
2844 the base address of the memory-mapped register set for the system
2845 controller chip.
2846
2847 Required properties:
2848
2849 - ranges : Describes the translation of system controller addresses
2850 for memory mapped registers.
2851 - clock-frequency: Contains the main clock frequency for the system
2852 controller chip.
2853 - reg : This property defines the address and size of the
2854 memory-mapped registers contained within the system controller
2855 chip. The address specified in the "reg" property should match
2856 the unit address of the system-controller node.
2857 - #address-cells : Address representation for system controller
2858 devices. This field represents the number of cells needed to
2859 represent the address of the memory-mapped registers of devices
2860 within the system controller chip.
2861 - #size-cells : Size representation for for the memory-mapped
2862 registers within the system controller chip.
2863 - #interrupt-cells : Defines the width of cells used to represent
2864 interrupts.
2865
2866 Optional properties:
2867
2868 - model : The specific model of the system controller chip. Such
2869 as, "mv64360", "mv64460", or "mv64560".
2870 - compatible : A string identifying the compatibility identifiers
2871 of the system controller chip.
2872
2873 The system-controller node contains child nodes for each system
2874 controller device that the platform uses. Nodes should not be created
2875 for devices which exist on the system controller chip but are not used
2876
2877 Example Marvell Discovery mv64360 system-controller node:
2878
2879 system-controller@f1000000 { /* Marvell Discovery mv64360 */
2880 #address-cells = <1>;
2881 #size-cells = <1>;
2882 model = "mv64360"; /* Default */
2883 compatible = "marvell,mv64360";
2884 clock-frequency = <133333333>;
2885 reg = <0xf1000000 0x10000>;
2886 virtual-reg = <0xf1000000>;
2887 ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
2888 0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
2889 0xa0000000 0xa0000000 0x4000000 /* User FLASH */
2890 0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
2891 0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
2892
2893 [ child node definitions... ]
2894 }
2895
2896 2) Child nodes of /system-controller
2897
2898 a) Marvell Discovery MDIO bus
2899
2900 The MDIO is a bus to which the PHY devices are connected. For each
2901 device that exists on this bus, a child node should be created. See
2902 the definition of the PHY node below for an example of how to define
2903 a PHY.
2904
2905 Required properties:
2906 - #address-cells : Should be <1>
2907 - #size-cells : Should be <0>
2908 - device_type : Should be "mdio"
2909 - compatible : Should be "marvell,mv64360-mdio"
2910
2911 Example:
2912
2913 mdio {
2914 #address-cells = <1>;
2915 #size-cells = <0>;
2916 device_type = "mdio";
2917 compatible = "marvell,mv64360-mdio";
2918
2919 ethernet-phy@0 {
2920 ......
2921 };
2922 };
2923
2924
2925 b) Marvell Discovery ethernet controller
2926
2927 The Discover ethernet controller is described with two levels
2928 of nodes. The first level describes an ethernet silicon block
2929 and the second level describes up to 3 ethernet nodes within
2930 that block. The reason for the multiple levels is that the
2931 registers for the node are interleaved within a single set
2932 of registers. The "ethernet-block" level describes the
2933 shared register set, and the "ethernet" nodes describe ethernet
2934 port-specific properties.
2935
2936 Ethernet block node
2937
2938 Required properties:
2939 - #address-cells : <1>
2940 - #size-cells : <0>
2941 - compatible : "marvell,mv64360-eth-block"
2942 - reg : Offset and length of the register set for this block
2943
2944 Example Discovery Ethernet block node:
2945 ethernet-block@2000 {
2946 #address-cells = <1>;
2947 #size-cells = <0>;
2948 compatible = "marvell,mv64360-eth-block";
2949 reg = <0x2000 0x2000>;
2950 ethernet@0 {
2951 .......
2952 };
2953 };
2954
2955 Ethernet port node
2956
2957 Required properties:
2958 - device_type : Should be "network".
2959 - compatible : Should be "marvell,mv64360-eth".
2960 - reg : Should be <0>, <1>, or <2>, according to which registers
2961 within the silicon block the device uses.
2962 - interrupts : <a> where a is the interrupt number for the port.
2963 - interrupt-parent : the phandle for the interrupt controller
2964 that services interrupts for this device.
2965 - phy : the phandle for the PHY connected to this ethernet
2966 controller.
2967 - local-mac-address : 6 bytes, MAC address
2968
2969 Example Discovery Ethernet port node:
2970 ethernet@0 {
2971 device_type = "network";
2972 compatible = "marvell,mv64360-eth";
2973 reg = <0>;
2974 interrupts = <32>;
2975 interrupt-parent = <&PIC>;
2976 phy = <&PHY0>;
2977 local-mac-address = [ 00 00 00 00 00 00 ];
2978 };
2979
2980
2981
2982 c) Marvell Discovery PHY nodes
2983
2984 Required properties:
2985 - device_type : Should be "ethernet-phy"
2986 - interrupts : <a> where a is the interrupt number for this phy.
2987 - interrupt-parent : the phandle for the interrupt controller that
2988 services interrupts for this device.
2989 - reg : The ID number for the phy, usually a small integer
2990
2991 Example Discovery PHY node:
2992 ethernet-phy@1 {
2993 device_type = "ethernet-phy";
2994 compatible = "broadcom,bcm5421";
2995 interrupts = <76>; /* GPP 12 */
2996 interrupt-parent = <&PIC>;
2997 reg = <1>;
2998 };
2999
3000
3001 d) Marvell Discovery SDMA nodes
3002
3003 Represent DMA hardware associated with the MPSC (multiprotocol
3004 serial controllers).
3005
3006 Required properties:
3007 - compatible : "marvell,mv64360-sdma"
3008 - reg : Offset and length of the register set for this device
3009 - interrupts : <a> where a is the interrupt number for the DMA
3010 device.
3011 - interrupt-parent : the phandle for the interrupt controller
3012 that services interrupts for this device.
3013
3014 Example Discovery SDMA node:
3015 sdma@4000 {
3016 compatible = "marvell,mv64360-sdma";
3017 reg = <0x4000 0xc18>;
3018 virtual-reg = <0xf1004000>;
3019 interrupts = <36>;
3020 interrupt-parent = <&PIC>;
3021 };
3022
3023
3024 e) Marvell Discovery BRG nodes
3025
3026 Represent baud rate generator hardware associated with the MPSC
3027 (multiprotocol serial controllers).
3028
3029 Required properties:
3030 - compatible : "marvell,mv64360-brg"
3031 - reg : Offset and length of the register set for this device
3032 - clock-src : A value from 0 to 15 which selects the clock
3033 source for the baud rate generator. This value corresponds
3034 to the CLKS value in the BRGx configuration register. See
3035 the mv64x60 User's Manual.
3036 - clock-frequence : The frequency (in Hz) of the baud rate
3037 generator's input clock.
3038 - current-speed : The current speed setting (presumably by
3039 firmware) of the baud rate generator.
3040
3041 Example Discovery BRG node:
3042 brg@b200 {
3043 compatible = "marvell,mv64360-brg";
3044 reg = <0xb200 0x8>;
3045 clock-src = <8>;
3046 clock-frequency = <133333333>;
3047 current-speed = <9600>;
3048 };
3049
3050
3051 f) Marvell Discovery CUNIT nodes
3052
3053 Represent the Serial Communications Unit device hardware.
3054
3055 Required properties:
3056 - reg : Offset and length of the register set for this device
3057
3058 Example Discovery CUNIT node:
3059 cunit@f200 {
3060 reg = <0xf200 0x200>;
3061 };
3062
3063
3064 g) Marvell Discovery MPSCROUTING nodes
3065
3066 Represent the Discovery's MPSC routing hardware
3067
3068 Required properties:
3069 - reg : Offset and length of the register set for this device
3070
3071 Example Discovery CUNIT node:
3072 mpscrouting@b500 {
3073 reg = <0xb400 0xc>;
3074 };
3075
3076
3077 h) Marvell Discovery MPSCINTR nodes
3078
3079 Represent the Discovery's MPSC DMA interrupt hardware registers
3080 (SDMA cause and mask registers).
3081
3082 Required properties:
3083 - reg : Offset and length of the register set for this device
3084
3085 Example Discovery MPSCINTR node:
3086 mpsintr@b800 {
3087 reg = <0xb800 0x100>;
3088 };
3089
3090
3091 i) Marvell Discovery MPSC nodes
3092
3093 Represent the Discovery's MPSC (Multiprotocol Serial Controller)
3094 serial port.
3095
3096 Required properties:
3097 - device_type : "serial"
3098 - compatible : "marvell,mv64360-mpsc"
3099 - reg : Offset and length of the register set for this device
3100 - sdma : the phandle for the SDMA node used by this port
3101 - brg : the phandle for the BRG node used by this port
3102 - cunit : the phandle for the CUNIT node used by this port
3103 - mpscrouting : the phandle for the MPSCROUTING node used by this port
3104 - mpscintr : the phandle for the MPSCINTR node used by this port
3105 - cell-index : the hardware index of this cell in the MPSC core
3106 - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
3107 register
3108 - interrupts : <a> where a is the interrupt number for the MPSC.
3109 - interrupt-parent : the phandle for the interrupt controller
3110 that services interrupts for this device.
3111
3112 Example Discovery MPSCINTR node:
3113 mpsc@8000 {
3114 device_type = "serial";
3115 compatible = "marvell,mv64360-mpsc";
3116 reg = <0x8000 0x38>;
3117 virtual-reg = <0xf1008000>;
3118 sdma = <&SDMA0>;
3119 brg = <&BRG0>;
3120 cunit = <&CUNIT>;
3121 mpscrouting = <&MPSCROUTING>;
3122 mpscintr = <&MPSCINTR>;
3123 cell-index = <0>;
3124 max_idle = <40>;
3125 interrupts = <40>;
3126 interrupt-parent = <&PIC>;
3127 };
3128
3129
3130 j) Marvell Discovery Watch Dog Timer nodes
3131
3132 Represent the Discovery's watchdog timer hardware
3133
3134 Required properties:
3135 - compatible : "marvell,mv64360-wdt"
3136 - reg : Offset and length of the register set for this device
3137
3138 Example Discovery Watch Dog Timer node:
3139 wdt@b410 {
3140 compatible = "marvell,mv64360-wdt";
3141 reg = <0xb410 0x8>;
3142 };
3143
3144
3145 k) Marvell Discovery I2C nodes
3146
3147 Represent the Discovery's I2C hardware
3148
3149 Required properties:
3150 - device_type : "i2c"
3151 - compatible : "marvell,mv64360-i2c"
3152 - reg : Offset and length of the register set for this device
3153 - interrupts : <a> where a is the interrupt number for the I2C.
3154 - interrupt-parent : the phandle for the interrupt controller
3155 that services interrupts for this device.
3156
3157 Example Discovery I2C node:
3158 compatible = "marvell,mv64360-i2c";
3159 reg = <0xc000 0x20>;
3160 virtual-reg = <0xf100c000>;
3161 interrupts = <37>;
3162 interrupt-parent = <&PIC>;
3163 };
3164
3165
3166 l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
3167
3168 Represent the Discovery's PIC hardware
3169
3170 Required properties:
3171 - #interrupt-cells : <1>
3172 - #address-cells : <0>
3173 - compatible : "marvell,mv64360-pic"
3174 - reg : Offset and length of the register set for this device
3175 - interrupt-controller
3176
3177 Example Discovery PIC node:
3178 pic {
3179 #interrupt-cells = <1>;
3180 #address-cells = <0>;
3181 compatible = "marvell,mv64360-pic";
3182 reg = <0x0 0x88>;
3183 interrupt-controller;
3184 };
3185
3186
3187 m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
3188
3189 Represent the Discovery's MPP hardware
3190
3191 Required properties:
3192 - compatible : "marvell,mv64360-mpp"
3193 - reg : Offset and length of the register set for this device
3194
3195 Example Discovery MPP node:
3196 mpp@f000 {
3197 compatible = "marvell,mv64360-mpp";
3198 reg = <0xf000 0x10>;
3199 };
3200
3201
3202 n) Marvell Discovery GPP (General Purpose Pins) nodes
3203
3204 Represent the Discovery's GPP hardware
3205
3206 Required properties:
3207 - compatible : "marvell,mv64360-gpp"
3208 - reg : Offset and length of the register set for this device
3209
3210 Example Discovery GPP node:
3211 gpp@f000 {
3212 compatible = "marvell,mv64360-gpp";
3213 reg = <0xf100 0x20>;
3214 };
3215
3216
3217 o) Marvell Discovery PCI host bridge node
3218
3219 Represents the Discovery's PCI host bridge device. The properties
3220 for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
3221 1275-1994. A typical value for the compatible property is
3222 "marvell,mv64360-pci".
3223
3224 Example Discovery PCI host bridge node
3225 pci@80000000 {
3226 #address-cells = <3>;
3227 #size-cells = <2>;
3228 #interrupt-cells = <1>;
3229 device_type = "pci";
3230 compatible = "marvell,mv64360-pci";
3231 reg = <0xcf8 0x8>;
3232 ranges = <0x01000000 0x0 0x0
3233 0x88000000 0x0 0x01000000
3234 0x02000000 0x0 0x80000000
3235 0x80000000 0x0 0x08000000>;
3236 bus-range = <0 255>;
3237 clock-frequency = <66000000>;
3238 interrupt-parent = <&PIC>;
3239 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
3240 interrupt-map = <
3241 /* IDSEL 0x0a */
3242 0x5000 0 0 1 &PIC 80
3243 0x5000 0 0 2 &PIC 81
3244 0x5000 0 0 3 &PIC 91
3245 0x5000 0 0 4 &PIC 93
3246
3247 /* IDSEL 0x0b */
3248 0x5800 0 0 1 &PIC 91
3249 0x5800 0 0 2 &PIC 93
3250 0x5800 0 0 3 &PIC 80
3251 0x5800 0 0 4 &PIC 81
3252
3253 /* IDSEL 0x0c */
3254 0x6000 0 0 1 &PIC 91
3255 0x6000 0 0 2 &PIC 93
3256 0x6000 0 0 3 &PIC 80
3257 0x6000 0 0 4 &PIC 81
3258
3259 /* IDSEL 0x0d */
3260 0x6800 0 0 1 &PIC 93
3261 0x6800 0 0 2 &PIC 80
3262 0x6800 0 0 3 &PIC 81
3263 0x6800 0 0 4 &PIC 91
3264 >;
3265 };
3266
3267
3268 p) Marvell Discovery CPU Error nodes
3269
3270 Represent the Discovery's CPU error handler device.
3271
3272 Required properties:
3273 - compatible : "marvell,mv64360-cpu-error"
3274 - reg : Offset and length of the register set for this device
3275 - interrupts : the interrupt number for this device
3276 - interrupt-parent : the phandle for the interrupt controller
3277 that services interrupts for this device.
3278
3279 Example Discovery CPU Error node:
3280 cpu-error@0070 {
3281 compatible = "marvell,mv64360-cpu-error";
3282 reg = <0x70 0x10 0x128 0x28>;
3283 interrupts = <3>;
3284 interrupt-parent = <&PIC>;
3285 };
3286
3287
3288 q) Marvell Discovery SRAM Controller nodes
3289
3290 Represent the Discovery's SRAM controller device.
3291
3292 Required properties:
3293 - compatible : "marvell,mv64360-sram-ctrl"
3294 - reg : Offset and length of the register set for this device
3295 - interrupts : the interrupt number for this device
3296 - interrupt-parent : the phandle for the interrupt controller
3297 that services interrupts for this device.
3298
3299 Example Discovery SRAM Controller node:
3300 sram-ctrl@0380 {
3301 compatible = "marvell,mv64360-sram-ctrl";
3302 reg = <0x380 0x80>;
3303 interrupts = <13>;
3304 interrupt-parent = <&PIC>;
3305 };
3306
3307
3308 r) Marvell Discovery PCI Error Handler nodes
3309
3310 Represent the Discovery's PCI error handler device.
3311
3312 Required properties:
3313 - compatible : "marvell,mv64360-pci-error"
3314 - reg : Offset and length of the register set for this device
3315 - interrupts : the interrupt number for this device
3316 - interrupt-parent : the phandle for the interrupt controller
3317 that services interrupts for this device.
3318
3319 Example Discovery PCI Error Handler node:
3320 pci-error@1d40 {
3321 compatible = "marvell,mv64360-pci-error";
3322 reg = <0x1d40 0x40 0xc28 0x4>;
3323 interrupts = <12>;
3324 interrupt-parent = <&PIC>;
3325 };
3326
3327
3328 s) Marvell Discovery Memory Controller nodes
3329
3330 Represent the Discovery's memory controller device.
3331
3332 Required properties:
3333 - compatible : "marvell,mv64360-mem-ctrl"
3334 - reg : Offset and length of the register set for this device
3335 - interrupts : the interrupt number for this device
3336 - interrupt-parent : the phandle for the interrupt controller
3337 that services interrupts for this device.
3338
3339 Example Discovery Memory Controller node:
3340 mem-ctrl@1400 {
3341 compatible = "marvell,mv64360-mem-ctrl";
3342 reg = <0x1400 0x60>;
3343 interrupts = <17>;
3344 interrupt-parent = <&PIC>;
3345 };
3346
3347
3348 VIII - Specifying interrupt information for devices
3349 ===================================================
3350
3351 The device tree represents the busses and devices of a hardware
3352 system in a form similar to the physical bus topology of the
3353 hardware.
3354
3355 In addition, a logical 'interrupt tree' exists which represents the
3356 hierarchy and routing of interrupts in the hardware.
3357
3358 The interrupt tree model is fully described in the
3359 document "Open Firmware Recommended Practice: Interrupt
3360 Mapping Version 0.9". The document is available at:
3361 <http://playground.sun.com/1275/practice>.
3362
3363 1) interrupts property
3364 ----------------------
3365
3366 Devices that generate interrupts to a single interrupt controller
3367 should use the conventional OF representation described in the
3368 OF interrupt mapping documentation.
3369
3370 Each device which generates interrupts must have an 'interrupt'
3371 property. The interrupt property value is an arbitrary number of
3372 of 'interrupt specifier' values which describe the interrupt or
3373 interrupts for the device.
3374
3375 The encoding of an interrupt specifier is determined by the
3376 interrupt domain in which the device is located in the
3377 interrupt tree. The root of an interrupt domain specifies in
3378 its #interrupt-cells property the number of 32-bit cells
3379 required to encode an interrupt specifier. See the OF interrupt
3380 mapping documentation for a detailed description of domains.
3381
3382 For example, the binding for the OpenPIC interrupt controller
3383 specifies an #interrupt-cells value of 2 to encode the interrupt
3384 number and level/sense information. All interrupt children in an
3385 OpenPIC interrupt domain use 2 cells per interrupt in their interrupts
3386 property.
3387
3388 The PCI bus binding specifies a #interrupt-cell value of 1 to encode
3389 which interrupt pin (INTA,INTB,INTC,INTD) is used.
3390
3391 2) interrupt-parent property
3392 ----------------------------
3393
3394 The interrupt-parent property is specified to define an explicit
3395 link between a device node and its interrupt parent in
3396 the interrupt tree. The value of interrupt-parent is the
3397 phandle of the parent node.
3398
3399 If the interrupt-parent property is not defined for a node, it's
3400 interrupt parent is assumed to be an ancestor in the node's
3401 _device tree_ hierarchy.
3402
3403 3) OpenPIC Interrupt Controllers
3404 --------------------------------
3405
3406 OpenPIC interrupt controllers require 2 cells to encode
3407 interrupt information. The first cell defines the interrupt
3408 number. The second cell defines the sense and level
3409 information.
3410
3411 Sense and level information should be encoded as follows:
3412
3413 0 = low to high edge sensitive type enabled
3414 1 = active low level sensitive type enabled
3415 2 = active high level sensitive type enabled
3416 3 = high to low edge sensitive type enabled
3417
3418 4) ISA Interrupt Controllers
3419 ----------------------------
3420
3421 ISA PIC interrupt controllers require 2 cells to encode
3422 interrupt information. The first cell defines the interrupt
3423 number. The second cell defines the sense and level
3424 information.
3425
3426 ISA PIC interrupt controllers should adhere to the ISA PIC
3427 encodings listed below:
3428
3429 0 = active low level sensitive type enabled
3430 1 = active high level sensitive type enabled
3431 2 = high to low edge sensitive type enabled
3432 3 = low to high edge sensitive type enabled
3433
3434
3435 Appendix A - Sample SOC node for MPC8540
3436 ========================================
3437
3438 Note that the #address-cells and #size-cells for the SoC node
3439 in this example have been explicitly listed; these are likely
3440 not necessary as they are usually the same as the root node.
3441
3442 soc8540@e0000000 {
3443 #address-cells = <1>;
3444 #size-cells = <1>;
3445 #interrupt-cells = <2>;
3446 device_type = "soc";
3447 ranges = <00000000 e0000000 00100000>
3448 reg = <e0000000 00003000>;
3449 bus-frequency = <0>;
3450
3451 mdio@24520 {
3452 reg = <24520 20>;
3453 device_type = "mdio";
3454 compatible = "gianfar";
3455
3456 ethernet-phy@0 {
3457 linux,phandle = <2452000>
3458 interrupt-parent = <40000>;
3459 interrupts = <35 1>;
3460 reg = <0>;
3461 device_type = "ethernet-phy";
3462 };
3463
3464 ethernet-phy@1 {
3465 linux,phandle = <2452001>
3466 interrupt-parent = <40000>;
3467 interrupts = <35 1>;
3468 reg = <1>;
3469 device_type = "ethernet-phy";
3470 };
3471
3472 ethernet-phy@3 {
3473 linux,phandle = <2452002>
3474 interrupt-parent = <40000>;
3475 interrupts = <35 1>;
3476 reg = <3>;
3477 device_type = "ethernet-phy";
3478 };
3479
3480 };
3481
3482 ethernet@24000 {
3483 #size-cells = <0>;
3484 device_type = "network";
3485 model = "TSEC";
3486 compatible = "gianfar";
3487 reg = <24000 1000>;
3488 mac-address = [ 00 E0 0C 00 73 00 ];
3489 interrupts = <d 3 e 3 12 3>;
3490 interrupt-parent = <40000>;
3491 phy-handle = <2452000>;
3492 };
3493
3494 ethernet@25000 {
3495 #address-cells = <1>;
3496 #size-cells = <0>;
3497 device_type = "network";
3498 model = "TSEC";
3499 compatible = "gianfar";
3500 reg = <25000 1000>;
3501 mac-address = [ 00 E0 0C 00 73 01 ];
3502 interrupts = <13 3 14 3 18 3>;
3503 interrupt-parent = <40000>;
3504 phy-handle = <2452001>;
3505 };
3506
3507 ethernet@26000 {
3508 #address-cells = <1>;
3509 #size-cells = <0>;
3510 device_type = "network";
3511 model = "FEC";
3512 compatible = "gianfar";
3513 reg = <26000 1000>;
3514 mac-address = [ 00 E0 0C 00 73 02 ];
3515 interrupts = <19 3>;
3516 interrupt-parent = <40000>;
3517 phy-handle = <2452002>;
3518 };
3519
3520 serial@4500 {
3521 device_type = "serial";
3522 compatible = "ns16550";
3523 reg = <4500 100>;
3524 clock-frequency = <0>;
3525 interrupts = <1a 3>;
3526 interrupt-parent = <40000>;
3527 };
3528
3529 pic@40000 {
3530 linux,phandle = <40000>;
3531 clock-frequency = <0>;
3532 interrupt-controller;
3533 #address-cells = <0>;
3534 reg = <40000 40000>;
3535 built-in;
3536 compatible = "chrp,open-pic";
3537 device_type = "open-pic";
3538 big-endian;
3539 };
3540
3541 i2c@3000 {
3542 interrupt-parent = <40000>;
3543 interrupts = <1b 3>;
3544 reg = <3000 18>;
3545 device_type = "i2c";
3546 compatible = "fsl-i2c";
3547 dfsrr;
3548 };
3549
3550 };
This page took 0.11193 seconds and 6 git commands to generate.