booting-without-of.txt 91 KB

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