mediatek: add support for Zyxel EX5601-T0 router
[openwrt/staging/ldir.git] / target / linux / mediatek / dts / mt7986a-zyxel-ex5601-t0-stock.dts
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
2 /*
3 * Copyright (C) 2021 MediaTek Inc.
4 * Author: Sam.Shih <sam.shih@mediatek.com>
5 */
6
7 /dts-v1/;
8 #include "mt7986a.dtsi"
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11
12 / {
13 model = "Zyxel EX5601-T0";
14 compatible = "zyxel,ex5601-t0", "mediatek,mt7986a-rfb-snand";
15
16 aliases {
17 serial0 = &uart0;
18 };
19
20 chosen {
21 stdout-path = "serial0:115200n8";
22 };
23
24 memory {
25 reg = <0 0x40000000 0 0x40000000>;
26 };
27
28 reg_1p8v: regulator-1p8v {
29 compatible = "regulator-fixed";
30 regulator-name = "fixed-1.8V";
31 regulator-min-microvolt = <1800000>;
32 regulator-max-microvolt = <1800000>;
33 regulator-boot-on;
34 regulator-always-on;
35 };
36
37 reg_3p3v: regulator-3p3v {
38 compatible = "regulator-fixed";
39 regulator-name = "fixed-3.3V";
40 regulator-min-microvolt = <3300000>;
41 regulator-max-microvolt = <3300000>;
42 regulator-boot-on;
43 regulator-always-on;
44 };
45
46 reg_5v: regulator-5v {
47 compatible = "regulator-fixed";
48 regulator-name = "fixed-5V";
49 regulator-min-microvolt = <5000000>;
50 regulator-max-microvolt = <5000000>;
51 regulator-boot-on;
52 regulator-always-on;
53 };
54
55 gpio-keys {
56 compatible = "gpio-keys";
57 poll-interval = <20>;
58
59 reset-button {
60 label = "reset";
61 gpios = <&pio 21 GPIO_ACTIVE_LOW>;
62 linux,code = <KEY_RESTART>;
63 };
64
65 wlan-button {
66 label = "wlan";
67 gpios = <&pio 11 GPIO_ACTIVE_LOW>;
68 linux,code = <KEY_WLAN>;
69 };
70 wps-button {
71 label = "wps";
72 gpios = <&pio 56 GPIO_ACTIVE_LOW>;
73 linux,code = <KEY_WPS_BUTTON>;
74 };
75 };
76
77 zyleds {
78 compatible = "gpio-leds";
79
80 led_green_wifi24g {
81 label = "zyled-green-wifi24g";
82 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
83 default-state = "off";
84 };
85
86 led_green_wifi5g {
87 label = "zyled-green-wifi5g";
88 gpios = <&pio 2 GPIO_ACTIVE_LOW>;
89 default-state = "off";
90 };
91
92 led_green_inet {
93 label = "zyled-green-inet";
94 gpios = <&pio 14 GPIO_ACTIVE_LOW>;
95 default-state = "off";
96 };
97
98 led_red_inet {
99 label = "zyled-red-inet";
100 gpios = <&pio 15 GPIO_ACTIVE_LOW>;
101 default-state = "off";
102 };
103
104 led_green_pwr {
105 label = "zyled-green-pwr";
106 gpios = <&pio 13 GPIO_ACTIVE_LOW>;
107 linux,default-trigger = "timer"; /* Default blinking */
108 led-pattern = <125 125>; /* Fast blink is 4 HZ */
109 };
110
111 led_red_pwr {
112 label = "zyled-red-pwr";
113 gpios = <&pio 12 GPIO_ACTIVE_LOW>;
114 default-state = "off";
115 };
116
117 led_green_fxs {
118 label = "zyled-green-fxs";
119 gpios = <&pio 16 GPIO_ACTIVE_HIGH>;
120 default-state = "off";
121 };
122
123 led_amber_fxs {
124 label = "zyled-amber-fxs";
125 gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
126 default-state = "off";
127 };
128
129 led_amber_wps24g {
130 label = "zyled-amber-wps24g";
131 gpios = <&pio 18 GPIO_ACTIVE_HIGH>;
132 default-state = "off";
133 };
134
135 led_amber_wps5g {
136 label = "zyled-amber-wps5g";
137 gpios = <&pio 19 GPIO_ACTIVE_HIGH>;
138 default-state = "off";
139 };
140
141 led_green_lan {
142 label = "zyled-green-lan";
143 gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
144 default-state = "off";
145 };
146
147 led_green_sfp {
148 label = "zyled-green-sfp";
149 gpios = <&pio 24 GPIO_ACTIVE_HIGH>;
150 default-state = "off";
151 };
152
153 };
154
155 };
156
157 &eth {
158 status = "okay";
159
160 gmac0: mac@0 {
161 compatible = "mediatek,eth-mac";
162 reg = <0>;
163 phy-mode = "2500base-x";
164
165 nvmem-cells = <&macaddr_factory_002a>;
166 nvmem-cell-names = "mac-address";
167
168 fixed-link {
169 speed = <2500>;
170 full-duplex;
171 pause;
172 };
173 };
174
175 gmac1: mac@1 {
176 compatible = "mediatek,eth-mac";
177 reg = <1>;
178 phy-mode = "2500base-x";
179 phy = <&phy6>;
180
181 nvmem-cells = <&macaddr_factory_0024>;
182 nvmem-cell-names = "mac-address";
183 };
184
185 mdio: mdio-bus {
186 #address-cells = <1>;
187 #size-cells = <0>;
188 reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
189 reset-delay-us = <1500000>;
190 reset-post-delay-us = <1000000>;
191
192 phy5: phy@5 {
193 compatible = "ethernet-phy-ieee802.3-c45";
194 reg = <5>;
195 };
196
197 phy6: phy@6 {
198 compatible = "ethernet-phy-ieee802.3-c45";
199 reg = <6>;
200 };
201
202 switch@0 {
203 compatible = "mediatek,mt7531";
204 reg = <31>;
205 reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
206
207 ports {
208 #address-cells = <1>;
209 #size-cells = <0>;
210
211 port@1 {
212 reg = <1>;
213 label = "lan1";
214 };
215
216 port@2 {
217 reg = <2>;
218 label = "lan2";
219 };
220
221 port@3 {
222 reg = <3>;
223 label = "lan3";
224 };
225
226 port@5 {
227 reg = <5>;
228 label = "lan4";
229 phy-mode = "2500base-x";
230 phy = <&phy5>;
231 };
232
233 port@6 {
234 reg = <6>;
235 ethernet = <&gmac0>;
236 phy-mode = "2500base-x";
237
238 fixed-link {
239 speed = <2500>;
240 full-duplex;
241 pause;
242 };
243 };
244 };
245 };
246 };
247 };
248
249 &wmac {
250 status = "okay";
251 pinctrl-names = "default", "dbdc";
252 pinctrl-0 = <&wf_2g_5g_pins>;
253 pinctrl-1 = <&wf_dbdc_pins>;
254 mediatek,mtd-eeprom = <&factory 0x0>;
255 nvmem-cells = <&macaddr_factory_0004>;
256 nvmem-cell-names = "mac-address";
257 };
258
259 &crypto {
260 status = "okay";
261 };
262
263 &mmc0 {
264 pinctrl-names = "default", "state_uhs";
265 pinctrl-0 = <&mmc0_pins_default>;
266 pinctrl-1 = <&mmc0_pins_uhs>;
267 bus-width = <8>;
268 max-frequency = <200000000>;
269 cap-mmc-highspeed;
270 mmc-hs200-1_8v;
271 mmc-hs400-1_8v;
272 hs400-ds-delay = <0x14014>;
273 vmmc-supply = <&reg_3p3v>;
274 vqmmc-supply = <&reg_1p8v>;
275 non-removable;
276 no-sd;
277 no-sdio;
278 status = "disabled";
279 };
280
281 &pcie {
282 pinctrl-names = "default";
283 pinctrl-0 = <&pcie_pins>;
284 status = "okay";
285 };
286
287 &pcie_phy {
288 status = "okay";
289 };
290
291 &pio {
292 mmc0_pins_default: mmc0-pins {
293 mux {
294 function = "emmc";
295 groups = "emmc_51";
296 };
297 conf-cmd-dat {
298 pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
299 "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
300 "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
301 input-enable;
302 drive-strength = <4>;
303 mediatek,pull-up-adv = <1>; /* pull-up 10K */
304 };
305 conf-clk {
306 pins = "EMMC_CK";
307 drive-strength = <6>;
308 mediatek,pull-down-adv = <2>; /* pull-down 50K */
309 };
310 conf-ds {
311 pins = "EMMC_DSL";
312 mediatek,pull-down-adv = <2>; /* pull-down 50K */
313 };
314 conf-rst {
315 pins = "EMMC_RSTB";
316 drive-strength = <4>;
317 mediatek,pull-up-adv = <1>; /* pull-up 10K */
318 };
319 };
320
321 mmc0_pins_uhs: mmc0-uhs-pins {
322 mux {
323 function = "emmc";
324 groups = "emmc_51";
325 };
326 conf-cmd-dat {
327 pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
328 "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
329 "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
330 input-enable;
331 drive-strength = <4>;
332 mediatek,pull-up-adv = <1>; /* pull-up 10K */
333 };
334 conf-clk {
335 pins = "EMMC_CK";
336 drive-strength = <6>;
337 mediatek,pull-down-adv = <2>; /* pull-down 50K */
338 };
339 conf-ds {
340 pins = "EMMC_DSL";
341 mediatek,pull-down-adv = <2>; /* pull-down 50K */
342 };
343 conf-rst {
344 pins = "EMMC_RSTB";
345 drive-strength = <4>;
346 mediatek,pull-up-adv = <1>; /* pull-up 10K */
347 };
348 };
349
350 pcie_pins: pcie-pins {
351 mux {
352 function = "pcie";
353 groups = "pcie_clk", "pcie_wake", "pcie_pereset";
354 };
355 };
356
357 spic_pins_g2: spic-pins-29-to-32 {
358 mux {
359 function = "spi";
360 groups = "spi1_2";
361 };
362 };
363
364 spi_flash_pins: spi-flash-pins-33-to-38 {
365 mux {
366 function = "spi";
367 groups = "spi0", "spi0_wp_hold";
368 };
369 conf-pu {
370 pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
371 drive-strength = <8>;
372 mediatek,pull-up-adv = <0>; /* bias-disable */
373 };
374 conf-pd {
375 pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
376 drive-strength = <8>;
377 mediatek,pull-down-adv = <0>; /* bias-disable */
378 };
379 };
380
381 uart1_pins: uart1-pins {
382 mux {
383 function = "uart";
384 groups = "uart1";
385 };
386 };
387
388 uart2_pins: uart2-pins {
389 mux {
390 function = "uart";
391 groups = "uart2";
392 };
393 };
394
395 wf_2g_5g_pins: wf_2g_5g-pins {
396 mux {
397 function = "wifi";
398 groups = "wf_2g", "wf_5g";
399 };
400 conf {
401 pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
402 "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
403 "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
404 "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
405 "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
406 "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
407 "WF1_TOP_CLK", "WF1_TOP_DATA";
408 drive-strength = <4>;
409 };
410 };
411
412 wf_dbdc_pins: wf_dbdc-pins {
413 mux {
414 function = "wifi";
415 groups = "wf_dbdc";
416 };
417 conf {
418 pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
419 "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
420 "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
421 "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
422 "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
423 "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
424 "WF1_TOP_CLK", "WF1_TOP_DATA";
425 drive-strength = <4>;
426 };
427 };
428 };
429
430 &spi0 {
431 pinctrl-names = "default";
432 pinctrl-0 = <&spi_flash_pins>;
433 cs-gpios = <0>, <0>;
434 #address-cells = <1>;
435 #size-cells = <0>;
436 status = "okay";
437
438 spi_nand: spi_nand@0 {
439 #address-cells = <1>;
440 #size-cells = <1>;
441 compatible = "spi-nand";
442 reg = <1>;
443 spi-max-frequency = <10000000>;
444 spi-tx-buswidth = <4>;
445 spi-rx-buswidth = <4>;
446
447 partitions {
448 compatible = "fixed-partitions";
449 #address-cells = <1>;
450 #size-cells = <1>;
451
452 partition@0 {
453 label = "BL2";
454 reg = <0x00000 0x0100000>;
455 read-only;
456 };
457
458 partition@100000 {
459 label = "u-boot-env";
460 reg = <0x0100000 0x0080000>;
461 };
462
463 factory: partition@180000 {
464 label = "Factory";
465 reg = <0x180000 0x0200000>;
466 read-only;
467 };
468
469 partition@380000 {
470 label = "FIP";
471 reg = <0x380000 0x01C0000>;
472 read-only;
473 };
474
475 partition@540000 {
476 label = "zloader";
477 reg = <0x540000 0x0040000>;
478 read-only;
479 };
480
481 partition@580000 {
482 label = "ubi";
483 reg = <0x580000 0x4000000>;
484 };
485
486 partition@4580000 {
487 label = "ubi2";
488 reg = <0x4580000 0x4000000>;
489 read-only;
490 };
491
492 partition@8580000 {
493 label = "zyubi";
494 reg = <0x8580000 0x15A80000>;
495 };
496 };
497 };
498 };
499
500 &spi1 {
501 pinctrl-names = "default";
502 pinctrl-0 = <&spic_pins_g2>;
503 status = "okay";
504
505 proslic_spi: proslic_spi@0 {
506 compatible = "silabs,proslic_spi";
507 reg = <0>;
508 spi-max-frequency = <10000000>;
509 spi-cpha = <1>;
510 spi-cpol = <1>;
511 channel_count = <1>;
512 debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */
513 reset_gpio = <&pio 7 GPIO_ACTIVE_HIGH>;
514 ig,enable-spi = <1>; /* 1: Enable, 0: Disable */
515 };
516 };
517
518 &ssusb {
519 vusb33-supply = <&reg_3p3v>;
520 vbus-supply = <&reg_5v>;
521 status = "okay";
522 };
523
524 &uart0 {
525 status = "okay";
526 };
527
528 &uart1 {
529 pinctrl-names = "default";
530 pinctrl-0 = <&uart1_pins>;
531 status = "okay";
532 };
533
534 &uart2 {
535 pinctrl-names = "default";
536 pinctrl-0 = <&uart2_pins>;
537 status = "okay";
538 };
539
540 &usb_phy {
541 status = "okay";
542 };
543
544 &factory {
545 compatible = "nvmem-cells";
546 #address-cells = <1>;
547 #size-cells = <1>;
548
549 macaddr_factory_0004: macaddr@0004 {
550 reg = <0x0004 0x6>;
551 };
552
553 macaddr_factory_0024: macaddr@0024 {
554 reg = <0x0024 0x6>;
555 };
556
557 macaddr_factory_002a: macaddr@002a {
558 reg = <0x002a 0x6>;
559 };
560 };