0024-dt-bindings-add-MediaTek-PCIe-binding-documentation.patch 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. From 97478bae3a11b5e87d61b88267e915f7c5ddf4e9 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Wed, 6 Jan 2016 21:55:10 +0100
  4. Subject: [PATCH 24/78] dt-bindings: add MediaTek PCIe binding documentation
  5. Signed-off-by: John Crispin <[email protected]>
  6. ---
  7. .../devicetree/bindings/pci/mediatek-pcie.txt | 140 ++++++++++++++++++++
  8. arch/arm/boot/dts/mt7623.dtsi | 12 ++
  9. 2 files changed, 152 insertions(+)
  10. create mode 100644 Documentation/devicetree/bindings/pci/mediatek-pcie.txt
  11. diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt
  12. new file mode 100644
  13. index 0000000..8fea3ed
  14. --- /dev/null
  15. +++ b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt
  16. @@ -0,0 +1,140 @@
  17. +Mediatek PCIe controller
  18. +
  19. +Required properties:
  20. +- compatible: Should be one of:
  21. + - "mediatek,mt2701-pcie"
  22. + - "mediatek,mt7623-pcie"
  23. +- device_type: Must be "pci"
  24. +- reg: A list of physical base address and length for each set of controller
  25. + registers. A list of register ranges to use. Must contain an
  26. + entry for each entry in the reg-names property.
  27. +- reg-names: Must include the following entries:
  28. + "pcie": PCIe registers
  29. + "pcie phy0": PCIe PHY0 registers
  30. + "pcie phy1": PCIe PHY0 registers
  31. + "pcie phy2": PCIe PHY0 registers
  32. +- interrupts: A list of interrupt outputs of the controller. Must contain an
  33. + entry for each entry in the interrupt-names property.
  34. +- interrupt-names: Must include the following entries:
  35. + "pcie0": The interrupt that is asserted for port0
  36. + "pcie1": The interrupt that is asserted for port1
  37. + "pcie2": The interrupt that is asserted for port2
  38. +- bus-range: Range of bus numbers associated with this controller
  39. +- #address-cells: Address representation for root ports (must be 3)
  40. +- #size-cells: Size representation for root ports (must be 2)
  41. +- ranges: Describes the translation of addresses for root ports and standard
  42. + PCI regions. The entries must be 6 cells each.
  43. + Please refer to the standard PCI bus binding document for a more detailed
  44. + explanation.
  45. +- #interrupt-cells: Size representation for interrupts (must be 1)
  46. +- clocks: Must contain an entry for each entry in clock-names.
  47. + See ../clocks/clock-bindings.txt for details.
  48. +- clock-names: Must include the following entries:
  49. + - pcie0
  50. + - pcie1
  51. + - pcie2
  52. +- resets: Must contain an entry for each entry in reset-names.
  53. + See ../reset/reset.txt for details.
  54. +- reset-names: Must include the following entries:
  55. + - pcie0
  56. + - pcie1
  57. + - pcie2
  58. +- mediatek,hifsys: Must contain a phandle to the HIFSYS syscon range.
  59. +Root ports are defined as subnodes of the PCIe controller node.
  60. +
  61. +Required properties:
  62. +- device_type: Must be "pci"
  63. +- assigned-addresses: Address and size of the port configuration registers
  64. +- reg: PCI bus address of the root port
  65. +- #address-cells: Must be 3
  66. +- #size-cells: Must be 2
  67. +- ranges: Sub-ranges distributed from the PCIe controller node. An empty
  68. + property is sufficient.
  69. +
  70. +Example:
  71. +
  72. +SoC DTSI:
  73. +
  74. + hifsys: clock-controller@1a000000 {
  75. + compatible = "mediatek,mt7623-hifsys",
  76. + "mediatek,mt2701-hifsys",
  77. + "syscon";
  78. + reg = <0 0x1a000000 0 0x1000>;
  79. + #clock-cells = <1>;
  80. + #reset-cells = <1>;
  81. + };
  82. +
  83. + pcie-controller@1a140000 {
  84. + compatible = "mediatek,mt7623-pcie";
  85. + device_type = "pci";
  86. + reg = <0 0x1a140000 0 0x8000>, /* PCI-Express registers */
  87. + <0 0x1a149000 0 0x1000>, /* PCI-Express PHY0 */
  88. + <0 0x1a14a000 0 0x1000>, /* PCI-Express PHY1 */
  89. + <0 0x1a244000 0 0x1000>; /* PCI-Express PHY2 */
  90. + reg-names = "pcie", "pcie phy0", "pcie phy1", "pcie phy2";
  91. + interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>,
  92. + <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>,
  93. + <GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
  94. + interrupt-names = "pcie0", "pcie1", "pcie2";
  95. + clocks = <&topckgen CLK_TOP_ETHIF_SEL>;
  96. + clock-names = "pcie";
  97. + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>;
  98. + resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>,
  99. + <&hifsys MT2701_HIFSYS_PCIE1_RST>,
  100. + <&hifsys MT2701_HIFSYS_PCIE2_RST>;
  101. + reset-names = "pcie0", "pice1", "pcie2";
  102. +
  103. + bus-range = <0x00 0xff>;
  104. + #address-cells = <3>;
  105. + #size-cells = <2>;
  106. +
  107. + mediatek,hifsys = <&hifsys>;
  108. +
  109. + ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000 /* io space */
  110. + 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>; /* pci memory */
  111. +
  112. + status = "disabled";
  113. +
  114. + pcie@1,0 {
  115. + device_type = "pci";
  116. + reg = <0x0800 0 0 0 0>;
  117. +
  118. + #address-cells = <3>;
  119. + #size-cells = <2>;
  120. + ranges;
  121. +
  122. + status = "disabled";
  123. + };
  124. +
  125. + pcie@2,0{
  126. + device_type = "pci";
  127. + reg = <0x1000 0 0 0 0>;
  128. +
  129. + #address-cells = <3>;
  130. + #size-cells = <2>;
  131. + ranges;
  132. +
  133. + status = "disabled";
  134. + };
  135. +
  136. + pcie@3,0{
  137. + device_type = "pci";
  138. + reg = <0x1800 0 0 0 0>;
  139. +
  140. + #address-cells = <3>;
  141. + #size-cells = <2>;
  142. + ranges;
  143. +
  144. + status = "disabled";
  145. + };
  146. + };
  147. +
  148. +Board DTS:
  149. +
  150. + pcie-controller {
  151. + status = "okay";
  152. +
  153. + pci@1,0 {
  154. + status = "okay";
  155. + };
  156. + };
  157. diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
  158. index c53c10d..c8c802d 100644
  159. --- a/arch/arm/boot/dts/mt7623.dtsi
  160. +++ b/arch/arm/boot/dts/mt7623.dtsi
  161. @@ -292,6 +292,18 @@
  162. status = "disabled";
  163. };
  164. + nand: nfi@1100d000 {
  165. + compatible = "mediatek,mt2701-nfc";
  166. + reg = <0 0x1100d000 0 0x1000>, <0 0x1100e000 0 0x1000>;
  167. + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>,
  168. + <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
  169. + clocks = <&pericfg CLK_PERI_NFI>, <&pericfg CLK_PERI_NFI_ECC>,
  170. + <&pericfg CLK_PERI_NFI_PAD>;
  171. + clock-names = "nfi_clk", "nfiecc_clk", "pad_clk";
  172. + nand-on-flash-bbt;
  173. + status = "disabled";
  174. + };
  175. +
  176. mmc0: mmc@11230000 {
  177. compatible = "mediatek,mt7623-mmc",
  178. "mediatek,mt8135-mmc";
  179. --
  180. 1.7.10.4