2
0

006-v6.2-arm64-dts-mt7986-add-spi-related-device-nodes.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. From f4029538f063a845dc9aae46cce4cf386e6253a5 Mon Sep 17 00:00:00 2001
  2. From: Sam Shih <[email protected]>
  3. Date: Fri, 18 Nov 2022 20:01:21 +0100
  4. Subject: [PATCH 06/19] arm64: dts: mt7986: add spi related device nodes
  5. This patch adds spi support for MT7986.
  6. Signed-off-by: Sam Shih <[email protected]>
  7. Signed-off-by: Frank Wunderlich <[email protected]>
  8. Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
  9. Link: https://lore.kernel.org/r/[email protected]
  10. Signed-off-by: Matthias Brugger <[email protected]>
  11. ---
  12. arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 35 ++++++++++++++++++++
  13. arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 28 ++++++++++++++++
  14. arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 35 ++++++++++++++++++++
  15. 3 files changed, 98 insertions(+)
  16. --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
  17. +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
  18. @@ -59,6 +59,20 @@
  19. };
  20. &pio {
  21. + spi_flash_pins: spi-flash-pins {
  22. + mux {
  23. + function = "spi";
  24. + groups = "spi0", "spi0_wp_hold";
  25. + };
  26. + };
  27. +
  28. + spic_pins: spic-pins {
  29. + mux {
  30. + function = "spi";
  31. + groups = "spi1_2";
  32. + };
  33. + };
  34. +
  35. uart1_pins: uart1-pins {
  36. mux {
  37. function = "uart";
  38. @@ -105,6 +119,27 @@
  39. };
  40. };
  41. +&spi0 {
  42. + pinctrl-names = "default";
  43. + pinctrl-0 = <&spi_flash_pins>;
  44. + cs-gpios = <0>, <0>;
  45. + status = "okay";
  46. + spi_nand: spi_nand@0 {
  47. + compatible = "spi-nand";
  48. + reg = <0>;
  49. + spi-max-frequency = <10000000>;
  50. + spi-tx-bus-width = <4>;
  51. + spi-rx-bus-width = <4>;
  52. + };
  53. +};
  54. +
  55. +&spi1 {
  56. + pinctrl-names = "default";
  57. + pinctrl-0 = <&spic_pins>;
  58. + cs-gpios = <0>, <0>;
  59. + status = "okay";
  60. +};
  61. +
  62. &switch {
  63. ports {
  64. #address-cells = <1>;
  65. --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
  66. +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
  67. @@ -294,6 +294,34 @@
  68. status = "disabled";
  69. };
  70. + spi0: spi@1100a000 {
  71. + compatible = "mediatek,mt7986-spi-ipm", "mediatek,spi-ipm";
  72. + #address-cells = <1>;
  73. + #size-cells = <0>;
  74. + reg = <0 0x1100a000 0 0x100>;
  75. + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
  76. + clocks = <&topckgen CLK_TOP_MPLL_D2>,
  77. + <&topckgen CLK_TOP_SPI_SEL>,
  78. + <&infracfg CLK_INFRA_SPI0_CK>,
  79. + <&infracfg CLK_INFRA_SPI0_HCK_CK>;
  80. + clock-names = "parent-clk", "sel-clk", "spi-clk", "hclk";
  81. + status = "disabled";
  82. + };
  83. +
  84. + spi1: spi@1100b000 {
  85. + compatible = "mediatek,mt7986-spi-ipm", "mediatek,spi-ipm";
  86. + #address-cells = <1>;
  87. + #size-cells = <0>;
  88. + reg = <0 0x1100b000 0 0x100>;
  89. + interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
  90. + clocks = <&topckgen CLK_TOP_MPLL_D2>,
  91. + <&topckgen CLK_TOP_SPIM_MST_SEL>,
  92. + <&infracfg CLK_INFRA_SPI1_CK>,
  93. + <&infracfg CLK_INFRA_SPI1_HCK_CK>;
  94. + clock-names = "parent-clk", "sel-clk", "spi-clk", "hclk";
  95. + status = "disabled";
  96. + };
  97. +
  98. ethsys: syscon@15000000 {
  99. #address-cells = <1>;
  100. #size-cells = <1>;
  101. --- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
  102. +++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
  103. @@ -100,6 +100,20 @@
  104. };
  105. &pio {
  106. + spi_flash_pins: spi-flash-pins {
  107. + mux {
  108. + function = "spi";
  109. + groups = "spi0", "spi0_wp_hold";
  110. + };
  111. + };
  112. +
  113. + spic_pins: spic-pins {
  114. + mux {
  115. + function = "spi";
  116. + groups = "spi1_2";
  117. + };
  118. + };
  119. +
  120. wf_2g_5g_pins: wf-2g-5g-pins {
  121. mux {
  122. function = "wifi";
  123. @@ -132,6 +146,27 @@
  124. };
  125. };
  126. +&spi0 {
  127. + pinctrl-names = "default";
  128. + pinctrl-0 = <&spi_flash_pins>;
  129. + cs-gpios = <0>, <0>;
  130. + status = "okay";
  131. + spi_nand: spi_nand@0 {
  132. + compatible = "spi-nand";
  133. + reg = <0>;
  134. + spi-max-frequency = <10000000>;
  135. + spi-tx-bus-width = <4>;
  136. + spi-rx-bus-width = <4>;
  137. + };
  138. +};
  139. +
  140. +&spi1 {
  141. + pinctrl-names = "default";
  142. + pinctrl-0 = <&spic_pins>;
  143. + cs-gpios = <0>, <0>;
  144. + status = "okay";
  145. +};
  146. +
  147. &uart0 {
  148. status = "okay";
  149. };