mt7981b-cudy-wr3000-v1.dts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. // SPDX-License-Identifier: (GPL-2.0 OR MIT)
  2. /dts-v1/;
  3. #include "mt7981.dtsi"
  4. / {
  5. model = "Cudy WR3000 v1";
  6. compatible = "cudy,wr3000-v1", "mediatek,mt7981";
  7. aliases {
  8. ethernet0 = &gmac0;
  9. label-mac-device = &lan1;
  10. led-boot = &led_status;
  11. led-failsafe = &led_status;
  12. led-running = &led_status;
  13. led-upgrade = &led_status;
  14. serial0 = &uart0;
  15. };
  16. chosen {
  17. stdout-path = "serial0:115200n8";
  18. };
  19. gpio-keys {
  20. compatible = "gpio-keys";
  21. reset {
  22. label = "reset";
  23. linux,code = <KEY_RESTART>;
  24. gpios = <&pio 1 GPIO_ACTIVE_LOW>;
  25. };
  26. wps {
  27. label = "wps";
  28. linux,code = <KEY_WPS_BUTTON>;
  29. gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
  30. };
  31. };
  32. leds {
  33. compatible = "gpio-leds";
  34. led_status: led@0 {
  35. label = "blue:status";
  36. gpios = <&pio 10 GPIO_ACTIVE_LOW>;
  37. };
  38. led@1 {
  39. label = "blue:internet";
  40. gpios = <&pio 11 GPIO_ACTIVE_LOW>;
  41. };
  42. led@2 {
  43. label = "blue:wan";
  44. gpios = <&pio 5 GPIO_ACTIVE_LOW>;
  45. };
  46. led@3 {
  47. label = "blue:lan";
  48. gpios = <&pio 9 GPIO_ACTIVE_LOW>;
  49. };
  50. led@4 {
  51. label = "blue:wifi2";
  52. gpios = <&pio 6 GPIO_ACTIVE_LOW>;
  53. linux,default-trigger = "phy0tpt";
  54. };
  55. led@5 {
  56. label = "blue:wifi5";
  57. gpios = <&pio 7 GPIO_ACTIVE_LOW>;
  58. linux,default-trigger = "phy1tpt";
  59. };
  60. };
  61. };
  62. &uart0 {
  63. status = "okay";
  64. };
  65. &watchdog {
  66. status = "okay";
  67. };
  68. &eth {
  69. pinctrl-names = "default";
  70. pinctrl-0 = <&mdio_pins>;
  71. status = "okay";
  72. gmac0: mac@0 {
  73. compatible = "mediatek,eth-mac";
  74. reg = <0>;
  75. phy-mode = "2500base-x";
  76. nvmem-cell-names = "mac-address";
  77. nvmem-cells = <&macaddr_bdinfo_de00>;
  78. fixed-link {
  79. speed = <2500>;
  80. full-duplex;
  81. pause;
  82. };
  83. };
  84. gmac1: mac@1 {
  85. compatible = "mediatek,eth-mac";
  86. reg = <1>;
  87. status = "disabled";
  88. };
  89. };
  90. &mdio_bus {
  91. switch: switch@1f {
  92. compatible = "mediatek,mt7531";
  93. reg = <31>;
  94. reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
  95. };
  96. };
  97. &spi0 {
  98. pinctrl-names = "default";
  99. pinctrl-0 = <&spi0_flash_pins>;
  100. status = "disabled";
  101. };
  102. &spi2 {
  103. pinctrl-names = "default";
  104. pinctrl-0 = <&spi2_flash_pins>;
  105. status = "okay";
  106. flash@0 {
  107. #address-cells = <1>;
  108. #size-cells = <1>;
  109. compatible = "jedec,spi-nor";
  110. reg = <0>;
  111. spi-max-frequency = <25000000>;
  112. spi-tx-bus-width = <4>;
  113. spi-rx-bus-width = <4>;
  114. partitions {
  115. compatible = "fixed-partitions";
  116. #address-cells = <1>;
  117. #size-cells = <1>;
  118. partition@00000 {
  119. label = "BL2";
  120. reg = <0x00000 0x40000>;
  121. read-only;
  122. };
  123. partition@40000 {
  124. label = "u-boot-env";
  125. reg = <0x40000 0x10000>;
  126. read-only;
  127. };
  128. factory: partition@50000 {
  129. label = "Factory";
  130. reg = <0x50000 0x10000>;
  131. read-only;
  132. };
  133. bdinfo: partition@60000 {
  134. label = "bdinfo";
  135. reg = <0x60000 0x10000>;
  136. read-only;
  137. nvmem-layout {
  138. compatible = "fixed-layout";
  139. #address-cells = <1>;
  140. #size-cells = <1>;
  141. macaddr_bdinfo_de00: macaddr@de00 {
  142. reg = <0xde00 0x6>;
  143. };
  144. };
  145. };
  146. partition@70000 {
  147. label = "FIP";
  148. reg = <0x70000 0x80000>;
  149. read-only;
  150. };
  151. partition@f0000 {
  152. compatible = "denx,fit";
  153. label = "firmware";
  154. reg = <0xf0000 0xf10000>;
  155. };
  156. };
  157. };
  158. };
  159. &pio {
  160. spi0_flash_pins: spi0-pins {
  161. mux {
  162. function = "spi";
  163. groups = "spi0", "spi0_wp_hold";
  164. };
  165. };
  166. spi2_flash_pins: spi2-pins {
  167. mux {
  168. function = "spi";
  169. groups = "spi2", "spi2_wp_hold";
  170. };
  171. conf-pu {
  172. pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
  173. drive-strength = <8>;
  174. bias-pull-up = <103>;
  175. };
  176. conf-pd {
  177. pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
  178. drive-strength = <8>;
  179. bias-pull-down = <103>;
  180. };
  181. };
  182. };
  183. &switch {
  184. ports {
  185. #address-cells = <1>;
  186. #size-cells = <0>;
  187. port@0 {
  188. reg = <0>;
  189. label = "wan";
  190. nvmem-cell-names = "mac-address";
  191. nvmem-cells = <&macaddr_bdinfo_de00>;
  192. mac-address-increment = <1>;
  193. };
  194. lan1: port@1 {
  195. reg = <1>;
  196. label = "lan1";
  197. nvmem-cell-names = "mac-address";
  198. nvmem-cells = <&macaddr_bdinfo_de00>;
  199. };
  200. port@2 {
  201. reg = <2>;
  202. label = "lan2";
  203. nvmem-cell-names = "mac-address";
  204. nvmem-cells = <&macaddr_bdinfo_de00>;
  205. };
  206. port@3 {
  207. reg = <3>;
  208. label = "lan3";
  209. nvmem-cell-names = "mac-address";
  210. nvmem-cells = <&macaddr_bdinfo_de00>;
  211. };
  212. port@6 {
  213. reg = <6>;
  214. label = "cpu";
  215. ethernet = <&gmac0>;
  216. phy-mode = "2500base-x";
  217. fixed-link {
  218. speed = <2500>;
  219. full-duplex;
  220. pause;
  221. };
  222. };
  223. };
  224. };
  225. &wifi {
  226. status = "okay";
  227. mediatek,mtd-eeprom = <&factory 0x0>;
  228. };