2
0

mt7981b-routerich-ax3000.dts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. // SPDX-License-Identifier: GPL-2.0-only OR MIT
  2. /dts-v1/;
  3. #include <dt-bindings/gpio/gpio.h>
  4. #include <dt-bindings/input/input.h>
  5. #include <dt-bindings/leds/common.h>
  6. #include "mt7981.dtsi"
  7. / {
  8. model = "Routerich AX3000";
  9. compatible = "routerich,ax3000", "mediatek,mt7981";
  10. aliases {
  11. label-mac-device = &wan;
  12. led-boot = &led_power_blue;
  13. led-failsafe = &led_power_blue;
  14. led-running = &led_power_blue;
  15. led-upgrade = &led_power_blue;
  16. serial0 = &uart0;
  17. };
  18. chosen {
  19. stdout-path = "serial0:115200n8";
  20. };
  21. gpio-keys {
  22. compatible = "gpio-keys";
  23. button-0 {
  24. label = "mesh";
  25. linux,input-type = <EV_SW>;
  26. linux,code = <BTN_0>;
  27. gpios = <&pio 0 GPIO_ACTIVE_LOW>;
  28. debounce-interval = <60>;
  29. };
  30. button-1 {
  31. label = "reset";
  32. gpios = <&pio 1 GPIO_ACTIVE_LOW>;
  33. linux,code = <KEY_RESTART>;
  34. debounce-interval = <60>;
  35. };
  36. };
  37. leds {
  38. compatible = "gpio-leds";
  39. led-0 {
  40. color = <LED_COLOR_ID_RED>;
  41. function = LED_FUNCTION_WLAN;
  42. function-enumerator = <50>;
  43. gpios = <&pio 5 GPIO_ACTIVE_LOW>;
  44. linux,default-trigger = "phy1tpt";
  45. };
  46. led-1 {
  47. color = <LED_COLOR_ID_RED>;
  48. function = LED_FUNCTION_WAN;
  49. gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
  50. };
  51. led_power_blue: led-2 {
  52. color = <LED_COLOR_ID_BLUE>;
  53. function = LED_FUNCTION_POWER;
  54. gpios = <&pio 7 GPIO_ACTIVE_LOW>;
  55. };
  56. led-3 {
  57. color = <LED_COLOR_ID_BLUE>;
  58. function = LED_FUNCTION_LAN;
  59. function-enumerator = <1>;
  60. gpios = <&pio 9 GPIO_ACTIVE_LOW>;
  61. };
  62. led-4 {
  63. color = <LED_COLOR_ID_BLUE>;
  64. function = LED_FUNCTION_LAN;
  65. function-enumerator = <2>;
  66. gpios = <&pio 10 GPIO_ACTIVE_LOW>;
  67. };
  68. led-5 {
  69. color = <LED_COLOR_ID_BLUE>;
  70. function = LED_FUNCTION_LAN;
  71. function-enumerator = <3>;
  72. gpios = <&pio 11 GPIO_ACTIVE_LOW>;
  73. };
  74. led-6 {
  75. color = <LED_COLOR_ID_BLUE>;
  76. function = LED_FUNCTION_WAN;
  77. gpios = <&pio 12 GPIO_ACTIVE_LOW>;
  78. };
  79. led-7 {
  80. color = <LED_COLOR_ID_BLUE>;
  81. function = LED_FUNCTION_WLAN;
  82. function-enumerator = <24>;
  83. gpios = <&pio 34 GPIO_ACTIVE_LOW>;
  84. linux,default-trigger = "phy0tpt";
  85. };
  86. led-8 {
  87. color = <LED_COLOR_ID_BLUE>;
  88. /* LED_FUNCTION_MESH isn't implemented yet */
  89. function = "mesh";
  90. gpios = <&pio 35 GPIO_ACTIVE_LOW>;
  91. };
  92. };
  93. memory {
  94. reg = <0 0x40000000 0 0x10000000>;
  95. };
  96. };
  97. &eth {
  98. status = "okay";
  99. gmac0: mac@0 {
  100. compatible = "mediatek,eth-mac";
  101. reg = <0>;
  102. phy-mode = "2500base-x";
  103. nvmem-cell-names = "mac-address";
  104. nvmem-cells = <&macaddr_factory_4 (-1)>;
  105. fixed-link {
  106. speed = <2500>;
  107. full-duplex;
  108. pause;
  109. };
  110. };
  111. };
  112. &mdio_bus {
  113. switch: switch@1f {
  114. compatible = "mediatek,mt7531";
  115. reg = <0x1f>;
  116. reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
  117. interrupt-controller;
  118. #interrupt-cells = <1>;
  119. interrupt-parent = <&pio>;
  120. interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
  121. };
  122. };
  123. &spi0 {
  124. pinctrl-names = "default";
  125. pinctrl-0 = <&spi0_flash_pins>;
  126. status = "okay";
  127. /* ESMT F50L1G41LB (128M) */
  128. spi_nand@0 {
  129. #address-cells = <1>;
  130. #size-cells = <1>;
  131. compatible = "spi-nand";
  132. reg = <0>;
  133. spi-max-frequency = <52000000>;
  134. spi-tx-bus-width = <4>;
  135. spi-rx-bus-width = <4>;
  136. spi-cal-enable;
  137. spi-cal-mode = "read-data";
  138. spi-cal-datalen = <7>;
  139. spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>;
  140. spi-cal-addrlen = <5>;
  141. spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
  142. mediatek,nmbm;
  143. mediatek,bmt-max-ratio = <1>;
  144. mediatek,bmt-max-reserved-blocks = <64>;
  145. partitions {
  146. compatible = "fixed-partitions";
  147. #address-cells = <1>;
  148. #size-cells = <1>;
  149. partition@0_all {
  150. label = "spi0.0";
  151. reg = <0x0 0x8000000>;
  152. read-only;
  153. };
  154. partition@0 {
  155. label = "BL2";
  156. reg = <0x0 0x100000>;
  157. read-only;
  158. };
  159. partition@100000 {
  160. label = "u-boot-env";
  161. reg = <0x100000 0x80000>;
  162. };
  163. partition@180000 {
  164. label = "Factory";
  165. reg = <0x180000 0x200000>;
  166. read-only;
  167. nvmem-layout {
  168. compatible = "fixed-layout";
  169. #address-cells = <1>;
  170. #size-cells = <1>;
  171. eeprom_factory_0: eeprom@0 {
  172. reg = <0x0 0x1000>;
  173. };
  174. macaddr_factory_4: macaddr@4 {
  175. compatible = "mac-base";
  176. reg = <0x4 0x6>;
  177. #nvmem-cell-cells = <1>;
  178. };
  179. };
  180. };
  181. partition@380000 {
  182. label = "FIP";
  183. reg = <0x380000 0x200000>;
  184. read-only;
  185. };
  186. partition@580000 {
  187. label = "ubi";
  188. reg = <0x580000 0x4000000>;
  189. };
  190. partition@4580000 {
  191. label = "firmware_backup";
  192. reg = <0x4580000 0x2000000>;
  193. read-only;
  194. };
  195. partition@6580000 {
  196. label = "zrsave";
  197. reg = <0x6580000 0x100000>;
  198. read-only;
  199. };
  200. partition@6680000 {
  201. label = "config2";
  202. reg = <0x6680000 0x100000>;
  203. read-only;
  204. };
  205. };
  206. };
  207. };
  208. &switch {
  209. ports {
  210. #address-cells = <1>;
  211. #size-cells = <0>;
  212. port@0 {
  213. reg = <0>;
  214. label = "lan1";
  215. };
  216. port@2 {
  217. reg = <2>;
  218. label = "lan2";
  219. };
  220. port@3 {
  221. reg = <3>;
  222. label = "lan3";
  223. };
  224. wan: port@4 {
  225. reg = <4>;
  226. label = "wan";
  227. nvmem-cell-names = "mac-address";
  228. nvmem-cells = <&macaddr_factory_4 (-2)>;
  229. };
  230. port@6 {
  231. reg = <6>;
  232. ethernet = <&gmac0>;
  233. phy-mode = "2500base-x";
  234. fixed-link {
  235. speed = <2500>;
  236. full-duplex;
  237. pause;
  238. };
  239. };
  240. };
  241. };
  242. &pio {
  243. spi0_flash_pins: spi0-pins {
  244. mux {
  245. function = "spi";
  246. groups = "spi0", "spi0_wp_hold";
  247. };
  248. conf-pu {
  249. pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
  250. drive-strength = <MTK_DRIVE_8mA>;
  251. bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
  252. };
  253. conf-pd {
  254. pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
  255. drive-strength = <MTK_DRIVE_8mA>;
  256. bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
  257. };
  258. };
  259. };
  260. &uart0 {
  261. status = "okay";
  262. };
  263. &usb_phy {
  264. status = "okay";
  265. };
  266. &watchdog {
  267. status = "okay";
  268. };
  269. &wifi {
  270. status = "okay";
  271. nvmem-cell-names = "eeprom";
  272. nvmem-cells = <&eeprom_factory_0>;
  273. };
  274. &xhci {
  275. status = "okay";
  276. mediatek,u3p-dis-msk = <0x1>;
  277. };