0005-dts-mt7622-add-gsw.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
  2. +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
  3. @@ -53,6 +53,13 @@
  4. };
  5. };
  6. + gsw: gsw@0 {
  7. + compatible = "mediatek,mt753x";
  8. + mediatek,ethsys = <&ethsys>;
  9. + #address-cells = <1>;
  10. + #size-cells = <0>;
  11. + };
  12. +
  13. leds {
  14. compatible = "gpio-leds";
  15. @@ -146,6 +153,36 @@
  16. };
  17. };
  18. +&gsw {
  19. + mediatek,mdio = <&mdio>;
  20. + mediatek,portmap = "wllll";
  21. + mediatek,mdio_master_pinmux = <0>;
  22. + reset-gpios = <&pio 54 0>;
  23. + interrupt-parent = <&pio>;
  24. + interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
  25. + status = "okay";
  26. +
  27. + port5: port@5 {
  28. + compatible = "mediatek,mt753x-port";
  29. + reg = <5>;
  30. + phy-mode = "rgmii";
  31. + fixed-link {
  32. + speed = <1000>;
  33. + full-duplex;
  34. + };
  35. + };
  36. +
  37. + port6: port@6 {
  38. + compatible = "mediatek,mt753x-port";
  39. + reg = <6>;
  40. + phy-mode = "sgmii";
  41. + fixed-link {
  42. + speed = <2500>;
  43. + full-duplex;
  44. + };
  45. + };
  46. +};
  47. +
  48. &i2c1 {
  49. pinctrl-names = "default";
  50. pinctrl-0 = <&i2c1_pins>;
  51. --- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
  52. +++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
  53. @@ -1,7 +1,6 @@
  54. /*
  55. - * Copyright (c) 2017 MediaTek Inc.
  56. - * Author: Ming Huang <[email protected]>
  57. - * Sean Wang <[email protected]>
  58. + * Copyright (c) 2018 MediaTek Inc.
  59. + * Author: Ryder Lee <[email protected]>
  60. *
  61. * SPDX-License-Identifier: (GPL-2.0 OR MIT)
  62. */
  63. @@ -14,8 +13,8 @@
  64. #include "mt6380.dtsi"
  65. / {
  66. - model = "MediaTek MT7622 RFB1 board";
  67. - compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622";
  68. + model = "MT7622_MT7531 RFB";
  69. + compatible = "bananapi,bpi-r64", "mediatek,mt7622";
  70. aliases {
  71. serial0 = &uart0;
  72. @@ -23,7 +22,7 @@
  73. chosen {
  74. stdout-path = "serial0:115200n8";
  75. - bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512";
  76. + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512";
  77. };
  78. cpus {
  79. @@ -40,23 +39,45 @@
  80. gpio-keys {
  81. compatible = "gpio-keys";
  82. - poll-interval = <100>;
  83. factory {
  84. label = "factory";
  85. linux,code = <BTN_0>;
  86. - gpios = <&pio 0 0>;
  87. + gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
  88. };
  89. wps {
  90. label = "wps";
  91. linux,code = <KEY_WPS_BUTTON>;
  92. - gpios = <&pio 102 0>;
  93. + gpios = <&pio 102 GPIO_ACTIVE_HIGH>;
  94. + };
  95. + };
  96. +
  97. + gsw: gsw@0 {
  98. + compatible = "mediatek,mt753x";
  99. + mediatek,ethsys = <&ethsys>;
  100. + #address-cells = <1>;
  101. + #size-cells = <0>;
  102. + };
  103. +
  104. + leds {
  105. + compatible = "gpio-leds";
  106. +
  107. + green {
  108. + label = "bpi-r64:pio:green";
  109. + gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
  110. + default-state = "off";
  111. + };
  112. +
  113. + red {
  114. + label = "bpi-r64:pio:red";
  115. + gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
  116. + default-state = "off";
  117. };
  118. };
  119. memory {
  120. - reg = <0 0x40000000 0 0x20000000>;
  121. + reg = <0 0x40000000 0 0x40000000>;
  122. };
  123. reg_1p8v: regulator-1p8v {
  124. @@ -101,27 +122,67 @@
  125. };
  126. &eth {
  127. - pinctrl-names = "default";
  128. - pinctrl-0 = <&eth_pins>;
  129. status = "okay";
  130. + gmac0: mac@0 {
  131. + compatible = "mediatek,eth-mac";
  132. + reg = <0>;
  133. + phy-mode = "2500base-x";
  134. +
  135. + fixed-link {
  136. + speed = <2500>;
  137. + full-duplex;
  138. + pause;
  139. + };
  140. + };
  141. gmac1: mac@1 {
  142. compatible = "mediatek,eth-mac";
  143. reg = <1>;
  144. - phy-handle = <&phy5>;
  145. + phy-mode = "rgmii";
  146. +
  147. + fixed-link {
  148. + speed = <1000>;
  149. + full-duplex;
  150. + pause;
  151. + };
  152. };
  153. - mdio-bus {
  154. + mdio: mdio-bus {
  155. #address-cells = <1>;
  156. #size-cells = <0>;
  157. -
  158. - phy5: ethernet-phy@5 {
  159. - reg = <5>;
  160. - phy-mode = "sgmii";
  161. - };
  162. };
  163. };
  164. +&gsw {
  165. + mediatek,mdio = <&mdio>;
  166. + mediatek,portmap = "llllw";
  167. + mediatek,mdio_master_pinmux = <0>;
  168. + reset-gpios = <&pio 54 0>;
  169. + interrupt-parent = <&pio>;
  170. + interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
  171. + status = "okay";
  172. +
  173. + port5: port@5 {
  174. + compatible = "mediatek,mt753x-port";
  175. + reg = <5>;
  176. + phy-mode = "rgmii";
  177. + fixed-link {
  178. + speed = <1000>;
  179. + full-duplex;
  180. + };
  181. + };
  182. +
  183. + port6: port@6 {
  184. + compatible = "mediatek,mt753x-port";
  185. + reg = <6>;
  186. + phy-mode = "sgmii";
  187. + fixed-link {
  188. + speed = <2500>;
  189. + full-duplex;
  190. + };
  191. + };
  192. +};
  193. +
  194. &i2c1 {
  195. pinctrl-names = "default";
  196. pinctrl-0 = <&i2c1_pins>;
  197. @@ -185,15 +246,28 @@
  198. &pcie {
  199. pinctrl-names = "default";
  200. - pinctrl-0 = <&pcie0_pins>;
  201. + pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
  202. status = "okay";
  203. pcie@0,0 {
  204. status = "okay";
  205. };
  206. +
  207. + pcie@1,0 {
  208. + status = "okay";
  209. + };
  210. };
  211. &pio {
  212. + /* Attention: GPIO 90 is used to switch between PCIe@1,0 and
  213. + * SATA functions. i.e. output-high: PCIe, output-low: SATA
  214. + */
  215. + asm_sel {
  216. + gpio-hog;
  217. + gpios = <90 GPIO_ACTIVE_HIGH>;
  218. + output-high;
  219. + };
  220. +
  221. /* eMMC is shared pin with parallel NAND */
  222. emmc_pins_default: emmc-pins-default {
  223. mux {
  224. @@ -460,11 +534,11 @@
  225. };
  226. &sata {
  227. - status = "okay";
  228. + status = "disable";
  229. };
  230. &sata_phy {
  231. - status = "okay";
  232. + status = "disable";
  233. };
  234. &spi0 {