booting-without-of.txt 71 KB

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