booting-without-of.txt 136 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780
  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. x) I2C
  1763. The I2C controller is expressed as a bus under the CPM node.
  1764. Properties:
  1765. - compatible : "fsl,cpm1-i2c", "fsl,cpm2-i2c"
  1766. - reg : On CPM2 devices, the second resource doesn't specify the I2C
  1767. Parameter RAM itself, but the I2C_BASE field of the CPM2 Parameter RAM
  1768. (typically 0x8afc 0x2).
  1769. - #address-cells : Should be one. The cell is the i2c device address with
  1770. the r/w bit set to zero.
  1771. - #size-cells : Should be zero.
  1772. - clock-frequency : Can be used to set the i2c clock frequency. If
  1773. unspecified, a default frequency of 60kHz is being used.
  1774. The following two properties are deprecated. They are only used by legacy
  1775. i2c drivers to find the bus to probe:
  1776. - linux,i2c-index : Can be used to hard code an i2c bus number. By default,
  1777. the bus number is dynamically assigned by the i2c core.
  1778. - linux,i2c-class : Can be used to override the i2c class. The class is used
  1779. by legacy i2c device drivers to find a bus in a specific context like
  1780. system management, video or sound. By default, I2C_CLASS_HWMON (1) is
  1781. being used. The definition of the classes can be found in
  1782. include/i2c/i2c.h
  1783. Example, based on mpc823:
  1784. i2c@860 {
  1785. compatible = "fsl,mpc823-i2c",
  1786. "fsl,cpm1-i2c";
  1787. reg = <0x860 0x20 0x3c80 0x30>;
  1788. interrupts = <16>;
  1789. interrupt-parent = <&CPM_PIC>;
  1790. fsl,cpm-command = <0x10>;
  1791. #address-cells = <1>;
  1792. #size-cells = <0>;
  1793. rtc@68 {
  1794. compatible = "dallas,ds1307";
  1795. reg = <0x68>;
  1796. };
  1797. };
  1798. m) Chipselect/Local Bus
  1799. Properties:
  1800. - name : Should be localbus
  1801. - #address-cells : Should be either two or three. The first cell is the
  1802. chipselect number, and the remaining cells are the
  1803. offset into the chipselect.
  1804. - #size-cells : Either one or two, depending on how large each chipselect
  1805. can be.
  1806. - ranges : Each range corresponds to a single chipselect, and cover
  1807. the entire access window as configured.
  1808. Example:
  1809. localbus@f0010100 {
  1810. compatible = "fsl,mpc8272-localbus",
  1811. "fsl,pq2-localbus";
  1812. #address-cells = <2>;
  1813. #size-cells = <1>;
  1814. reg = <f0010100 40>;
  1815. ranges = <0 0 fe000000 02000000
  1816. 1 0 f4500000 00008000>;
  1817. flash@0,0 {
  1818. compatible = "jedec-flash";
  1819. reg = <0 0 2000000>;
  1820. bank-width = <4>;
  1821. device-width = <1>;
  1822. };
  1823. board-control@1,0 {
  1824. reg = <1 0 20>;
  1825. compatible = "fsl,mpc8272ads-bcsr";
  1826. };
  1827. };
  1828. n) 4xx/Axon EMAC ethernet nodes
  1829. The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
  1830. the Axon bridge. To operate this needs to interact with a ths
  1831. special McMAL DMA controller, and sometimes an RGMII or ZMII
  1832. interface. In addition to the nodes and properties described
  1833. below, the node for the OPB bus on which the EMAC sits must have a
  1834. correct clock-frequency property.
  1835. i) The EMAC node itself
  1836. Required properties:
  1837. - device_type : "network"
  1838. - compatible : compatible list, contains 2 entries, first is
  1839. "ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
  1840. 405gp, Axon) and second is either "ibm,emac" or
  1841. "ibm,emac4". For Axon, thus, we have: "ibm,emac-axon",
  1842. "ibm,emac4"
  1843. - interrupts : <interrupt mapping for EMAC IRQ and WOL IRQ>
  1844. - interrupt-parent : optional, if needed for interrupt mapping
  1845. - reg : <registers mapping>
  1846. - local-mac-address : 6 bytes, MAC address
  1847. - mal-device : phandle of the associated McMAL node
  1848. - mal-tx-channel : 1 cell, index of the tx channel on McMAL associated
  1849. with this EMAC
  1850. - mal-rx-channel : 1 cell, index of the rx channel on McMAL associated
  1851. with this EMAC
  1852. - cell-index : 1 cell, hardware index of the EMAC cell on a given
  1853. ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
  1854. each Axon chip)
  1855. - max-frame-size : 1 cell, maximum frame size supported in bytes
  1856. - rx-fifo-size : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
  1857. operations.
  1858. For Axon, 2048
  1859. - tx-fifo-size : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
  1860. operations.
  1861. For Axon, 2048.
  1862. - fifo-entry-size : 1 cell, size of a fifo entry (used to calculate
  1863. thresholds).
  1864. For Axon, 0x00000010
  1865. - mal-burst-size : 1 cell, MAL burst size (used to calculate thresholds)
  1866. in bytes.
  1867. For Axon, 0x00000100 (I think ...)
  1868. - phy-mode : string, mode of operations of the PHY interface.
  1869. Supported values are: "mii", "rmii", "smii", "rgmii",
  1870. "tbi", "gmii", rtbi", "sgmii".
  1871. For Axon on CAB, it is "rgmii"
  1872. - mdio-device : 1 cell, required iff using shared MDIO registers
  1873. (440EP). phandle of the EMAC to use to drive the
  1874. MDIO lines for the PHY used by this EMAC.
  1875. - zmii-device : 1 cell, required iff connected to a ZMII. phandle of
  1876. the ZMII device node
  1877. - zmii-channel : 1 cell, required iff connected to a ZMII. Which ZMII
  1878. channel or 0xffffffff if ZMII is only used for MDIO.
  1879. - rgmii-device : 1 cell, required iff connected to an RGMII. phandle
  1880. of the RGMII device node.
  1881. For Axon: phandle of plb5/plb4/opb/rgmii
  1882. - rgmii-channel : 1 cell, required iff connected to an RGMII. Which
  1883. RGMII channel is used by this EMAC.
  1884. Fox Axon: present, whatever value is appropriate for each
  1885. EMAC, that is the content of the current (bogus) "phy-port"
  1886. property.
  1887. Optional properties:
  1888. - phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
  1889. a search is performed.
  1890. - phy-map : 1 cell, optional, bitmap of addresses to probe the PHY
  1891. for, used if phy-address is absent. bit 0x00000001 is
  1892. MDIO address 0.
  1893. For Axon it can be absent, thouugh my current driver
  1894. doesn't handle phy-address yet so for now, keep
  1895. 0x00ffffff in it.
  1896. - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
  1897. operations (if absent the value is the same as
  1898. rx-fifo-size). For Axon, either absent or 2048.
  1899. - tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
  1900. operations (if absent the value is the same as
  1901. tx-fifo-size). For Axon, either absent or 2048.
  1902. - tah-device : 1 cell, optional. If connected to a TAH engine for
  1903. offload, phandle of the TAH device node.
  1904. - tah-channel : 1 cell, optional. If appropriate, channel used on the
  1905. TAH engine.
  1906. Example:
  1907. EMAC0: ethernet@40000800 {
  1908. device_type = "network";
  1909. compatible = "ibm,emac-440gp", "ibm,emac";
  1910. interrupt-parent = <&UIC1>;
  1911. interrupts = <1c 4 1d 4>;
  1912. reg = <40000800 70>;
  1913. local-mac-address = [00 04 AC E3 1B 1E];
  1914. mal-device = <&MAL0>;
  1915. mal-tx-channel = <0 1>;
  1916. mal-rx-channel = <0>;
  1917. cell-index = <0>;
  1918. max-frame-size = <5dc>;
  1919. rx-fifo-size = <1000>;
  1920. tx-fifo-size = <800>;
  1921. phy-mode = "rmii";
  1922. phy-map = <00000001>;
  1923. zmii-device = <&ZMII0>;
  1924. zmii-channel = <0>;
  1925. };
  1926. ii) McMAL node
  1927. Required properties:
  1928. - device_type : "dma-controller"
  1929. - compatible : compatible list, containing 2 entries, first is
  1930. "ibm,mcmal-CHIP" where CHIP is the host ASIC (like
  1931. emac) and the second is either "ibm,mcmal" or
  1932. "ibm,mcmal2".
  1933. For Axon, "ibm,mcmal-axon","ibm,mcmal2"
  1934. - interrupts : <interrupt mapping for the MAL interrupts sources:
  1935. 5 sources: tx_eob, rx_eob, serr, txde, rxde>.
  1936. For Axon: This is _different_ from the current
  1937. firmware. We use the "delayed" interrupts for txeob
  1938. and rxeob. Thus we end up with mapping those 5 MPIC
  1939. interrupts, all level positive sensitive: 10, 11, 32,
  1940. 33, 34 (in decimal)
  1941. - dcr-reg : < DCR registers range >
  1942. - dcr-parent : if needed for dcr-reg
  1943. - num-tx-chans : 1 cell, number of Tx channels
  1944. - num-rx-chans : 1 cell, number of Rx channels
  1945. iii) ZMII node
  1946. Required properties:
  1947. - compatible : compatible list, containing 2 entries, first is
  1948. "ibm,zmii-CHIP" where CHIP is the host ASIC (like
  1949. EMAC) and the second is "ibm,zmii".
  1950. For Axon, there is no ZMII node.
  1951. - reg : <registers mapping>
  1952. iv) RGMII node
  1953. Required properties:
  1954. - compatible : compatible list, containing 2 entries, first is
  1955. "ibm,rgmii-CHIP" where CHIP is the host ASIC (like
  1956. EMAC) and the second is "ibm,rgmii".
  1957. For Axon, "ibm,rgmii-axon","ibm,rgmii"
  1958. - reg : <registers mapping>
  1959. - revision : as provided by the RGMII new version register if
  1960. available.
  1961. For Axon: 0x0000012a
  1962. o) Xilinx IP cores
  1963. The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
  1964. in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range
  1965. of standard device types (network, serial, etc.) and miscellanious
  1966. devices (gpio, LCD, spi, etc). Also, since these devices are
  1967. implemented within the fpga fabric every instance of the device can be
  1968. synthesised with different options that change the behaviour.
  1969. Each IP-core has a set of parameters which the FPGA designer can use to
  1970. control how the core is synthesized. Historically, the EDK tool would
  1971. extract the device parameters relevant to device drivers and copy them
  1972. into an 'xparameters.h' in the form of #define symbols. This tells the
  1973. device drivers how the IP cores are configured, but it requres the kernel
  1974. to be recompiled every time the FPGA bitstream is resynthesized.
  1975. The new approach is to export the parameters into the device tree and
  1976. generate a new device tree each time the FPGA bitstream changes. The
  1977. parameters which used to be exported as #defines will now become
  1978. properties of the device node. In general, device nodes for IP-cores
  1979. will take the following form:
  1980. (name): (generic-name)@(base-address) {
  1981. compatible = "xlnx,(ip-core-name)-(HW_VER)"
  1982. [, (list of compatible devices), ...];
  1983. reg = <(baseaddr) (size)>;
  1984. interrupt-parent = <&interrupt-controller-phandle>;
  1985. interrupts = < ... >;
  1986. xlnx,(parameter1) = "(string-value)";
  1987. xlnx,(parameter2) = <(int-value)>;
  1988. };
  1989. (generic-name): an open firmware-style name that describes the
  1990. generic class of device. Preferably, this is one word, such
  1991. as 'serial' or 'ethernet'.
  1992. (ip-core-name): the name of the ip block (given after the BEGIN
  1993. directive in system.mhs). Should be in lowercase
  1994. and all underscores '_' converted to dashes '-'.
  1995. (name): is derived from the "PARAMETER INSTANCE" value.
  1996. (parameter#): C_* parameters from system.mhs. The C_ prefix is
  1997. dropped from the parameter name, the name is converted
  1998. to lowercase and all underscore '_' characters are
  1999. converted to dashes '-'.
  2000. (baseaddr): the baseaddr parameter value (often named C_BASEADDR).
  2001. (HW_VER): from the HW_VER parameter.
  2002. (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1).
  2003. Typically, the compatible list will include the exact IP core version
  2004. followed by an older IP core version which implements the same
  2005. interface or any other device with the same interface.
  2006. 'reg', 'interrupt-parent' and 'interrupts' are all optional properties.
  2007. For example, the following block from system.mhs:
  2008. BEGIN opb_uartlite
  2009. PARAMETER INSTANCE = opb_uartlite_0
  2010. PARAMETER HW_VER = 1.00.b
  2011. PARAMETER C_BAUDRATE = 115200
  2012. PARAMETER C_DATA_BITS = 8
  2013. PARAMETER C_ODD_PARITY = 0
  2014. PARAMETER C_USE_PARITY = 0
  2015. PARAMETER C_CLK_FREQ = 50000000
  2016. PARAMETER C_BASEADDR = 0xEC100000
  2017. PARAMETER C_HIGHADDR = 0xEC10FFFF
  2018. BUS_INTERFACE SOPB = opb_7
  2019. PORT OPB_Clk = CLK_50MHz
  2020. PORT Interrupt = opb_uartlite_0_Interrupt
  2021. PORT RX = opb_uartlite_0_RX
  2022. PORT TX = opb_uartlite_0_TX
  2023. PORT OPB_Rst = sys_bus_reset_0
  2024. END
  2025. becomes the following device tree node:
  2026. opb_uartlite_0: serial@ec100000 {
  2027. device_type = "serial";
  2028. compatible = "xlnx,opb-uartlite-1.00.b";
  2029. reg = <ec100000 10000>;
  2030. interrupt-parent = <&opb_intc_0>;
  2031. interrupts = <1 0>; // got this from the opb_intc parameters
  2032. current-speed = <d#115200>; // standard serial device prop
  2033. clock-frequency = <d#50000000>; // standard serial device prop
  2034. xlnx,data-bits = <8>;
  2035. xlnx,odd-parity = <0>;
  2036. xlnx,use-parity = <0>;
  2037. };
  2038. Some IP cores actually implement 2 or more logical devices. In
  2039. this case, the device should still describe the whole IP core with
  2040. a single node and add a child node for each logical device. The
  2041. ranges property can be used to translate from parent IP-core to the
  2042. registers of each device. In addition, the parent node should be
  2043. compatible with the bus type 'xlnx,compound', and should contain
  2044. #address-cells and #size-cells, as with any other bus. (Note: this
  2045. makes the assumption that both logical devices have the same bus
  2046. binding. If this is not true, then separate nodes should be used
  2047. for each logical device). The 'cell-index' property can be used to
  2048. enumerate logical devices within an IP core. For example, the
  2049. following is the system.mhs entry for the dual ps2 controller found
  2050. on the ml403 reference design.
  2051. BEGIN opb_ps2_dual_ref
  2052. PARAMETER INSTANCE = opb_ps2_dual_ref_0
  2053. PARAMETER HW_VER = 1.00.a
  2054. PARAMETER C_BASEADDR = 0xA9000000
  2055. PARAMETER C_HIGHADDR = 0xA9001FFF
  2056. BUS_INTERFACE SOPB = opb_v20_0
  2057. PORT Sys_Intr1 = ps2_1_intr
  2058. PORT Sys_Intr2 = ps2_2_intr
  2059. PORT Clkin1 = ps2_clk_rx_1
  2060. PORT Clkin2 = ps2_clk_rx_2
  2061. PORT Clkpd1 = ps2_clk_tx_1
  2062. PORT Clkpd2 = ps2_clk_tx_2
  2063. PORT Rx1 = ps2_d_rx_1
  2064. PORT Rx2 = ps2_d_rx_2
  2065. PORT Txpd1 = ps2_d_tx_1
  2066. PORT Txpd2 = ps2_d_tx_2
  2067. END
  2068. It would result in the following device tree nodes:
  2069. opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
  2070. #address-cells = <1>;
  2071. #size-cells = <1>;
  2072. compatible = "xlnx,compound";
  2073. ranges = <0 a9000000 2000>;
  2074. // If this device had extra parameters, then they would
  2075. // go here.
  2076. ps2@0 {
  2077. compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
  2078. reg = <0 40>;
  2079. interrupt-parent = <&opb_intc_0>;
  2080. interrupts = <3 0>;
  2081. cell-index = <0>;
  2082. };
  2083. ps2@1000 {
  2084. compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
  2085. reg = <1000 40>;
  2086. interrupt-parent = <&opb_intc_0>;
  2087. interrupts = <3 0>;
  2088. cell-index = <0>;
  2089. };
  2090. };
  2091. Also, the system.mhs file defines bus attachments from the processor
  2092. to the devices. The device tree structure should reflect the bus
  2093. attachments. Again an example; this system.mhs fragment:
  2094. BEGIN ppc405_virtex4
  2095. PARAMETER INSTANCE = ppc405_0
  2096. PARAMETER HW_VER = 1.01.a
  2097. BUS_INTERFACE DPLB = plb_v34_0
  2098. BUS_INTERFACE IPLB = plb_v34_0
  2099. END
  2100. BEGIN opb_intc
  2101. PARAMETER INSTANCE = opb_intc_0
  2102. PARAMETER HW_VER = 1.00.c
  2103. PARAMETER C_BASEADDR = 0xD1000FC0
  2104. PARAMETER C_HIGHADDR = 0xD1000FDF
  2105. BUS_INTERFACE SOPB = opb_v20_0
  2106. END
  2107. BEGIN opb_uart16550
  2108. PARAMETER INSTANCE = opb_uart16550_0
  2109. PARAMETER HW_VER = 1.00.d
  2110. PARAMETER C_BASEADDR = 0xa0000000
  2111. PARAMETER C_HIGHADDR = 0xa0001FFF
  2112. BUS_INTERFACE SOPB = opb_v20_0
  2113. END
  2114. BEGIN plb_v34
  2115. PARAMETER INSTANCE = plb_v34_0
  2116. PARAMETER HW_VER = 1.02.a
  2117. END
  2118. BEGIN plb_bram_if_cntlr
  2119. PARAMETER INSTANCE = plb_bram_if_cntlr_0
  2120. PARAMETER HW_VER = 1.00.b
  2121. PARAMETER C_BASEADDR = 0xFFFF0000
  2122. PARAMETER C_HIGHADDR = 0xFFFFFFFF
  2123. BUS_INTERFACE SPLB = plb_v34_0
  2124. END
  2125. BEGIN plb2opb_bridge
  2126. PARAMETER INSTANCE = plb2opb_bridge_0
  2127. PARAMETER HW_VER = 1.01.a
  2128. PARAMETER C_RNG0_BASEADDR = 0x20000000
  2129. PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
  2130. PARAMETER C_RNG1_BASEADDR = 0x60000000
  2131. PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
  2132. PARAMETER C_RNG2_BASEADDR = 0x80000000
  2133. PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
  2134. PARAMETER C_RNG3_BASEADDR = 0xC0000000
  2135. PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
  2136. BUS_INTERFACE SPLB = plb_v34_0
  2137. BUS_INTERFACE MOPB = opb_v20_0
  2138. END
  2139. Gives this device tree (some properties removed for clarity):
  2140. plb@0 {
  2141. #address-cells = <1>;
  2142. #size-cells = <1>;
  2143. compatible = "xlnx,plb-v34-1.02.a";
  2144. device_type = "ibm,plb";
  2145. ranges; // 1:1 translation
  2146. plb_bram_if_cntrl_0: bram@ffff0000 {
  2147. reg = <ffff0000 10000>;
  2148. }
  2149. opb@20000000 {
  2150. #address-cells = <1>;
  2151. #size-cells = <1>;
  2152. ranges = <20000000 20000000 20000000
  2153. 60000000 60000000 20000000
  2154. 80000000 80000000 40000000
  2155. c0000000 c0000000 20000000>;
  2156. opb_uart16550_0: serial@a0000000 {
  2157. reg = <a00000000 2000>;
  2158. };
  2159. opb_intc_0: interrupt-controller@d1000fc0 {
  2160. reg = <d1000fc0 20>;
  2161. };
  2162. };
  2163. };
  2164. That covers the general approach to binding xilinx IP cores into the
  2165. device tree. The following are bindings for specific devices:
  2166. i) Xilinx ML300 Framebuffer
  2167. Simple framebuffer device from the ML300 reference design (also on the
  2168. ML403 reference design as well as others).
  2169. Optional properties:
  2170. - resolution = <xres yres> : pixel resolution of framebuffer. Some
  2171. implementations use a different resolution.
  2172. Default is <d#640 d#480>
  2173. - virt-resolution = <xvirt yvirt> : Size of framebuffer in memory.
  2174. Default is <d#1024 d#480>.
  2175. - rotate-display (empty) : rotate display 180 degrees.
  2176. ii) Xilinx SystemACE
  2177. The Xilinx SystemACE device is used to program FPGAs from an FPGA
  2178. bitstream stored on a CF card. It can also be used as a generic CF
  2179. interface device.
  2180. Optional properties:
  2181. - 8-bit (empty) : Set this property for SystemACE in 8 bit mode
  2182. iii) Xilinx EMAC and Xilinx TEMAC
  2183. Xilinx Ethernet devices. In addition to general xilinx properties
  2184. listed above, nodes for these devices should include a phy-handle
  2185. property, and may include other common network device properties
  2186. like local-mac-address.
  2187. iv) Xilinx Uartlite
  2188. Xilinx uartlite devices are simple fixed speed serial ports.
  2189. Requred properties:
  2190. - current-speed : Baud rate of uartlite
  2191. v) Xilinx hwicap
  2192. Xilinx hwicap devices provide access to the configuration logic
  2193. of the FPGA through the Internal Configuration Access Port
  2194. (ICAP). The ICAP enables partial reconfiguration of the FPGA,
  2195. readback of the configuration information, and some control over
  2196. 'warm boots' of the FPGA fabric.
  2197. Required properties:
  2198. - xlnx,family : The family of the FPGA, necessary since the
  2199. capabilities of the underlying ICAP hardware
  2200. differ between different families. May be
  2201. 'virtex2p', 'virtex4', or 'virtex5'.
  2202. vi) Xilinx Uart 16550
  2203. Xilinx UART 16550 devices are very similar to the NS16550 but with
  2204. different register spacing and an offset from the base address.
  2205. Requred properties:
  2206. - clock-frequency : Frequency of the clock input
  2207. - reg-offset : A value of 3 is required
  2208. - reg-shift : A value of 2 is required
  2209. p) Freescale Synchronous Serial Interface
  2210. The SSI is a serial device that communicates with audio codecs. It can
  2211. be programmed in AC97, I2S, left-justified, or right-justified modes.
  2212. Required properties:
  2213. - compatible : compatible list, containing "fsl,ssi"
  2214. - cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on
  2215. - reg : offset and length of the register set for the device
  2216. - interrupts : <a b> where a is the interrupt number and b is a
  2217. field that represents an encoding of the sense and
  2218. level information for the interrupt. This should be
  2219. encoded based on the information in section 2)
  2220. depending on the type of interrupt controller you
  2221. have.
  2222. - interrupt-parent : the phandle for the interrupt controller that
  2223. services interrupts for this device.
  2224. - fsl,mode : the operating mode for the SSI interface
  2225. "i2s-slave" - I2S mode, SSI is clock slave
  2226. "i2s-master" - I2S mode, SSI is clock master
  2227. "lj-slave" - left-justified mode, SSI is clock slave
  2228. "lj-master" - l.j. mode, SSI is clock master
  2229. "rj-slave" - right-justified mode, SSI is clock slave
  2230. "rj-master" - r.j., SSI is clock master
  2231. "ac97-slave" - AC97 mode, SSI is clock slave
  2232. "ac97-master" - AC97 mode, SSI is clock master
  2233. Optional properties:
  2234. - codec-handle : phandle to a 'codec' node that defines an audio
  2235. codec connected to this SSI. This node is typically
  2236. a child of an I2C or other control node.
  2237. Child 'codec' node required properties:
  2238. - compatible : compatible list, contains the name of the codec
  2239. Child 'codec' node optional properties:
  2240. - clock-frequency : The frequency of the input clock, which typically
  2241. comes from an on-board dedicated oscillator.
  2242. * Freescale 83xx DMA Controller
  2243. Freescale PowerPC 83xx have on chip general purpose DMA controllers.
  2244. Required properties:
  2245. - compatible : compatible list, contains 2 entries, first is
  2246. "fsl,CHIP-dma", where CHIP is the processor
  2247. (mpc8349, mpc8360, etc.) and the second is
  2248. "fsl,elo-dma"
  2249. - reg : <registers mapping for DMA general status reg>
  2250. - ranges : Should be defined as specified in 1) to describe the
  2251. DMA controller channels.
  2252. - cell-index : controller index. 0 for controller @ 0x8100
  2253. - interrupts : <interrupt mapping for DMA IRQ>
  2254. - interrupt-parent : optional, if needed for interrupt mapping
  2255. - DMA channel nodes:
  2256. - compatible : compatible list, contains 2 entries, first is
  2257. "fsl,CHIP-dma-channel", where CHIP is the processor
  2258. (mpc8349, mpc8350, etc.) and the second is
  2259. "fsl,elo-dma-channel"
  2260. - reg : <registers mapping for channel>
  2261. - cell-index : dma channel index starts at 0.
  2262. Optional properties:
  2263. - interrupts : <interrupt mapping for DMA channel IRQ>
  2264. (on 83xx this is expected to be identical to
  2265. the interrupts property of the parent node)
  2266. - interrupt-parent : optional, if needed for interrupt mapping
  2267. Example:
  2268. dma@82a8 {
  2269. #address-cells = <1>;
  2270. #size-cells = <1>;
  2271. compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
  2272. reg = <82a8 4>;
  2273. ranges = <0 8100 1a4>;
  2274. interrupt-parent = <&ipic>;
  2275. interrupts = <47 8>;
  2276. cell-index = <0>;
  2277. dma-channel@0 {
  2278. compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
  2279. cell-index = <0>;
  2280. reg = <0 80>;
  2281. };
  2282. dma-channel@80 {
  2283. compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
  2284. cell-index = <1>;
  2285. reg = <80 80>;
  2286. };
  2287. dma-channel@100 {
  2288. compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
  2289. cell-index = <2>;
  2290. reg = <100 80>;
  2291. };
  2292. dma-channel@180 {
  2293. compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
  2294. cell-index = <3>;
  2295. reg = <180 80>;
  2296. };
  2297. };
  2298. * Freescale 85xx/86xx DMA Controller
  2299. Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
  2300. Required properties:
  2301. - compatible : compatible list, contains 2 entries, first is
  2302. "fsl,CHIP-dma", where CHIP is the processor
  2303. (mpc8540, mpc8540, etc.) and the second is
  2304. "fsl,eloplus-dma"
  2305. - reg : <registers mapping for DMA general status reg>
  2306. - cell-index : controller index. 0 for controller @ 0x21000,
  2307. 1 for controller @ 0xc000
  2308. - ranges : Should be defined as specified in 1) to describe the
  2309. DMA controller channels.
  2310. - DMA channel nodes:
  2311. - compatible : compatible list, contains 2 entries, first is
  2312. "fsl,CHIP-dma-channel", where CHIP is the processor
  2313. (mpc8540, mpc8560, etc.) and the second is
  2314. "fsl,eloplus-dma-channel"
  2315. - cell-index : dma channel index starts at 0.
  2316. - reg : <registers mapping for channel>
  2317. - interrupts : <interrupt mapping for DMA channel IRQ>
  2318. - interrupt-parent : optional, if needed for interrupt mapping
  2319. Example:
  2320. dma@21300 {
  2321. #address-cells = <1>;
  2322. #size-cells = <1>;
  2323. compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
  2324. reg = <21300 4>;
  2325. ranges = <0 21100 200>;
  2326. cell-index = <0>;
  2327. dma-channel@0 {
  2328. compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
  2329. reg = <0 80>;
  2330. cell-index = <0>;
  2331. interrupt-parent = <&mpic>;
  2332. interrupts = <14 2>;
  2333. };
  2334. dma-channel@80 {
  2335. compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
  2336. reg = <80 80>;
  2337. cell-index = <1>;
  2338. interrupt-parent = <&mpic>;
  2339. interrupts = <15 2>;
  2340. };
  2341. dma-channel@100 {
  2342. compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
  2343. reg = <100 80>;
  2344. cell-index = <2>;
  2345. interrupt-parent = <&mpic>;
  2346. interrupts = <16 2>;
  2347. };
  2348. dma-channel@180 {
  2349. compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
  2350. reg = <180 80>;
  2351. cell-index = <3>;
  2352. interrupt-parent = <&mpic>;
  2353. interrupts = <17 2>;
  2354. };
  2355. };
  2356. * Freescale 8xxx/3.0 Gb/s SATA nodes
  2357. SATA nodes are defined to describe on-chip Serial ATA controllers.
  2358. Each SATA port should have its own node.
  2359. Required properties:
  2360. - compatible : compatible list, contains 2 entries, first is
  2361. "fsl,CHIP-sata", where CHIP is the processor
  2362. (mpc8315, mpc8379, etc.) and the second is
  2363. "fsl,pq-sata"
  2364. - interrupts : <interrupt mapping for SATA IRQ>
  2365. - cell-index : controller index.
  2366. 1 for controller @ 0x18000
  2367. 2 for controller @ 0x19000
  2368. 3 for controller @ 0x1a000
  2369. 4 for controller @ 0x1b000
  2370. Optional properties:
  2371. - interrupt-parent : optional, if needed for interrupt mapping
  2372. - reg : <registers mapping>
  2373. Example:
  2374. sata@18000 {
  2375. compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
  2376. reg = <0x18000 0x1000>;
  2377. cell-index = <1>;
  2378. interrupts = <2c 8>;
  2379. interrupt-parent = < &ipic >;
  2380. };
  2381. q) USB EHCI controllers
  2382. Required properties:
  2383. - compatible : should be "usb-ehci".
  2384. - reg : should contain at least address and length of the standard EHCI
  2385. register set for the device. Optional platform-dependent registers
  2386. (debug-port or other) can be also specified here, but only after
  2387. definition of standard EHCI registers.
  2388. - interrupts : one EHCI interrupt should be described here.
  2389. If device registers are implemented in big endian mode, the device
  2390. node should have "big-endian-regs" property.
  2391. If controller implementation operates with big endian descriptors,
  2392. "big-endian-desc" property should be specified.
  2393. If both big endian registers and descriptors are used by the controller
  2394. implementation, "big-endian" property can be specified instead of having
  2395. both "big-endian-regs" and "big-endian-desc".
  2396. Example (Sequoia 440EPx):
  2397. ehci@e0000300 {
  2398. compatible = "ibm,usb-ehci-440epx", "usb-ehci";
  2399. interrupt-parent = <&UIC0>;
  2400. interrupts = <1a 4>;
  2401. reg = <0 e0000300 90 0 e0000390 70>;
  2402. big-endian;
  2403. };
  2404. r) Freescale Display Interface Unit
  2405. The Freescale DIU is a LCD controller, with proper hardware, it can also
  2406. drive DVI monitors.
  2407. Required properties:
  2408. - compatible : should be "fsl-diu".
  2409. - reg : should contain at least address and length of the DIU register
  2410. set.
  2411. - Interrupts : one DIU interrupt should be describe here.
  2412. Example (MPC8610HPCD)
  2413. display@2c000 {
  2414. compatible = "fsl,diu";
  2415. reg = <0x2c000 100>;
  2416. interrupts = <72 2>;
  2417. interrupt-parent = <&mpic>;
  2418. };
  2419. s) Freescale on board FPGA
  2420. This is the memory-mapped registers for on board FPGA.
  2421. Required properities:
  2422. - compatible : should be "fsl,fpga-pixis".
  2423. - reg : should contain the address and the lenght of the FPPGA register
  2424. set.
  2425. Example (MPC8610HPCD)
  2426. board-control@e8000000 {
  2427. compatible = "fsl,fpga-pixis";
  2428. reg = <0xe8000000 32>;
  2429. };
  2430. t) Freescale MSI interrupt controller
  2431. Reguired properities:
  2432. - compatible : compatible list, contains 2 entries,
  2433. first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
  2434. etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on
  2435. the parent type.
  2436. - reg : should contain the address and the length of the shared message
  2437. interrupt register set.
  2438. - msi-available-ranges: use <start count> style section to define which
  2439. msi interrupt can be used in the 256 msi interrupts. This property is
  2440. optional, without this, all the 256 MSI interrupts can be used.
  2441. - interrupts : each one of the interrupts here is one entry per 32 MSIs,
  2442. and routed to the host interrupt controller. the interrupts should
  2443. be set as edge sensitive.
  2444. - interrupt-parent: the phandle for the interrupt controller
  2445. that services interrupts for this device. for 83xx cpu, the interrupts
  2446. are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed
  2447. to MPIC.
  2448. Example
  2449. msi@41600 {
  2450. compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
  2451. reg = <0x41600 0x80>;
  2452. msi-available-ranges = <0 0x100>;
  2453. interrupts = <
  2454. 0xe0 0
  2455. 0xe1 0
  2456. 0xe2 0
  2457. 0xe3 0
  2458. 0xe4 0
  2459. 0xe5 0
  2460. 0xe6 0
  2461. 0xe7 0>;
  2462. interrupt-parent = <&mpic>;
  2463. };
  2464. u) Freescale General-purpose Timers Module
  2465. Required properties:
  2466. - compatible : should be
  2467. "fsl,<chip>-gtm", "fsl,gtm" for SOC GTMs
  2468. "fsl,<chip>-qe-gtm", "fsl,qe-gtm", "fsl,gtm" for QE GTMs
  2469. "fsl,<chip>-cpm2-gtm", "fsl,cpm2-gtm", "fsl,gtm" for CPM2 GTMs
  2470. - reg : should contain gtm registers location and length (0x40).
  2471. - interrupts : should contain four interrupts.
  2472. - interrupt-parent : interrupt source phandle.
  2473. - clock-frequency : specifies the frequency driving the timer.
  2474. Example:
  2475. timer@500 {
  2476. compatible = "fsl,mpc8360-gtm", "fsl,gtm";
  2477. reg = <0x500 0x40>;
  2478. interrupts = <90 8 78 8 84 8 72 8>;
  2479. interrupt-parent = <&ipic>;
  2480. /* filled by u-boot */
  2481. clock-frequency = <0>;
  2482. };
  2483. timer@440 {
  2484. compatible = "fsl,mpc8360-qe-gtm", "fsl,qe-gtm", "fsl,gtm";
  2485. reg = <0x440 0x40>;
  2486. interrupts = <12 13 14 15>;
  2487. interrupt-parent = <&qeic>;
  2488. /* filled by u-boot */
  2489. clock-frequency = <0>;
  2490. };
  2491. VII - Marvell Discovery mv64[345]6x System Controller chips
  2492. ===========================================================
  2493. The Marvell mv64[345]60 series of system controller chips contain
  2494. many of the peripherals needed to implement a complete computer
  2495. system. In this section, we define device tree nodes to describe
  2496. the system controller chip itself and each of the peripherals
  2497. which it contains. Compatible string values for each node are
  2498. prefixed with the string "marvell,", for Marvell Technology Group Ltd.
  2499. 1) The /system-controller node
  2500. This node is used to represent the system-controller and must be
  2501. present when the system uses a system contller chip. The top-level
  2502. system-controller node contains information that is global to all
  2503. devices within the system controller chip. The node name begins
  2504. with "system-controller" followed by the unit address, which is
  2505. the base address of the memory-mapped register set for the system
  2506. controller chip.
  2507. Required properties:
  2508. - ranges : Describes the translation of system controller addresses
  2509. for memory mapped registers.
  2510. - clock-frequency: Contains the main clock frequency for the system
  2511. controller chip.
  2512. - reg : This property defines the address and size of the
  2513. memory-mapped registers contained within the system controller
  2514. chip. The address specified in the "reg" property should match
  2515. the unit address of the system-controller node.
  2516. - #address-cells : Address representation for system controller
  2517. devices. This field represents the number of cells needed to
  2518. represent the address of the memory-mapped registers of devices
  2519. within the system controller chip.
  2520. - #size-cells : Size representation for for the memory-mapped
  2521. registers within the system controller chip.
  2522. - #interrupt-cells : Defines the width of cells used to represent
  2523. interrupts.
  2524. Optional properties:
  2525. - model : The specific model of the system controller chip. Such
  2526. as, "mv64360", "mv64460", or "mv64560".
  2527. - compatible : A string identifying the compatibility identifiers
  2528. of the system controller chip.
  2529. The system-controller node contains child nodes for each system
  2530. controller device that the platform uses. Nodes should not be created
  2531. for devices which exist on the system controller chip but are not used
  2532. Example Marvell Discovery mv64360 system-controller node:
  2533. system-controller@f1000000 { /* Marvell Discovery mv64360 */
  2534. #address-cells = <1>;
  2535. #size-cells = <1>;
  2536. model = "mv64360"; /* Default */
  2537. compatible = "marvell,mv64360";
  2538. clock-frequency = <133333333>;
  2539. reg = <0xf1000000 0x10000>;
  2540. virtual-reg = <0xf1000000>;
  2541. ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
  2542. 0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
  2543. 0xa0000000 0xa0000000 0x4000000 /* User FLASH */
  2544. 0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
  2545. 0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
  2546. [ child node definitions... ]
  2547. }
  2548. 2) Child nodes of /system-controller
  2549. a) Marvell Discovery MDIO bus
  2550. The MDIO is a bus to which the PHY devices are connected. For each
  2551. device that exists on this bus, a child node should be created. See
  2552. the definition of the PHY node below for an example of how to define
  2553. a PHY.
  2554. Required properties:
  2555. - #address-cells : Should be <1>
  2556. - #size-cells : Should be <0>
  2557. - device_type : Should be "mdio"
  2558. - compatible : Should be "marvell,mv64360-mdio"
  2559. Example:
  2560. mdio {
  2561. #address-cells = <1>;
  2562. #size-cells = <0>;
  2563. device_type = "mdio";
  2564. compatible = "marvell,mv64360-mdio";
  2565. ethernet-phy@0 {
  2566. ......
  2567. };
  2568. };
  2569. b) Marvell Discovery ethernet controller
  2570. The Discover ethernet controller is described with two levels
  2571. of nodes. The first level describes an ethernet silicon block
  2572. and the second level describes up to 3 ethernet nodes within
  2573. that block. The reason for the multiple levels is that the
  2574. registers for the node are interleaved within a single set
  2575. of registers. The "ethernet-block" level describes the
  2576. shared register set, and the "ethernet" nodes describe ethernet
  2577. port-specific properties.
  2578. Ethernet block node
  2579. Required properties:
  2580. - #address-cells : <1>
  2581. - #size-cells : <0>
  2582. - compatible : "marvell,mv64360-eth-block"
  2583. - reg : Offset and length of the register set for this block
  2584. Example Discovery Ethernet block node:
  2585. ethernet-block@2000 {
  2586. #address-cells = <1>;
  2587. #size-cells = <0>;
  2588. compatible = "marvell,mv64360-eth-block";
  2589. reg = <0x2000 0x2000>;
  2590. ethernet@0 {
  2591. .......
  2592. };
  2593. };
  2594. Ethernet port node
  2595. Required properties:
  2596. - device_type : Should be "network".
  2597. - compatible : Should be "marvell,mv64360-eth".
  2598. - reg : Should be <0>, <1>, or <2>, according to which registers
  2599. within the silicon block the device uses.
  2600. - interrupts : <a> where a is the interrupt number for the port.
  2601. - interrupt-parent : the phandle for the interrupt controller
  2602. that services interrupts for this device.
  2603. - phy : the phandle for the PHY connected to this ethernet
  2604. controller.
  2605. - local-mac-address : 6 bytes, MAC address
  2606. Example Discovery Ethernet port node:
  2607. ethernet@0 {
  2608. device_type = "network";
  2609. compatible = "marvell,mv64360-eth";
  2610. reg = <0>;
  2611. interrupts = <32>;
  2612. interrupt-parent = <&PIC>;
  2613. phy = <&PHY0>;
  2614. local-mac-address = [ 00 00 00 00 00 00 ];
  2615. };
  2616. c) Marvell Discovery PHY nodes
  2617. Required properties:
  2618. - device_type : Should be "ethernet-phy"
  2619. - interrupts : <a> where a is the interrupt number for this phy.
  2620. - interrupt-parent : the phandle for the interrupt controller that
  2621. services interrupts for this device.
  2622. - reg : The ID number for the phy, usually a small integer
  2623. Example Discovery PHY node:
  2624. ethernet-phy@1 {
  2625. device_type = "ethernet-phy";
  2626. compatible = "broadcom,bcm5421";
  2627. interrupts = <76>; /* GPP 12 */
  2628. interrupt-parent = <&PIC>;
  2629. reg = <1>;
  2630. };
  2631. d) Marvell Discovery SDMA nodes
  2632. Represent DMA hardware associated with the MPSC (multiprotocol
  2633. serial controllers).
  2634. Required properties:
  2635. - compatible : "marvell,mv64360-sdma"
  2636. - reg : Offset and length of the register set for this device
  2637. - interrupts : <a> where a is the interrupt number for the DMA
  2638. device.
  2639. - interrupt-parent : the phandle for the interrupt controller
  2640. that services interrupts for this device.
  2641. Example Discovery SDMA node:
  2642. sdma@4000 {
  2643. compatible = "marvell,mv64360-sdma";
  2644. reg = <0x4000 0xc18>;
  2645. virtual-reg = <0xf1004000>;
  2646. interrupts = <36>;
  2647. interrupt-parent = <&PIC>;
  2648. };
  2649. e) Marvell Discovery BRG nodes
  2650. Represent baud rate generator hardware associated with the MPSC
  2651. (multiprotocol serial controllers).
  2652. Required properties:
  2653. - compatible : "marvell,mv64360-brg"
  2654. - reg : Offset and length of the register set for this device
  2655. - clock-src : A value from 0 to 15 which selects the clock
  2656. source for the baud rate generator. This value corresponds
  2657. to the CLKS value in the BRGx configuration register. See
  2658. the mv64x60 User's Manual.
  2659. - clock-frequence : The frequency (in Hz) of the baud rate
  2660. generator's input clock.
  2661. - current-speed : The current speed setting (presumably by
  2662. firmware) of the baud rate generator.
  2663. Example Discovery BRG node:
  2664. brg@b200 {
  2665. compatible = "marvell,mv64360-brg";
  2666. reg = <0xb200 0x8>;
  2667. clock-src = <8>;
  2668. clock-frequency = <133333333>;
  2669. current-speed = <9600>;
  2670. };
  2671. f) Marvell Discovery CUNIT nodes
  2672. Represent the Serial Communications Unit device hardware.
  2673. Required properties:
  2674. - reg : Offset and length of the register set for this device
  2675. Example Discovery CUNIT node:
  2676. cunit@f200 {
  2677. reg = <0xf200 0x200>;
  2678. };
  2679. g) Marvell Discovery MPSCROUTING nodes
  2680. Represent the Discovery's MPSC routing hardware
  2681. Required properties:
  2682. - reg : Offset and length of the register set for this device
  2683. Example Discovery CUNIT node:
  2684. mpscrouting@b500 {
  2685. reg = <0xb400 0xc>;
  2686. };
  2687. h) Marvell Discovery MPSCINTR nodes
  2688. Represent the Discovery's MPSC DMA interrupt hardware registers
  2689. (SDMA cause and mask registers).
  2690. Required properties:
  2691. - reg : Offset and length of the register set for this device
  2692. Example Discovery MPSCINTR node:
  2693. mpsintr@b800 {
  2694. reg = <0xb800 0x100>;
  2695. };
  2696. i) Marvell Discovery MPSC nodes
  2697. Represent the Discovery's MPSC (Multiprotocol Serial Controller)
  2698. serial port.
  2699. Required properties:
  2700. - device_type : "serial"
  2701. - compatible : "marvell,mv64360-mpsc"
  2702. - reg : Offset and length of the register set for this device
  2703. - sdma : the phandle for the SDMA node used by this port
  2704. - brg : the phandle for the BRG node used by this port
  2705. - cunit : the phandle for the CUNIT node used by this port
  2706. - mpscrouting : the phandle for the MPSCROUTING node used by this port
  2707. - mpscintr : the phandle for the MPSCINTR node used by this port
  2708. - cell-index : the hardware index of this cell in the MPSC core
  2709. - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
  2710. register
  2711. - interrupts : <a> where a is the interrupt number for the MPSC.
  2712. - interrupt-parent : the phandle for the interrupt controller
  2713. that services interrupts for this device.
  2714. Example Discovery MPSCINTR node:
  2715. mpsc@8000 {
  2716. device_type = "serial";
  2717. compatible = "marvell,mv64360-mpsc";
  2718. reg = <0x8000 0x38>;
  2719. virtual-reg = <0xf1008000>;
  2720. sdma = <&SDMA0>;
  2721. brg = <&BRG0>;
  2722. cunit = <&CUNIT>;
  2723. mpscrouting = <&MPSCROUTING>;
  2724. mpscintr = <&MPSCINTR>;
  2725. cell-index = <0>;
  2726. max_idle = <40>;
  2727. interrupts = <40>;
  2728. interrupt-parent = <&PIC>;
  2729. };
  2730. j) Marvell Discovery Watch Dog Timer nodes
  2731. Represent the Discovery's watchdog timer hardware
  2732. Required properties:
  2733. - compatible : "marvell,mv64360-wdt"
  2734. - reg : Offset and length of the register set for this device
  2735. Example Discovery Watch Dog Timer node:
  2736. wdt@b410 {
  2737. compatible = "marvell,mv64360-wdt";
  2738. reg = <0xb410 0x8>;
  2739. };
  2740. k) Marvell Discovery I2C nodes
  2741. Represent the Discovery's I2C hardware
  2742. Required properties:
  2743. - device_type : "i2c"
  2744. - compatible : "marvell,mv64360-i2c"
  2745. - reg : Offset and length of the register set for this device
  2746. - interrupts : <a> where a is the interrupt number for the I2C.
  2747. - interrupt-parent : the phandle for the interrupt controller
  2748. that services interrupts for this device.
  2749. Example Discovery I2C node:
  2750. compatible = "marvell,mv64360-i2c";
  2751. reg = <0xc000 0x20>;
  2752. virtual-reg = <0xf100c000>;
  2753. interrupts = <37>;
  2754. interrupt-parent = <&PIC>;
  2755. };
  2756. l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
  2757. Represent the Discovery's PIC hardware
  2758. Required properties:
  2759. - #interrupt-cells : <1>
  2760. - #address-cells : <0>
  2761. - compatible : "marvell,mv64360-pic"
  2762. - reg : Offset and length of the register set for this device
  2763. - interrupt-controller
  2764. Example Discovery PIC node:
  2765. pic {
  2766. #interrupt-cells = <1>;
  2767. #address-cells = <0>;
  2768. compatible = "marvell,mv64360-pic";
  2769. reg = <0x0 0x88>;
  2770. interrupt-controller;
  2771. };
  2772. m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
  2773. Represent the Discovery's MPP hardware
  2774. Required properties:
  2775. - compatible : "marvell,mv64360-mpp"
  2776. - reg : Offset and length of the register set for this device
  2777. Example Discovery MPP node:
  2778. mpp@f000 {
  2779. compatible = "marvell,mv64360-mpp";
  2780. reg = <0xf000 0x10>;
  2781. };
  2782. n) Marvell Discovery GPP (General Purpose Pins) nodes
  2783. Represent the Discovery's GPP hardware
  2784. Required properties:
  2785. - compatible : "marvell,mv64360-gpp"
  2786. - reg : Offset and length of the register set for this device
  2787. Example Discovery GPP node:
  2788. gpp@f000 {
  2789. compatible = "marvell,mv64360-gpp";
  2790. reg = <0xf100 0x20>;
  2791. };
  2792. o) Marvell Discovery PCI host bridge node
  2793. Represents the Discovery's PCI host bridge device. The properties
  2794. for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
  2795. 1275-1994. A typical value for the compatible property is
  2796. "marvell,mv64360-pci".
  2797. Example Discovery PCI host bridge node
  2798. pci@80000000 {
  2799. #address-cells = <3>;
  2800. #size-cells = <2>;
  2801. #interrupt-cells = <1>;
  2802. device_type = "pci";
  2803. compatible = "marvell,mv64360-pci";
  2804. reg = <0xcf8 0x8>;
  2805. ranges = <0x01000000 0x0 0x0
  2806. 0x88000000 0x0 0x01000000
  2807. 0x02000000 0x0 0x80000000
  2808. 0x80000000 0x0 0x08000000>;
  2809. bus-range = <0 255>;
  2810. clock-frequency = <66000000>;
  2811. interrupt-parent = <&PIC>;
  2812. interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
  2813. interrupt-map = <
  2814. /* IDSEL 0x0a */
  2815. 0x5000 0 0 1 &PIC 80
  2816. 0x5000 0 0 2 &PIC 81
  2817. 0x5000 0 0 3 &PIC 91
  2818. 0x5000 0 0 4 &PIC 93
  2819. /* IDSEL 0x0b */
  2820. 0x5800 0 0 1 &PIC 91
  2821. 0x5800 0 0 2 &PIC 93
  2822. 0x5800 0 0 3 &PIC 80
  2823. 0x5800 0 0 4 &PIC 81
  2824. /* IDSEL 0x0c */
  2825. 0x6000 0 0 1 &PIC 91
  2826. 0x6000 0 0 2 &PIC 93
  2827. 0x6000 0 0 3 &PIC 80
  2828. 0x6000 0 0 4 &PIC 81
  2829. /* IDSEL 0x0d */
  2830. 0x6800 0 0 1 &PIC 93
  2831. 0x6800 0 0 2 &PIC 80
  2832. 0x6800 0 0 3 &PIC 81
  2833. 0x6800 0 0 4 &PIC 91
  2834. >;
  2835. };
  2836. p) Marvell Discovery CPU Error nodes
  2837. Represent the Discovery's CPU error handler device.
  2838. Required properties:
  2839. - compatible : "marvell,mv64360-cpu-error"
  2840. - reg : Offset and length of the register set for this device
  2841. - interrupts : the interrupt number for this device
  2842. - interrupt-parent : the phandle for the interrupt controller
  2843. that services interrupts for this device.
  2844. Example Discovery CPU Error node:
  2845. cpu-error@0070 {
  2846. compatible = "marvell,mv64360-cpu-error";
  2847. reg = <0x70 0x10 0x128 0x28>;
  2848. interrupts = <3>;
  2849. interrupt-parent = <&PIC>;
  2850. };
  2851. q) Marvell Discovery SRAM Controller nodes
  2852. Represent the Discovery's SRAM controller device.
  2853. Required properties:
  2854. - compatible : "marvell,mv64360-sram-ctrl"
  2855. - reg : Offset and length of the register set for this device
  2856. - interrupts : the interrupt number for this device
  2857. - interrupt-parent : the phandle for the interrupt controller
  2858. that services interrupts for this device.
  2859. Example Discovery SRAM Controller node:
  2860. sram-ctrl@0380 {
  2861. compatible = "marvell,mv64360-sram-ctrl";
  2862. reg = <0x380 0x80>;
  2863. interrupts = <13>;
  2864. interrupt-parent = <&PIC>;
  2865. };
  2866. r) Marvell Discovery PCI Error Handler nodes
  2867. Represent the Discovery's PCI error handler device.
  2868. Required properties:
  2869. - compatible : "marvell,mv64360-pci-error"
  2870. - reg : Offset and length of the register set for this device
  2871. - interrupts : the interrupt number for this device
  2872. - interrupt-parent : the phandle for the interrupt controller
  2873. that services interrupts for this device.
  2874. Example Discovery PCI Error Handler node:
  2875. pci-error@1d40 {
  2876. compatible = "marvell,mv64360-pci-error";
  2877. reg = <0x1d40 0x40 0xc28 0x4>;
  2878. interrupts = <12>;
  2879. interrupt-parent = <&PIC>;
  2880. };
  2881. s) Marvell Discovery Memory Controller nodes
  2882. Represent the Discovery's memory controller device.
  2883. Required properties:
  2884. - compatible : "marvell,mv64360-mem-ctrl"
  2885. - reg : Offset and length of the register set for this device
  2886. - interrupts : the interrupt number for this device
  2887. - interrupt-parent : the phandle for the interrupt controller
  2888. that services interrupts for this device.
  2889. Example Discovery Memory Controller node:
  2890. mem-ctrl@1400 {
  2891. compatible = "marvell,mv64360-mem-ctrl";
  2892. reg = <0x1400 0x60>;
  2893. interrupts = <17>;
  2894. interrupt-parent = <&PIC>;
  2895. };
  2896. VIII - Specifying interrupt information for devices
  2897. ===================================================
  2898. The device tree represents the busses and devices of a hardware
  2899. system in a form similar to the physical bus topology of the
  2900. hardware.
  2901. In addition, a logical 'interrupt tree' exists which represents the
  2902. hierarchy and routing of interrupts in the hardware.
  2903. The interrupt tree model is fully described in the
  2904. document "Open Firmware Recommended Practice: Interrupt
  2905. Mapping Version 0.9". The document is available at:
  2906. <http://playground.sun.com/1275/practice>.
  2907. 1) interrupts property
  2908. ----------------------
  2909. Devices that generate interrupts to a single interrupt controller
  2910. should use the conventional OF representation described in the
  2911. OF interrupt mapping documentation.
  2912. Each device which generates interrupts must have an 'interrupt'
  2913. property. The interrupt property value is an arbitrary number of
  2914. of 'interrupt specifier' values which describe the interrupt or
  2915. interrupts for the device.
  2916. The encoding of an interrupt specifier is determined by the
  2917. interrupt domain in which the device is located in the
  2918. interrupt tree. The root of an interrupt domain specifies in
  2919. its #interrupt-cells property the number of 32-bit cells
  2920. required to encode an interrupt specifier. See the OF interrupt
  2921. mapping documentation for a detailed description of domains.
  2922. For example, the binding for the OpenPIC interrupt controller
  2923. specifies an #interrupt-cells value of 2 to encode the interrupt
  2924. number and level/sense information. All interrupt children in an
  2925. OpenPIC interrupt domain use 2 cells per interrupt in their interrupts
  2926. property.
  2927. The PCI bus binding specifies a #interrupt-cell value of 1 to encode
  2928. which interrupt pin (INTA,INTB,INTC,INTD) is used.
  2929. 2) interrupt-parent property
  2930. ----------------------------
  2931. The interrupt-parent property is specified to define an explicit
  2932. link between a device node and its interrupt parent in
  2933. the interrupt tree. The value of interrupt-parent is the
  2934. phandle of the parent node.
  2935. If the interrupt-parent property is not defined for a node, it's
  2936. interrupt parent is assumed to be an ancestor in the node's
  2937. _device tree_ hierarchy.
  2938. 3) OpenPIC Interrupt Controllers
  2939. --------------------------------
  2940. OpenPIC interrupt controllers require 2 cells to encode
  2941. interrupt information. The first cell defines the interrupt
  2942. number. The second cell defines the sense and level
  2943. information.
  2944. Sense and level information should be encoded as follows:
  2945. 0 = low to high edge sensitive type enabled
  2946. 1 = active low level sensitive type enabled
  2947. 2 = active high level sensitive type enabled
  2948. 3 = high to low edge sensitive type enabled
  2949. 4) ISA Interrupt Controllers
  2950. ----------------------------
  2951. ISA PIC interrupt controllers require 2 cells to encode
  2952. interrupt information. The first cell defines the interrupt
  2953. number. The second cell defines the sense and level
  2954. information.
  2955. ISA PIC interrupt controllers should adhere to the ISA PIC
  2956. encodings listed below:
  2957. 0 = active low level sensitive type enabled
  2958. 1 = active high level sensitive type enabled
  2959. 2 = high to low edge sensitive type enabled
  2960. 3 = low to high edge sensitive type enabled
  2961. VIII - Specifying GPIO information for devices
  2962. ==============================================
  2963. 1) gpios property
  2964. -----------------
  2965. Nodes that makes use of GPIOs should define them using `gpios' property,
  2966. format of which is: <&gpio-controller1-phandle gpio1-specifier
  2967. &gpio-controller2-phandle gpio2-specifier
  2968. 0 /* holes are permitted, means no GPIO 3 */
  2969. &gpio-controller4-phandle gpio4-specifier
  2970. ...>;
  2971. Note that gpio-specifier length is controller dependent.
  2972. gpio-specifier may encode: bank, pin position inside the bank,
  2973. whether pin is open-drain and whether pin is logically inverted.
  2974. Example of the node using GPIOs:
  2975. node {
  2976. gpios = <&qe_pio_e 18 0>;
  2977. };
  2978. In this example gpio-specifier is "18 0" and encodes GPIO pin number,
  2979. and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
  2980. 2) gpio-controller nodes
  2981. ------------------------
  2982. Every GPIO controller node must have #gpio-cells property defined,
  2983. this information will be used to translate gpio-specifiers.
  2984. Example of two SOC GPIO banks defined as gpio-controller nodes:
  2985. qe_pio_a: gpio-controller@1400 {
  2986. #gpio-cells = <2>;
  2987. compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
  2988. reg = <0x1400 0x18>;
  2989. gpio-controller;
  2990. };
  2991. qe_pio_e: gpio-controller@1460 {
  2992. #gpio-cells = <2>;
  2993. compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
  2994. reg = <0x1460 0x18>;
  2995. gpio-controller;
  2996. };
  2997. Appendix A - Sample SOC node for MPC8540
  2998. ========================================
  2999. Note that the #address-cells and #size-cells for the SoC node
  3000. in this example have been explicitly listed; these are likely
  3001. not necessary as they are usually the same as the root node.
  3002. soc8540@e0000000 {
  3003. #address-cells = <1>;
  3004. #size-cells = <1>;
  3005. #interrupt-cells = <2>;
  3006. device_type = "soc";
  3007. ranges = <00000000 e0000000 00100000>
  3008. reg = <e0000000 00003000>;
  3009. bus-frequency = <0>;
  3010. mdio@24520 {
  3011. reg = <24520 20>;
  3012. device_type = "mdio";
  3013. compatible = "gianfar";
  3014. ethernet-phy@0 {
  3015. linux,phandle = <2452000>
  3016. interrupt-parent = <40000>;
  3017. interrupts = <35 1>;
  3018. reg = <0>;
  3019. device_type = "ethernet-phy";
  3020. };
  3021. ethernet-phy@1 {
  3022. linux,phandle = <2452001>
  3023. interrupt-parent = <40000>;
  3024. interrupts = <35 1>;
  3025. reg = <1>;
  3026. device_type = "ethernet-phy";
  3027. };
  3028. ethernet-phy@3 {
  3029. linux,phandle = <2452002>
  3030. interrupt-parent = <40000>;
  3031. interrupts = <35 1>;
  3032. reg = <3>;
  3033. device_type = "ethernet-phy";
  3034. };
  3035. };
  3036. ethernet@24000 {
  3037. #size-cells = <0>;
  3038. device_type = "network";
  3039. model = "TSEC";
  3040. compatible = "gianfar";
  3041. reg = <24000 1000>;
  3042. mac-address = [ 00 E0 0C 00 73 00 ];
  3043. interrupts = <d 3 e 3 12 3>;
  3044. interrupt-parent = <40000>;
  3045. phy-handle = <2452000>;
  3046. };
  3047. ethernet@25000 {
  3048. #address-cells = <1>;
  3049. #size-cells = <0>;
  3050. device_type = "network";
  3051. model = "TSEC";
  3052. compatible = "gianfar";
  3053. reg = <25000 1000>;
  3054. mac-address = [ 00 E0 0C 00 73 01 ];
  3055. interrupts = <13 3 14 3 18 3>;
  3056. interrupt-parent = <40000>;
  3057. phy-handle = <2452001>;
  3058. };
  3059. ethernet@26000 {
  3060. #address-cells = <1>;
  3061. #size-cells = <0>;
  3062. device_type = "network";
  3063. model = "FEC";
  3064. compatible = "gianfar";
  3065. reg = <26000 1000>;
  3066. mac-address = [ 00 E0 0C 00 73 02 ];
  3067. interrupts = <19 3>;
  3068. interrupt-parent = <40000>;
  3069. phy-handle = <2452002>;
  3070. };
  3071. serial@4500 {
  3072. device_type = "serial";
  3073. compatible = "ns16550";
  3074. reg = <4500 100>;
  3075. clock-frequency = <0>;
  3076. interrupts = <1a 3>;
  3077. interrupt-parent = <40000>;
  3078. };
  3079. pic@40000 {
  3080. linux,phandle = <40000>;
  3081. interrupt-controller;
  3082. #address-cells = <0>;
  3083. reg = <40000 40000>;
  3084. compatible = "chrp,open-pic";
  3085. device_type = "open-pic";
  3086. };
  3087. i2c@3000 {
  3088. interrupt-parent = <40000>;
  3089. interrupts = <1b 3>;
  3090. reg = <3000 18>;
  3091. device_type = "i2c";
  3092. compatible = "fsl-i2c";
  3093. dfsrr;
  3094. };
  3095. };