009-v6.3-arm64-dts-mt7986-add-pcie-related-device-nodes.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. From 87a42ef1d6cf602e4aa40555b4404cad6149a90f Mon Sep 17 00:00:00 2001
  2. From: Sam Shih <[email protected]>
  3. Date: Fri, 6 Jan 2023 16:28:44 +0100
  4. Subject: [PATCH 09/19] arm64: dts: mt7986: add pcie related device nodes
  5. This patch adds PCIe support for MT7986.
  6. Signed-off-by: Jieyy Yang <[email protected]>
  7. Signed-off-by: Sam Shih <[email protected]>
  8. Signed-off-by: Frank Wunderlich <[email protected]>
  9. Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
  10. Link: https://lore.kernel.org/r/[email protected]
  11. Signed-off-by: Matthias Brugger <[email protected]>
  12. ---
  13. arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 16 ++++++
  14. arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 52 ++++++++++++++++++++
  15. 2 files changed, 68 insertions(+)
  16. --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
  17. +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
  18. @@ -93,6 +93,15 @@
  19. non-removable;
  20. no-sd;
  21. no-sdio;
  22. +};
  23. +
  24. +&pcie {
  25. + pinctrl-names = "default";
  26. + pinctrl-0 = <&pcie_pins>;
  27. + status = "okay";
  28. +};
  29. +
  30. +&pcie_phy {
  31. status = "okay";
  32. };
  33. @@ -155,6 +164,13 @@
  34. };
  35. };
  36. + pcie_pins: pcie-pins {
  37. + mux {
  38. + function = "pcie";
  39. + groups = "pcie_clk", "pcie_wake", "pcie_pereset";
  40. + };
  41. + };
  42. +
  43. spi_flash_pins: spi-flash-pins {
  44. mux {
  45. function = "spi";
  46. --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
  47. +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
  48. @@ -8,6 +8,7 @@
  49. #include <dt-bindings/interrupt-controller/arm-gic.h>
  50. #include <dt-bindings/clock/mt7986-clk.h>
  51. #include <dt-bindings/reset/mt7986-resets.h>
  52. +#include <dt-bindings/phy/phy.h>
  53. / {
  54. compatible = "mediatek,mt7986a";
  55. @@ -361,6 +362,57 @@
  56. status = "disabled";
  57. };
  58. + pcie: pcie@11280000 {
  59. + compatible = "mediatek,mt7986-pcie",
  60. + "mediatek,mt8192-pcie";
  61. + device_type = "pci";
  62. + #address-cells = <3>;
  63. + #size-cells = <2>;
  64. + reg = <0x00 0x11280000 0x00 0x4000>;
  65. + reg-names = "pcie-mac";
  66. + interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
  67. + bus-range = <0x00 0xff>;
  68. + ranges = <0x82000000 0x00 0x20000000 0x00
  69. + 0x20000000 0x00 0x10000000>;
  70. + clocks = <&infracfg CLK_INFRA_IPCIE_PIPE_CK>,
  71. + <&infracfg CLK_INFRA_IPCIE_CK>,
  72. + <&infracfg CLK_INFRA_IPCIER_CK>,
  73. + <&infracfg CLK_INFRA_IPCIEB_CK>;
  74. + clock-names = "pl_250m", "tl_26m", "peri_26m", "top_133m";
  75. + status = "disabled";
  76. +
  77. + phys = <&pcie_port PHY_TYPE_PCIE>;
  78. + phy-names = "pcie-phy";
  79. +
  80. + #interrupt-cells = <1>;
  81. + interrupt-map-mask = <0 0 0 0x7>;
  82. + interrupt-map = <0 0 0 1 &pcie_intc 0>,
  83. + <0 0 0 2 &pcie_intc 1>,
  84. + <0 0 0 3 &pcie_intc 2>,
  85. + <0 0 0 4 &pcie_intc 3>;
  86. + pcie_intc: interrupt-controller {
  87. + #address-cells = <0>;
  88. + #interrupt-cells = <1>;
  89. + interrupt-controller;
  90. + };
  91. + };
  92. +
  93. + pcie_phy: t-phy@11c00000 {
  94. + compatible = "mediatek,mt7986-tphy",
  95. + "mediatek,generic-tphy-v2";
  96. + #address-cells = <2>;
  97. + #size-cells = <2>;
  98. + ranges;
  99. + status = "disabled";
  100. +
  101. + pcie_port: pcie-phy@11c00000 {
  102. + reg = <0 0x11c00000 0 0x20000>;
  103. + clocks = <&clk40m>;
  104. + clock-names = "ref";
  105. + #phy-cells = <1>;
  106. + };
  107. + };
  108. +
  109. usb_phy: t-phy@11e10000 {
  110. compatible = "mediatek,mt7986-tphy",
  111. "mediatek,generic-tphy-v2";