mpc52xx-device-tree-bindings.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. MPC52xx Device Tree Bindings
  2. ----------------------------
  3. (c) 2006 Secret Lab Technologies Ltd
  4. Grant Likely <grant.likely at secretlab.ca>
  5. ********** DRAFT ***********
  6. * WARNING: Do not depend on the stability of these bindings just yet.
  7. * The MPC5200 device tree conventions are still in flux
  8. * Keep an eye on the linuxppc-dev mailing list for more details
  9. ********** DRAFT ***********
  10. I - Introduction
  11. ================
  12. Boards supported by the arch/powerpc architecture require device tree be
  13. passed by the boot loader to the kernel at boot time. The device tree
  14. describes what devices are present on the board and how they are
  15. connected. The device tree can either be passed as a binary blob (as
  16. described in Documentation/powerpc/booting-without-of.txt), or passed
  17. by Open Firmare (IEEE 1275) compatible firmware using an OF compatible
  18. client interface API.
  19. This document specifies the requirements on the device-tree for mpc52xx
  20. based boards. These requirements are above and beyond the details
  21. specified in either the OpenFirmware spec or booting-without-of.txt
  22. All new mpc52xx-based boards are expected to match this document. In
  23. cases where this document is not sufficient to support a new board port,
  24. this document should be updated as part of adding the new board support.
  25. II - Philosophy
  26. ===============
  27. The core of this document is naming convention. The whole point of
  28. defining this convention is to reduce or eliminate the number of
  29. special cases required to support a 52xx board. If all 52xx boards
  30. follow the same convention, then generic 52xx support code will work
  31. rather than coding special cases for each new board.
  32. This section tries to capture the thought process behind why the naming
  33. convention is what it is.
  34. 1. Node names
  35. -------------
  36. There is strong convention/requirements already established for children
  37. of the root node. 'cpus' describes the processor cores, 'memory'
  38. describes memory, and 'chosen' provides boot configuration. Other nodes
  39. are added to describe devices attached to the processor local bus.
  40. Following convention already established with other system-on-chip
  41. processors, MPC52xx boards must have an 'soc5200' node as a child of the
  42. root node.
  43. The soc5200 node holds child nodes for all on chip devices. Child nodes
  44. are typically named after the configured function. ie. the FEC node is
  45. named 'ethernet', and a PSC in uart mode is named 'serial'.
  46. 2. device_type property
  47. -----------------------
  48. similar to the node name convention above; the device_type reflects the
  49. configured function of a device. ie. 'serial' for a uart and 'spi' for
  50. an spi controller. However, while node names *should* reflect the
  51. configured function, device_type *must* match the configured function
  52. exactly.
  53. 3. compatible property
  54. ----------------------
  55. Since device_type isn't enough to match devices to drivers, there also
  56. needs to be a naming convention for the compatible property. Compatible
  57. is an list of device descriptions sorted from specific to generic. For
  58. the mpc52xx, the required format for each compatible value is
  59. <chip>-<device>[-<mode>]. At the minimum, the list shall contain two
  60. items; the first specifying the exact chip, and the second specifying
  61. mpc52xx for the chip.
  62. ie. ethernet on mpc5200b: compatible = "mpc5200b-ethernet\0mpc52xx-ethernet"
  63. The idea here is that most drivers will match to the most generic field
  64. in the compatible list (mpc52xx-*), but can also test the more specific
  65. field for enabling bug fixes or extra features.
  66. Modal devices, like PSCs, also append the configured function to the
  67. end of the compatible field. ie. A PSC in i2s mode would specify
  68. "mpc52xx-psc-i2s", not "mpc52xx-i2s". This convention is chosen to
  69. avoid naming conflicts with non-psc devices providing the same
  70. function. For example, "mpc52xx-spi" and "mpc52xx-psc-spi" describe
  71. the mpc5200 simple spi device and a PSC spi mode respectively.
  72. If the soc device is more generic and present on other SOCs, the
  73. compatible property can specify the more generic device type also.
  74. ie. mscan: compatible = "mpc5200-mscan\0mpc52xx-mscan\0fsl,mscan";
  75. At the time of writing, exact chip may be either 'mpc5200' or
  76. 'mpc5200b'.
  77. Device drivers should always try to match as generically as possible.
  78. III - Structure
  79. ===============
  80. The device tree for an mpc52xx board follows the structure defined in
  81. booting-without-of.txt with the following additional notes:
  82. 0) the root node
  83. ----------------
  84. Typical root description node; see booting-without-of
  85. 1) The cpus node
  86. ----------------
  87. The cpus node follows the basic layout described in booting-without-of.
  88. The bus-frequency property holds the XLB bus frequency
  89. The clock-frequency property holds the core frequency
  90. 2) The memory node
  91. ------------------
  92. Typical memory description node; see booting-without-of.
  93. 3) The soc5200 node
  94. -------------------
  95. This node describes the on chip SOC peripherals. Every mpc52xx based
  96. board will have this node, and as such there is a common naming
  97. convention for SOC devices.
  98. Required properties:
  99. name type description
  100. ---- ---- -----------
  101. device_type string must be "soc"
  102. ranges int should be <0 baseaddr baseaddr+10000>
  103. reg int must be <baseaddr 10000>
  104. Recommended properties:
  105. name type description
  106. ---- ---- -----------
  107. compatible string should be "<chip>-soc\0mpc52xx-soc"
  108. ie. "mpc5200b-soc\0mpc52xx-soc"
  109. #interrupt-cells int must be <3>. If it is not defined
  110. here then it must be defined in every
  111. soc device node.
  112. bus-frequency int IPB bus frequency in HZ. Clock rate
  113. used by most of the soc devices.
  114. Defining it here avoids needing it
  115. added to every device node.
  116. 4) soc5200 child nodes
  117. ----------------------
  118. Any on chip SOC devices available to Linux must appear as soc5200 child nodes.
  119. Note: in the tables below, '*' matches all <chip> values. ie.
  120. *-pic would translate to "mpc5200-pic\0mpc52xx-pic"
  121. Required soc5200 child nodes:
  122. name device_type compatible Description
  123. ---- ----------- ---------- -----------
  124. cdm@<addr> cdm *-cmd Clock Distribution
  125. pic@<addr> interrupt-controller *-pic need an interrupt
  126. controller to boot
  127. bestcomm@<addr> dma-controller *-bestcomm 52xx pic also requires
  128. the bestcomm device
  129. Recommended soc5200 child nodes; populate as needed for your board
  130. name device_type compatible Description
  131. ---- ----------- ---------- -----------
  132. gpt@<addr> gpt *-gpt General purpose timers
  133. rtc@<addr> rtc *-rtc Real time clock
  134. mscan@<addr> mscan *-mscan CAN bus controller
  135. pci@<addr> pci *-pci PCI bridge
  136. serial@<addr> serial *-psc-uart PSC in serial mode
  137. i2s@<addr> sound *-psc-i2s PSC in i2s mode
  138. ac97@<addr> sound *-psc-ac97 PSC in ac97 mode
  139. spi@<addr> spi *-psc-spi PSC in spi mode
  140. irda@<addr> irda *-psc-irda PSC in IrDA mode
  141. spi@<addr> spi *-spi MPC52xx spi device
  142. ethernet@<addr> network *-fec MPC52xx ethernet device
  143. ata@<addr> ata *-ata IDE ATA interface
  144. i2c@<addr> i2c *-i2c I2C controller
  145. usb@<addr> usb-ohci-be *-ohci,ohci-be USB controller
  146. xlb@<addr> xlb *-xlb XLB arbritrator
  147. IV - Extra Notes
  148. ================
  149. 1. Interrupt mapping
  150. --------------------
  151. The mpc52xx pic driver splits hardware IRQ numbers into two levels. The
  152. split reflects the layout of the PIC hardware itself, which groups
  153. interrupts into one of three groups; CRIT, MAIN or PERP. Also, the
  154. Bestcomm dma engine has it's own set of interrupt sources which are
  155. cascaded off of peripheral interrupt 0, which the driver interprets as a
  156. fourth group, SDMA.
  157. The interrupts property for device nodes using the mpc52xx pic consists
  158. of three cells; <L1 L2 level>
  159. L1 := [CRIT=0, MAIN=1, PERP=2, SDMA=3]
  160. L2 := interrupt number; directly mapped from the value in the
  161. "ICTL PerStat, MainStat, CritStat Encoded Register"
  162. level := [LEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3]