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

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