/target/linux/mediatek/patches-5.4/0005-dts-mt7622-add-gsw.patch

https://github.com/KFERMercer/OpenWrt · Patch · 260 lines · 238 code · 22 blank · 0 comment · 0 complexity · 874bba4b5f616328ded5c1fca4378c23 MD5 · raw file

  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 <ming.huang@mediatek.com>
  57. - * Sean Wang <sean.wang@mediatek.com>
  58. + * Copyright (c) 2018 MediaTek Inc.
  59. + * Author: Ryder Lee <ryder.lee@mediatek.com>
  60. *
  61. * SPDX-License-Identifier: (GPL-2.0 OR MIT)
  62. */
  63. @@ -14,7 +13,7 @@
  64. #include "mt6380.dtsi"
  65. / {
  66. - model = "MediaTek MT7622 RFB1 board";
  67. + model = "MT7622_MT7531 RFB";
  68. compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622";
  69. aliases {
  70. @@ -23,7 +22,7 @@
  71. chosen {
  72. stdout-path = "serial0:115200n8";
  73. - bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512";
  74. + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512";
  75. };
  76. cpus {
  77. @@ -40,23 +39,38 @@
  78. gpio-keys {
  79. compatible = "gpio-keys";
  80. - poll-interval = <100>;
  81. factory {
  82. label = "factory";
  83. linux,code = <BTN_0>;
  84. - gpios = <&pio 0 0>;
  85. + gpios = <&pio 0 GPIO_ACTIVE_LOW>;
  86. };
  87. wps {
  88. label = "wps";
  89. linux,code = <KEY_WPS_BUTTON>;
  90. - gpios = <&pio 102 0>;
  91. + gpios = <&pio 102 GPIO_ACTIVE_LOW>;
  92. + };
  93. + };
  94. +
  95. + leds {
  96. + compatible = "gpio-leds";
  97. +
  98. + green {
  99. + label = "bpi-r64:pio:green";
  100. + gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
  101. + default-state = "off";
  102. + };
  103. +
  104. + red {
  105. + label = "bpi-r64:pio:red";
  106. + gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
  107. + default-state = "off";
  108. };
  109. };
  110. memory {
  111. - reg = <0 0x40000000 0 0x20000000>;
  112. + reg = <0 0x40000000 0 0x40000000>;
  113. };
  114. reg_1p8v: regulator-1p8v {
  115. @@ -101,23 +115,82 @@
  116. };
  117. &eth {
  118. - pinctrl-names = "default";
  119. - pinctrl-0 = <&eth_pins>;
  120. status = "okay";
  121. + gmac0: mac@0 {
  122. + compatible = "mediatek,eth-mac";
  123. + reg = <0>;
  124. + phy-mode = "2500base-x";
  125. +
  126. + fixed-link {
  127. + speed = <2500>;
  128. + full-duplex;
  129. + pause;
  130. + };
  131. + };
  132. gmac1: mac@1 {
  133. compatible = "mediatek,eth-mac";
  134. reg = <1>;
  135. - phy-handle = <&phy5>;
  136. + phy-mode = "rgmii";
  137. +
  138. + fixed-link {
  139. + speed = <1000>;
  140. + full-duplex;
  141. + pause;
  142. + };
  143. };
  144. - mdio-bus {
  145. + mdio: mdio-bus {
  146. #address-cells = <1>;
  147. #size-cells = <0>;
  148. - phy5: ethernet-phy@5 {
  149. - reg = <5>;
  150. - phy-mode = "sgmii";
  151. + switch@0 {
  152. + compatible = "mediatek,mt7531";
  153. + reg = <0>;
  154. + reset-gpios = <&pio 54 0>;
  155. +
  156. + ports {
  157. + #address-cells = <1>;
  158. + #size-cells = <0>;
  159. +
  160. + port@0 {
  161. + reg = <0>;
  162. + label = "lan1";
  163. + };
  164. +
  165. + port@1 {
  166. + reg = <1>;
  167. + label = "lan2";
  168. + };
  169. +
  170. + port@2 {
  171. + reg = <2>;
  172. + label = "lan3";
  173. + };
  174. +
  175. + port@3 {
  176. + reg = <3>;
  177. + label = "lan4";
  178. + };
  179. +
  180. + port@4 {
  181. + reg = <4>;
  182. + label = "wan";
  183. + };
  184. +
  185. + port@6 {
  186. + reg = <6>;
  187. + label = "cpu";
  188. + ethernet = <&gmac0>;
  189. + phy-mode = "2500base-x";
  190. +
  191. + fixed-link {
  192. + speed = <2500>;
  193. + full-duplex;
  194. + pause;
  195. + };
  196. + };
  197. + };
  198. };
  199. };
  200. };
  201. @@ -185,15 +258,28 @@
  202. &pcie {
  203. pinctrl-names = "default";
  204. - pinctrl-0 = <&pcie0_pins>;
  205. + pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
  206. status = "okay";
  207. pcie@0,0 {
  208. status = "okay";
  209. };
  210. +
  211. + pcie@1,0 {
  212. + status = "okay";
  213. + };
  214. };
  215. &pio {
  216. + /* Attention: GPIO 90 is used to switch between PCIe@1,0 and
  217. + * SATA functions. i.e. output-high: PCIe, output-low: SATA
  218. + */
  219. + asm_sel {
  220. + gpio-hog;
  221. + gpios = <90 GPIO_ACTIVE_HIGH>;
  222. + output-high;
  223. + };
  224. +
  225. /* eMMC is shared pin with parallel NAND */
  226. emmc_pins_default: emmc-pins-default {
  227. mux {
  228. @@ -460,11 +546,11 @@
  229. };
  230. &sata {
  231. - status = "okay";
  232. + status = "disable";
  233. };
  234. &sata_phy {
  235. - status = "okay";
  236. + status = "disable";
  237. };
  238. &spi0 {