mediatek-pcie.txt 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. MediaTek Gen2 PCIe controller
  2. Required properties:
  3. - compatible: Should contain one of the following strings:
  4. "mediatek,mt2701-pcie"
  5. "mediatek,mt2712-pcie"
  6. "mediatek,mt7622-pcie"
  7. "mediatek,mt7623-pcie"
  8. - device_type: Must be "pci"
  9. - reg: Base addresses and lengths of the PCIe subsys and root ports.
  10. - reg-names: Names of the above areas to use during resource lookup.
  11. - #address-cells: Address representation for root ports (must be 3)
  12. - #size-cells: Size representation for root ports (must be 2)
  13. - clocks: Must contain an entry for each entry in clock-names.
  14. See ../clocks/clock-bindings.txt for details.
  15. - clock-names:
  16. Mandatory entries:
  17. - sys_ckN :transaction layer and data link layer clock
  18. Required entries for MT2701/MT7623:
  19. - free_ck :for reference clock of PCIe subsys
  20. Required entries for MT2712/MT7622:
  21. - ahb_ckN :AHB slave interface operating clock for CSR access and RC
  22. initiated MMIO access
  23. Required entries for MT7622:
  24. - axi_ckN :application layer MMIO channel operating clock
  25. - aux_ckN :pe2_mac_bridge and pe2_mac_core operating clock when
  26. pcie_mac_ck/pcie_pipe_ck is turned off
  27. - obff_ckN :OBFF functional block operating clock
  28. - pipe_ckN :LTSSM and PHY/MAC layer operating clock
  29. where N starting from 0 to one less than the number of root ports.
  30. - phys: List of PHY specifiers (used by generic PHY framework).
  31. - phy-names : Must be "pcie-phy0", "pcie-phy1", "pcie-phyN".. based on the
  32. number of PHYs as specified in *phys* property.
  33. - power-domains: A phandle and power domain specifier pair to the power domain
  34. which is responsible for collapsing and restoring power to the peripheral.
  35. - bus-range: Range of bus numbers associated with this controller.
  36. - ranges: Ranges for the PCI memory and I/O regions.
  37. Required properties for MT7623/MT2701:
  38. - #interrupt-cells: Size representation for interrupts (must be 1)
  39. - interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties
  40. Please refer to the standard PCI bus binding document for a more detailed
  41. explanation.
  42. - resets: Must contain an entry for each entry in reset-names.
  43. See ../reset/reset.txt for details.
  44. - reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the
  45. number of root ports.
  46. Required properties for MT2712/MT7622:
  47. -interrupts: A list of interrupt outputs of the controller, must have one
  48. entry for each PCIe port
  49. In addition, the device tree node must have sub-nodes describing each
  50. PCIe port interface, having the following mandatory properties:
  51. Required properties:
  52. - device_type: Must be "pci"
  53. - reg: Only the first four bytes are used to refer to the correct bus number
  54. and device number.
  55. - #address-cells: Must be 3
  56. - #size-cells: Must be 2
  57. - #interrupt-cells: Must be 1
  58. - interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties
  59. Please refer to the standard PCI bus binding document for a more detailed
  60. explanation.
  61. - ranges: Sub-ranges distributed from the PCIe controller node. An empty
  62. property is sufficient.
  63. - num-lanes: Number of lanes to use for this port.
  64. Examples for MT7623:
  65. hifsys: syscon@1a000000 {
  66. compatible = "mediatek,mt7623-hifsys",
  67. "mediatek,mt2701-hifsys",
  68. "syscon";
  69. reg = <0 0x1a000000 0 0x1000>;
  70. #clock-cells = <1>;
  71. #reset-cells = <1>;
  72. };
  73. pcie: pcie@1a140000 {
  74. compatible = "mediatek,mt7623-pcie";
  75. device_type = "pci";
  76. reg = <0 0x1a140000 0 0x1000>, /* PCIe shared registers */
  77. <0 0x1a142000 0 0x1000>, /* Port0 registers */
  78. <0 0x1a143000 0 0x1000>, /* Port1 registers */
  79. <0 0x1a144000 0 0x1000>; /* Port2 registers */
  80. reg-names = "subsys", "port0", "port1", "port2";
  81. #address-cells = <3>;
  82. #size-cells = <2>;
  83. #interrupt-cells = <1>;
  84. interrupt-map-mask = <0xf800 0 0 0>;
  85. interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>,
  86. <0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>,
  87. <0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
  88. clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
  89. <&hifsys CLK_HIFSYS_PCIE0>,
  90. <&hifsys CLK_HIFSYS_PCIE1>,
  91. <&hifsys CLK_HIFSYS_PCIE2>;
  92. clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2";
  93. resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>,
  94. <&hifsys MT2701_HIFSYS_PCIE1_RST>,
  95. <&hifsys MT2701_HIFSYS_PCIE2_RST>;
  96. reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2";
  97. phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>,
  98. <&pcie2_phy PHY_TYPE_PCIE>;
  99. phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2";
  100. power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>;
  101. bus-range = <0x00 0xff>;
  102. ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000 /* I/O space */
  103. 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>; /* memory space */
  104. pcie@0,0 {
  105. reg = <0x0000 0 0 0 0>;
  106. #address-cells = <3>;
  107. #size-cells = <2>;
  108. #interrupt-cells = <1>;
  109. interrupt-map-mask = <0 0 0 0>;
  110. interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>;
  111. ranges;
  112. num-lanes = <1>;
  113. };
  114. pcie@1,0 {
  115. reg = <0x0800 0 0 0 0>;
  116. #address-cells = <3>;
  117. #size-cells = <2>;
  118. #interrupt-cells = <1>;
  119. interrupt-map-mask = <0 0 0 0>;
  120. interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
  121. ranges;
  122. num-lanes = <1>;
  123. };
  124. pcie@2,0 {
  125. reg = <0x1000 0 0 0 0>;
  126. #address-cells = <3>;
  127. #size-cells = <2>;
  128. #interrupt-cells = <1>;
  129. interrupt-map-mask = <0 0 0 0>;
  130. interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
  131. ranges;
  132. num-lanes = <1>;
  133. };
  134. };
  135. Examples for MT2712:
  136. pcie: pcie@11700000 {
  137. compatible = "mediatek,mt2712-pcie";
  138. device_type = "pci";
  139. reg = <0 0x11700000 0 0x1000>,
  140. <0 0x112ff000 0 0x1000>;
  141. reg-names = "port0", "port1";
  142. #address-cells = <3>;
  143. #size-cells = <2>;
  144. interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,
  145. <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
  146. clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>,
  147. <&topckgen CLK_TOP_PE2_MAC_P1_SEL>,
  148. <&pericfg CLK_PERI_PCIE0>,
  149. <&pericfg CLK_PERI_PCIE1>;
  150. clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1";
  151. phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>;
  152. phy-names = "pcie-phy0", "pcie-phy1";
  153. bus-range = <0x00 0xff>;
  154. ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>;
  155. pcie0: pcie@0,0 {
  156. reg = <0x0000 0 0 0 0>;
  157. #address-cells = <3>;
  158. #size-cells = <2>;
  159. #interrupt-cells = <1>;
  160. ranges;
  161. num-lanes = <1>;
  162. interrupt-map-mask = <0 0 0 7>;
  163. interrupt-map = <0 0 0 1 &pcie_intc0 0>,
  164. <0 0 0 2 &pcie_intc0 1>,
  165. <0 0 0 3 &pcie_intc0 2>,
  166. <0 0 0 4 &pcie_intc0 3>;
  167. pcie_intc0: interrupt-controller {
  168. interrupt-controller;
  169. #address-cells = <0>;
  170. #interrupt-cells = <1>;
  171. };
  172. };
  173. pcie1: pcie@1,0 {
  174. reg = <0x0800 0 0 0 0>;
  175. #address-cells = <3>;
  176. #size-cells = <2>;
  177. #interrupt-cells = <1>;
  178. ranges;
  179. num-lanes = <1>;
  180. interrupt-map-mask = <0 0 0 7>;
  181. interrupt-map = <0 0 0 1 &pcie_intc1 0>,
  182. <0 0 0 2 &pcie_intc1 1>,
  183. <0 0 0 3 &pcie_intc1 2>,
  184. <0 0 0 4 &pcie_intc1 3>;
  185. pcie_intc1: interrupt-controller {
  186. interrupt-controller;
  187. #address-cells = <0>;
  188. #interrupt-cells = <1>;
  189. };
  190. };
  191. };
  192. Examples for MT7622:
  193. pcie: pcie@1a140000 {
  194. compatible = "mediatek,mt7622-pcie";
  195. device_type = "pci";
  196. reg = <0 0x1a140000 0 0x1000>,
  197. <0 0x1a143000 0 0x1000>,
  198. <0 0x1a145000 0 0x1000>;
  199. reg-names = "subsys", "port0", "port1";
  200. #address-cells = <3>;
  201. #size-cells = <2>;
  202. interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>,
  203. <GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>;
  204. clocks = <&pciesys CLK_PCIE_P0_MAC_EN>,
  205. <&pciesys CLK_PCIE_P1_MAC_EN>,
  206. <&pciesys CLK_PCIE_P0_AHB_EN>,
  207. <&pciesys CLK_PCIE_P1_AHB_EN>,
  208. <&pciesys CLK_PCIE_P0_AUX_EN>,
  209. <&pciesys CLK_PCIE_P1_AUX_EN>,
  210. <&pciesys CLK_PCIE_P0_AXI_EN>,
  211. <&pciesys CLK_PCIE_P1_AXI_EN>,
  212. <&pciesys CLK_PCIE_P0_OBFF_EN>,
  213. <&pciesys CLK_PCIE_P1_OBFF_EN>,
  214. <&pciesys CLK_PCIE_P0_PIPE_EN>,
  215. <&pciesys CLK_PCIE_P1_PIPE_EN>;
  216. clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1",
  217. "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1",
  218. "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1";
  219. phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>;
  220. phy-names = "pcie-phy0", "pcie-phy1";
  221. power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>;
  222. bus-range = <0x00 0xff>;
  223. ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>;
  224. pcie0: pcie@0,0 {
  225. reg = <0x0000 0 0 0 0>;
  226. #address-cells = <3>;
  227. #size-cells = <2>;
  228. #interrupt-cells = <1>;
  229. ranges;
  230. num-lanes = <1>;
  231. interrupt-map-mask = <0 0 0 7>;
  232. interrupt-map = <0 0 0 1 &pcie_intc0 0>,
  233. <0 0 0 2 &pcie_intc0 1>,
  234. <0 0 0 3 &pcie_intc0 2>,
  235. <0 0 0 4 &pcie_intc0 3>;
  236. pcie_intc0: interrupt-controller {
  237. interrupt-controller;
  238. #address-cells = <0>;
  239. #interrupt-cells = <1>;
  240. };
  241. };
  242. pcie1: pcie@1,0 {
  243. reg = <0x0800 0 0 0 0>;
  244. #address-cells = <3>;
  245. #size-cells = <2>;
  246. #interrupt-cells = <1>;
  247. ranges;
  248. num-lanes = <1>;
  249. interrupt-map-mask = <0 0 0 7>;
  250. interrupt-map = <0 0 0 1 &pcie_intc1 0>,
  251. <0 0 0 2 &pcie_intc1 1>,
  252. <0 0 0 3 &pcie_intc1 2>,
  253. <0 0 0 4 &pcie_intc1 3>;
  254. pcie_intc1: interrupt-controller {
  255. interrupt-controller;
  256. #address-cells = <0>;
  257. #interrupt-cells = <1>;
  258. };
  259. };
  260. };