mt7622-elecom-wrc-x3200gst3.dts 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2. /dts-v1/;
  3. #include <dt-bindings/input/input.h>
  4. #include <dt-bindings/gpio/gpio.h>
  5. #include <dt-bindings/leds/common.h>
  6. #include "mt7622.dtsi"
  7. #include "mt6380.dtsi"
  8. / {
  9. model = "ELECOM WRC-X3200GST3";
  10. compatible = "elecom,wrc-x3200gst3", "mediatek,mt7622";
  11. aliases {
  12. serial0 = &uart0;
  13. led-boot = &led_power_green;
  14. led-failsafe = &led_power_red;
  15. led-running = &led_power_green;
  16. led-upgrade = &led_power_green;
  17. label-mac-device = &wan;
  18. };
  19. chosen {
  20. bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
  21. };
  22. memory {
  23. reg = <0 0x40000000 0 0x1f000000>;
  24. };
  25. leds {
  26. compatible = "gpio-leds";
  27. led-0 {
  28. gpios = <&pio 47 GPIO_ACTIVE_HIGH>;
  29. color = <LED_COLOR_ID_RED>;
  30. function = LED_FUNCTION_WPS;
  31. };
  32. led_power_red: led-1 {
  33. gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
  34. color = <LED_COLOR_ID_RED>;
  35. function = LED_FUNCTION_POWER;
  36. function-enumerator = <1>;
  37. };
  38. led_power_green: led-2 {
  39. gpios = <&pio 49 GPIO_ACTIVE_HIGH>;
  40. color = <LED_COLOR_ID_GREEN>;
  41. function = LED_FUNCTION_POWER;
  42. function-enumerator = <2>;
  43. };
  44. led-3 {
  45. gpios = <&pio 50 GPIO_ACTIVE_HIGH>;
  46. color = <LED_COLOR_ID_BLUE>;
  47. function = LED_FUNCTION_POWER;
  48. function-enumerator = <3>;
  49. };
  50. led-4 {
  51. gpios = <&pio 85 GPIO_ACTIVE_HIGH>;
  52. color = <LED_COLOR_ID_WHITE>;
  53. function = LED_FUNCTION_WLAN;
  54. function-enumerator = <1>;
  55. linux,default-trigger = "phy0tpt";
  56. };
  57. led-5 {
  58. gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
  59. color = <LED_COLOR_ID_WHITE>;
  60. function = LED_FUNCTION_WLAN;
  61. function-enumerator = <2>;
  62. linux,default-trigger = "phy1radio";
  63. };
  64. };
  65. keys {
  66. compatible = "gpio-keys";
  67. reset {
  68. label = "reset";
  69. gpios = <&pio 0 GPIO_ACTIVE_LOW>;
  70. linux,code = <KEY_RESTART>;
  71. };
  72. ap {
  73. label = "ap";
  74. gpios = <&pio 42 GPIO_ACTIVE_LOW>;
  75. linux,code = <BTN_0>;
  76. linux,input-type = <EV_SW>;
  77. };
  78. router {
  79. label = "router";
  80. gpios = <&pio 43 GPIO_ACTIVE_LOW>;
  81. linux,code = <BTN_1>;
  82. linux,input-type = <EV_SW>;
  83. };
  84. wps {
  85. label = "wps";
  86. gpios = <&pio 102 GPIO_ACTIVE_LOW>;
  87. linux,code = <KEY_WPS_BUTTON>;
  88. };
  89. };
  90. };
  91. &cpu0 {
  92. proc-supply = <&mt6380_vcpu_reg>;
  93. sram-supply = <&mt6380_vm_reg>;
  94. };
  95. &cpu1 {
  96. proc-supply = <&mt6380_vcpu_reg>;
  97. sram-supply = <&mt6380_vm_reg>;
  98. };
  99. &pio {
  100. eth_pins: eth-pins {
  101. mux {
  102. function = "eth";
  103. groups = "mdc_mdio", "rgmii_via_gmac2";
  104. };
  105. };
  106. pcie0_pins: pcie0-pins {
  107. mux {
  108. function = "pcie";
  109. groups = "pcie0_pad_perst",
  110. "pcie0_1_waken",
  111. "pcie0_1_clkreq";
  112. };
  113. };
  114. pmic_bus_pins: pmic-bus-pins {
  115. mux {
  116. function = "pmic";
  117. groups = "pmic_bus";
  118. };
  119. };
  120. pwm7_pins: pwm1-2-pins {
  121. mux {
  122. function = "pwm";
  123. groups = "pwm_ch7_2";
  124. };
  125. };
  126. /* Serial NAND is shared pin with SPI-NOR */
  127. serial_nand_pins: serial-nand-pins {
  128. mux {
  129. function = "flash";
  130. groups = "snfi";
  131. };
  132. conf-cmd-data {
  133. pins = "SPI_WP", "SPI_HOLD", "SPI_MOSI",
  134. "SPI_MISO", "SPI_CS";
  135. drive-strength = <16>;
  136. bias-pull-up;
  137. };
  138. conf-clk {
  139. pins = "SPI_CLK";
  140. drive-strength = <16>;
  141. bias-pull-down;
  142. };
  143. };
  144. uart0_pins: uart0-pins {
  145. mux {
  146. function = "uart";
  147. groups = "uart0_0_tx_rx" ;
  148. };
  149. };
  150. watchdog_pins: watchdog-pins {
  151. mux {
  152. function = "watchdog";
  153. groups = "watchdog";
  154. };
  155. };
  156. };
  157. &eth {
  158. pinctrl-names = "default";
  159. pinctrl-0 = <&eth_pins>;
  160. status = "okay";
  161. gmac0: mac@0 {
  162. compatible = "mediatek,eth-mac";
  163. reg = <0>;
  164. phy-connection-type = "2500base-x";
  165. nvmem-cells = <&macaddr_factory_7fff4>;
  166. nvmem-cell-names = "mac-address";
  167. fixed-link {
  168. speed = <2500>;
  169. full-duplex;
  170. pause;
  171. };
  172. };
  173. mdio-bus {
  174. #address-cells = <1>;
  175. #size-cells = <0>;
  176. switch@0 {
  177. compatible = "mediatek,mt7531";
  178. reg = <0>;
  179. interrupt-controller;
  180. #interrupt-cells = <1>;
  181. interrupt-parent = <&pio>;
  182. interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
  183. reset-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
  184. ports {
  185. #address-cells = <1>;
  186. #size-cells = <0>;
  187. wan: port@0 {
  188. reg = <0>;
  189. label = "wan";
  190. nvmem-cells = <&macaddr_factory_7fffa>;
  191. nvmem-cell-names = "mac-address";
  192. };
  193. port@1 {
  194. reg = <1>;
  195. label = "lan4";
  196. };
  197. port@2 {
  198. reg = <2>;
  199. label = "lan3";
  200. };
  201. port@3 {
  202. reg = <3>;
  203. label = "lan2";
  204. };
  205. port@4 {
  206. reg = <4>;
  207. label = "lan1";
  208. };
  209. port@6 {
  210. reg = <6>;
  211. ethernet = <&gmac0>;
  212. phy-mode = "2500base-x";
  213. fixed-link {
  214. speed = <2500>;
  215. full-duplex;
  216. pause;
  217. };
  218. };
  219. };
  220. };
  221. };
  222. };
  223. &bch {
  224. status = "okay";
  225. };
  226. &snfi {
  227. pinctrl-names = "default";
  228. pinctrl-0 = <&serial_nand_pins>;
  229. status = "okay";
  230. flash@0 {
  231. compatible = "spi-nand";
  232. reg = <0>;
  233. spi-tx-bus-width = <4>;
  234. spi-rx-bus-width = <4>;
  235. nand-ecc-engine = <&snfi>;
  236. mediatek,bmt-v2;
  237. mediatek,bmt-table-size = <0x1000>;
  238. mediatek,bmt-remap-range = <0x0 0x8c0000>,
  239. <0x1bc0000 0x30c0000>;
  240. partitions {
  241. compatible = "fixed-partitions";
  242. #address-cells = <1>;
  243. #size-cells = <1>;
  244. partition@0 {
  245. label = "Preloader";
  246. reg = <0x0 0x80000>;
  247. read-only;
  248. };
  249. partition@80000 {
  250. label = "ATF";
  251. reg = <0x80000 0x40000>;
  252. read-only;
  253. };
  254. partition@c0000 {
  255. label = "u-boot";
  256. reg = <0xc0000 0x80000>;
  257. read-only;
  258. };
  259. partition@140000 {
  260. label = "u-boot-env";
  261. reg = <0x140000 0x80000>;
  262. read-only;
  263. };
  264. factory: partition@1c0000 {
  265. label = "factory";
  266. reg = <0x1c0000 0x100000>;
  267. read-only;
  268. nvmem-layout {
  269. compatible = "fixed-layout";
  270. #address-cells = <1>;
  271. #size-cells = <1>;
  272. macaddr_factory_4: macaddr@4 {
  273. compatible = "mac-base";
  274. reg = <0x4 0x6>;
  275. #nvmem-cell-cells = <1>;
  276. };
  277. macaddr_factory_7fff4: macaddr@7fff4 {
  278. reg = <0x7fff4 0x6>;
  279. };
  280. macaddr_factory_7fffa: macaddr@7fffa {
  281. reg = <0x7fffa 0x6>;
  282. };
  283. };
  284. };
  285. partition@2c0000 {
  286. label = "kernel";
  287. reg = <0x2c0000 0x600000>;
  288. };
  289. partition@8c0000 {
  290. label = "ubi";
  291. reg = <0x8c0000 0x1300000>;
  292. };
  293. partition@1bc0000 {
  294. label = "tm_pattern";
  295. reg = <0x1bc0000 0x500000>;
  296. read-only;
  297. };
  298. partition@20c0000 {
  299. label = "tm_key";
  300. reg = <0x20c0000 0x100000>;
  301. read-only;
  302. };
  303. partition@21c0000 {
  304. label = "user_data";
  305. reg = <0x21c0000 0xf00000>;
  306. read-only;
  307. };
  308. partition@30c0000 {
  309. label = "reserved";
  310. reg = <0x30c0000 0x4f40000>;
  311. read-only;
  312. };
  313. };
  314. };
  315. };
  316. &pcie0 {
  317. pinctrl-names = "default";
  318. pinctrl-0 = <&pcie0_pins>;
  319. status = "okay";
  320. };
  321. &slot0 {
  322. status = "okay";
  323. wifi@0,0 {
  324. compatible = "mediatek,mt76";
  325. reg = <0x0000 0 0 0 0>;
  326. mediatek,mtd-eeprom = <&factory 0x5000>;
  327. ieee80211-freq-limit = <5000000 6000000>;
  328. nvmem-cells = <&macaddr_factory_4 1>;
  329. nvmem-cell-names = "mac-address";
  330. };
  331. };
  332. &pwm {
  333. pinctrl-names = "default";
  334. pinctrl-0 = <&pwm7_pins>;
  335. status = "okay";
  336. };
  337. &pwrap {
  338. pinctrl-names = "default";
  339. pinctrl-0 = <&pmic_bus_pins>;
  340. status = "okay";
  341. };
  342. &rtc {
  343. status = "disabled";
  344. };
  345. &uart0 {
  346. pinctrl-names = "default";
  347. pinctrl-0 = <&uart0_pins>;
  348. status = "okay";
  349. };
  350. &watchdog {
  351. pinctrl-names = "default";
  352. pinctrl-0 = <&watchdog_pins>;
  353. status = "okay";
  354. };
  355. &wmac {
  356. status = "okay";
  357. mediatek,mtd-eeprom = <&factory 0x0>;
  358. };