booting-without-of.txt 132 KB

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