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

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