mt7986a-asus-tuf-ax4200.dts 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. // SPDX-License-Identifier: (GPL-2.0 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 "mt7986a.dtsi"
  7. / {
  8. model = "ASUS TUF-AX4200";
  9. compatible = "asus,tuf-ax4200", "mediatek,mt7986a";
  10. aliases {
  11. serial0 = &uart0;
  12. label-mac-device = &gmac0;
  13. led-boot = &led_system;
  14. led-failsafe = &led_system;
  15. led-running = &led_system;
  16. led-upgrade = &led_system;
  17. };
  18. chosen {
  19. stdout-path = "serial0:115200n8";
  20. bootargs-override = "";
  21. };
  22. memory {
  23. reg = <0 0x40000000 0 0x20000000>;
  24. };
  25. keys {
  26. compatible = "gpio-keys";
  27. reset {
  28. label = "reset";
  29. gpios = <&pio 9 GPIO_ACTIVE_LOW>;
  30. linux,code = <KEY_RESTART>;
  31. };
  32. mesh {
  33. label = "wps";
  34. gpios = <&pio 10 GPIO_ACTIVE_LOW>;
  35. linux,code = <KEY_WPS_BUTTON>;
  36. };
  37. };
  38. leds {
  39. compatible = "gpio-leds";
  40. wlan24 {
  41. label = "white:wlan24";
  42. gpios = <&pio 1 GPIO_ACTIVE_HIGH>;
  43. linux,default-trigger = "phy0tpt";
  44. };
  45. wlan5 {
  46. label = "white:wlan5";
  47. gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
  48. linux,default-trigger = "phy1tpt";
  49. };
  50. led_system: system {
  51. label = "white:system";
  52. gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
  53. };
  54. wan-red {
  55. function = LED_FUNCTION_WAN;
  56. color = <LED_COLOR_ID_RED>;
  57. gpios = <&pio 12 GPIO_ACTIVE_LOW>;
  58. };
  59. };
  60. reg_3p3v: regulator-3p3v {
  61. compatible = "regulator-fixed";
  62. regulator-name = "fixed-3.3V";
  63. regulator-min-microvolt = <3300000>;
  64. regulator-max-microvolt = <3300000>;
  65. regulator-boot-on;
  66. regulator-always-on;
  67. };
  68. reg_5v: regulator-5v {
  69. compatible = "regulator-fixed";
  70. regulator-name = "fixed-5V";
  71. regulator-min-microvolt = <5000000>;
  72. regulator-max-microvolt = <5000000>;
  73. regulator-boot-on;
  74. regulator-always-on;
  75. };
  76. };
  77. &crypto {
  78. status = "okay";
  79. };
  80. &eth {
  81. status = "okay";
  82. gmac0: mac@0 {
  83. /* LAN */
  84. compatible = "mediatek,eth-mac";
  85. reg = <0>;
  86. nvmem-cells = <&macaddr_factory_4>;
  87. nvmem-cell-names = "mac-address";
  88. phy-mode = "2500base-x";
  89. fixed-link {
  90. speed = <2500>;
  91. full-duplex;
  92. pause;
  93. };
  94. };
  95. gmac1: mac@1 {
  96. /* WAN */
  97. compatible = "mediatek,eth-mac";
  98. reg = <1>;
  99. phy-mode = "2500base-x";
  100. phy-handle = <&phy6>;
  101. };
  102. mdio: mdio-bus {
  103. #address-cells = <1>;
  104. #size-cells = <0>;
  105. };
  106. };
  107. &mdio {
  108. phy6: phy@6 {
  109. compatible = "ethernet-phy-ieee802.3-c45";
  110. reg = <6>;
  111. reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
  112. reset-assert-us = <10000>;
  113. reset-deassert-us = <10000>;
  114. /* LED0: CONN (WAN white) */
  115. mxl,led-config = <0x03f0 0x0 0x0 0x0>;
  116. };
  117. switch: switch@1f {
  118. compatible = "mediatek,mt7531";
  119. reg = <31>;
  120. reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
  121. reset-assert-us = <10000>;
  122. reset-deassert-us = <10000>;
  123. };
  124. };
  125. &pio {
  126. spi_flash_pins: spi-flash-pins-33-to-38 {
  127. mux {
  128. function = "spi";
  129. groups = "spi0", "spi0_wp_hold";
  130. };
  131. conf-pu {
  132. pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
  133. drive-strength = <8>;
  134. mediatek,pull-up-adv = <0>; /* bias-disable */
  135. };
  136. conf-pd {
  137. pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
  138. drive-strength = <8>;
  139. mediatek,pull-down-adv = <0>; /* bias-disable */
  140. };
  141. };
  142. wf_2g_5g_pins: wf_2g_5g-pins {
  143. mux {
  144. function = "wifi";
  145. groups = "wf_2g", "wf_5g";
  146. };
  147. conf {
  148. pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
  149. "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
  150. "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
  151. "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
  152. "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
  153. "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
  154. "WF1_TOP_CLK", "WF1_TOP_DATA";
  155. drive-strength = <4>;
  156. };
  157. };
  158. wf_dbdc_pins: wf-dbdc-pins {
  159. mux {
  160. function = "wifi";
  161. groups = "wf_dbdc";
  162. };
  163. conf {
  164. pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
  165. "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
  166. "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
  167. "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
  168. "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
  169. "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
  170. "WF1_TOP_CLK", "WF1_TOP_DATA";
  171. drive-strength = <4>;
  172. };
  173. };
  174. };
  175. &spi0 {
  176. pinctrl-names = "default";
  177. pinctrl-0 = <&spi_flash_pins>;
  178. status = "okay";
  179. spi_nand_flash: flash@0 {
  180. compatible = "spi-nand";
  181. #address-cells = <1>;
  182. #size-cells = <1>;
  183. reg = <0>;
  184. spi-max-frequency = <20000000>;
  185. spi-tx-bus-width = <4>;
  186. spi-rx-bus-width = <4>;
  187. /*
  188. * ASUS bootloader tries to replace the partitions defined in
  189. * Device Tree and by that also deletes all additional properties
  190. * needed for UBI and NVMEM-on-UBI.
  191. * Prevent this from happening by tricking the loader to delete and
  192. * replace a bait node instead.
  193. */
  194. partitions: dummy {
  195. compatible = "u-boot-dummy-partitions";
  196. #address-cells = <1>;
  197. #size-cells = <1>;
  198. partition@0 {
  199. reg = <0x0 0x0>;
  200. label = "remove_me";
  201. };
  202. };
  203. partitions {
  204. compatible = "fixed-partitions";
  205. #address-cells = <1>;
  206. #size-cells = <1>;
  207. partition@0 {
  208. reg = <0x0 0x400000>;
  209. label = "bootloader";
  210. read-only;
  211. };
  212. partition@400000 {
  213. compatible = "linux,ubi";
  214. reg = <0x400000 0xfc00000>;
  215. label = "UBI_DEV";
  216. volumes {
  217. ubi_factory: ubi-volume-factory {
  218. volname = "Factory";
  219. };
  220. };
  221. };
  222. };
  223. };
  224. };
  225. &ubi_factory {
  226. nvmem-layout {
  227. compatible = "fixed-layout";
  228. #address-cells = <1>;
  229. #size-cells = <1>;
  230. eeprom_factory_0: eeprom@0 {
  231. reg = <0x0 0x1000>;
  232. };
  233. macaddr_factory_4: macaddr@4 {
  234. reg = <0x4 0x6>;
  235. };
  236. };
  237. };
  238. &switch {
  239. ports {
  240. #address-cells = <1>;
  241. #size-cells = <0>;
  242. port@1 {
  243. reg = <1>;
  244. label = "lan1";
  245. };
  246. port@2 {
  247. reg = <2>;
  248. label = "lan2";
  249. };
  250. port@3 {
  251. reg = <3>;
  252. label = "lan3";
  253. };
  254. port@4 {
  255. reg = <4>;
  256. label = "lan4";
  257. };
  258. port@6 {
  259. reg = <6>;
  260. label = "cpu";
  261. ethernet = <&gmac0>;
  262. phy-mode = "2500base-x";
  263. fixed-link {
  264. speed = <2500>;
  265. full-duplex;
  266. pause;
  267. };
  268. };
  269. };
  270. mdio {
  271. #address-cells = <1>;
  272. #size-cells = <0>;
  273. phy@1 {
  274. reg = <1>;
  275. mediatek,led-config = <
  276. 0x21 0x8009 /* BASIC_CTRL */
  277. 0x22 0x0c00 /* ON_DURATION */
  278. 0x23 0x1400 /* BLINK_DURATION */
  279. 0x24 0x8000 /* LED0_ON_CTRL */
  280. 0x25 0x0000 /* LED0_BLINK_CTRL */
  281. 0x26 0xc007 /* LED1_ON_CTRL */
  282. 0x27 0x003f /* LED1_BLINK_CTRL */
  283. >;
  284. };
  285. phy@2 {
  286. reg = <2>;
  287. mediatek,led-config = <
  288. 0x21 0x8009 /* BASIC_CTRL */
  289. 0x22 0x0c00 /* ON_DURATION */
  290. 0x23 0x1400 /* BLINK_DURATION */
  291. 0x24 0x8000 /* LED0_ON_CTRL */
  292. 0x25 0x0000 /* LED0_BLINK_CTRL */
  293. 0x26 0xc007 /* LED1_ON_CTRL */
  294. 0x27 0x003f /* LED1_BLINK_CTRL */
  295. >;
  296. };
  297. phy@3 {
  298. reg = <3>;
  299. mediatek,led-config = <
  300. 0x21 0x8009 /* BASIC_CTRL */
  301. 0x22 0x0c00 /* ON_DURATION */
  302. 0x23 0x1400 /* BLINK_DURATION */
  303. 0x24 0x8000 /* LED0_ON_CTRL */
  304. 0x25 0x0000 /* LED0_BLINK_CTRL */
  305. 0x26 0xc007 /* LED1_ON_CTRL */
  306. 0x27 0x003f /* LED1_BLINK_CTRL */
  307. >;
  308. };
  309. phy@4 {
  310. reg = <4>;
  311. mediatek,led-config = <
  312. 0x21 0x8009 /* BASIC_CTRL */
  313. 0x22 0x0c00 /* ON_DURATION */
  314. 0x23 0x1400 /* BLINK_DURATION */
  315. 0x24 0x8000 /* LED0_ON_CTRL */
  316. 0x25 0x0000 /* LED0_BLINK_CTRL */
  317. 0x26 0xc007 /* LED1_ON_CTRL */
  318. 0x27 0x003f /* LED1_BLINK_CTRL */
  319. >;
  320. };
  321. };
  322. };
  323. &watchdog {
  324. status = "okay";
  325. };
  326. &wifi {
  327. nvmem-cells = <&eeprom_factory_0>;
  328. nvmem-cell-names = "eeprom";
  329. pinctrl-0 = <&wf_2g_5g_pins>;
  330. pinctrl-1 = <&wf_dbdc_pins>;
  331. pinctrl-names = "default", "dbdc";
  332. status = "okay";
  333. };
  334. &trng {
  335. status = "okay";
  336. };
  337. &uart0 {
  338. status = "okay";
  339. };
  340. &ssusb {
  341. vusb33-supply = <&reg_3p3v>;
  342. vbus-supply = <&reg_5v>;
  343. status = "okay";
  344. };
  345. &usb_phy {
  346. status = "okay";
  347. };