booting-without-of.txt 134 KB

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