booting-without-of.txt 113 KB

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