brcm,spi-bcm-qspi.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. Broadcom SPI controller
  2. The Broadcom SPI controller is a SPI master found on various SOCs, including
  3. BRCMSTB (BCM7XXX), Cygnus, NSP and NS2. The Broadcom Master SPI hw IP consits
  4. of :
  5. MSPI : SPI master controller can read and write to a SPI slave device
  6. BSPI : Broadcom SPI in combination with the MSPI hw IP provides acceleration
  7. for flash reads and be configured to do single, double, quad lane
  8. io with 3-byte and 4-byte addressing support.
  9. Supported Broadcom SoCs have one instance of MSPI+BSPI controller IP.
  10. MSPI master can be used wihout BSPI. BRCMSTB SoCs have an additional instance
  11. of a MSPI master without the BSPI to use with non flash slave devices that
  12. use SPI protocol.
  13. Required properties:
  14. - #address-cells:
  15. Must be <1>, as required by generic SPI binding.
  16. - #size-cells:
  17. Must be <0>, also as required by generic SPI binding.
  18. - compatible:
  19. Must be one of :
  20. "brcm,spi-bcm-qspi", "brcm,spi-brcmstb-qspi" : MSPI+BSPI on BRCMSTB SoCs
  21. "brcm,spi-bcm-qspi", "brcm,spi-brcmstb-mspi" : Second Instance of MSPI
  22. BRCMSTB SoCs
  23. "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi" : MSPI+BSPI on Cygnus, NSP
  24. "brcm,spi-bcm-qspi", "brcm,spi-ns2-qspi" : NS2 SoCs
  25. - reg:
  26. Define the bases and ranges of the associated I/O address spaces.
  27. The required range is MSPI controller registers.
  28. - reg-names:
  29. First name does not matter, but must be reserved for the MSPI controller
  30. register range as mentioned in 'reg' above, and will typically contain
  31. - "bspi_regs": BSPI register range, not required with compatible
  32. "spi-brcmstb-mspi"
  33. - "mspi_regs": MSPI register range is required for compatible strings
  34. - "intr_regs", "intr_status_reg" : Interrupt and status register for
  35. NSP, NS2, Cygnus SoC
  36. - interrupts
  37. The interrupts used by the MSPI and/or BSPI controller.
  38. - interrupt-names:
  39. Names of interrupts associated with MSPI
  40. - "mspi_halted" :
  41. - "mspi_done": Indicates that the requested SPI operation is complete.
  42. - "spi_lr_fullness_reached" : Linear read BSPI pipe full
  43. - "spi_lr_session_aborted" : Linear read BSPI pipe aborted
  44. - "spi_lr_impatient" : Linear read BSPI requested when pipe empty
  45. - "spi_lr_session_done" : Linear read BSPI session done
  46. - clocks:
  47. A phandle to the reference clock for this block.
  48. Optional properties:
  49. - native-endian
  50. Defined when using BE SoC and device uses BE register read/write
  51. Recommended optional m25p80 properties:
  52. - spi-rx-bus-width: Definition as per
  53. Documentation/devicetree/bindings/spi/spi-bus.txt
  54. Examples:
  55. BRCMSTB SoC Example:
  56. SPI Master (MSPI+BSPI) for SPI-NOR access:
  57. spi@f03e3400 {
  58. #address-cells = <0x1>;
  59. #size-cells = <0x0>;
  60. compatible = "brcm,spi-brcmstb-qspi", "brcm,spi-brcmstb-qspi";
  61. reg = <0xf03e0920 0x4 0xf03e3400 0x188 0xf03e3200 0x50>;
  62. reg-names = "cs_reg", "mspi", "bspi";
  63. interrupts = <0x6 0x5 0x4 0x3 0x2 0x1 0x0>;
  64. interrupt-parent = <0x1c>;
  65. interrupt-names = "mspi_halted",
  66. "mspi_done",
  67. "spi_lr_overread",
  68. "spi_lr_session_done",
  69. "spi_lr_impatient",
  70. "spi_lr_session_aborted",
  71. "spi_lr_fullness_reached";
  72. clocks = <&hif_spi>;
  73. clock-names = "sw_spi";
  74. m25p80@0 {
  75. #size-cells = <0x2>;
  76. #address-cells = <0x2>;
  77. compatible = "m25p80";
  78. reg = <0x0>;
  79. spi-max-frequency = <0x2625a00>;
  80. spi-cpol;
  81. spi-cpha;
  82. m25p,fast-read;
  83. flash0.bolt@0 {
  84. reg = <0x0 0x0 0x0 0x100000>;
  85. };
  86. flash0.macadr@100000 {
  87. reg = <0x0 0x100000 0x0 0x10000>;
  88. };
  89. flash0.nvram@110000 {
  90. reg = <0x0 0x110000 0x0 0x10000>;
  91. };
  92. flash0.kernel@120000 {
  93. reg = <0x0 0x120000 0x0 0x400000>;
  94. };
  95. flash0.devtree@520000 {
  96. reg = <0x0 0x520000 0x0 0x10000>;
  97. };
  98. flash0.splash@530000 {
  99. reg = <0x0 0x530000 0x0 0x80000>;
  100. };
  101. flash0@0 {
  102. reg = <0x0 0x0 0x0 0x4000000>;
  103. };
  104. };
  105. };
  106. MSPI master for any SPI device :
  107. spi@f0416000 {
  108. #address-cells = <1>;
  109. #size-cells = <0>;
  110. clocks = <&upg_fixed>;
  111. compatible = "brcm,spi-brcmstb-qspi", "brcm,spi-brcmstb-mspi";
  112. reg = <0xf0416000 0x180>;
  113. reg-names = "mspi";
  114. interrupts = <0x14>;
  115. interrupt-parent = <&irq0_aon_intc>;
  116. interrupt-names = "mspi_done";
  117. };
  118. iProc SoC Example:
  119. qspi: spi@18027200 {
  120. compatible = "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi";
  121. reg = <0x18027200 0x184>,
  122. <0x18027000 0x124>,
  123. <0x1811c408 0x004>,
  124. <0x180273a0 0x01c>;
  125. reg-names = "mspi_regs", "bspi_regs", "intr_regs", "intr_status_reg";
  126. interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
  127. <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
  128. <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
  129. <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
  130. <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
  131. <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
  132. <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
  133. interrupt-names =
  134. "spi_lr_fullness_reached",
  135. "spi_lr_session_aborted",
  136. "spi_lr_impatient",
  137. "spi_lr_session_done",
  138. "mspi_done",
  139. "mspi_halted";
  140. clocks = <&iprocmed>;
  141. clock-names = "iprocmed";
  142. num-cs = <2>;
  143. #address-cells = <1>;
  144. #size-cells = <0>;
  145. };
  146. NS2 SoC Example:
  147. qspi: spi@66470200 {
  148. compatible = "brcm,spi-bcm-qspi", "brcm,spi-ns2-qspi";
  149. reg = <0x66470200 0x184>,
  150. <0x66470000 0x124>,
  151. <0x67017408 0x004>,
  152. <0x664703a0 0x01c>;
  153. reg-names = "mspi", "bspi", "intr_regs",
  154. "intr_status_reg";
  155. interrupts = <GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH>;
  156. interrupt-names = "spi_l1_intr";
  157. clocks = <&iprocmed>;
  158. clock-names = "iprocmed";
  159. num-cs = <2>;
  160. #address-cells = <1>;
  161. #size-cells = <0>;
  162. };
  163. m25p80 node for NSP, NS2
  164. &qspi {
  165. flash: m25p80@0 {
  166. #address-cells = <1>;
  167. #size-cells = <1>;
  168. compatible = "m25p80";
  169. reg = <0x0>;
  170. spi-max-frequency = <12500000>;
  171. m25p,fast-read;
  172. spi-cpol;
  173. spi-cpha;
  174. partition@0 {
  175. label = "boot";
  176. reg = <0x00000000 0x000a0000>;
  177. };
  178. partition@a0000 {
  179. label = "env";
  180. reg = <0x000a0000 0x00060000>;
  181. };
  182. partition@100000 {
  183. label = "system";
  184. reg = <0x00100000 0x00600000>;
  185. };
  186. partition@700000 {
  187. label = "rootfs";
  188. reg = <0x00700000 0x01900000>;
  189. };
  190. };