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