867982b06116a8af8f287af51314263edcb2f54f
[openwrt/staging/nbd.git] / target / linux / mediatek / dts / mt7622-elecom-wrc-2533gent.dts
1 // SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2 /*
3 * Copyright (c) 2017 MediaTek Inc.
4 * Author: Ming Huang <ming.huang@mediatek.com>
5 * Sean Wang <sean.wang@mediatek.com>
6 */
7
8 /dts-v1/;
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/gpio/gpio.h>
11
12 #include "mt7622.dtsi"
13 #include "mt6380.dtsi"
14
15 / {
16 model = "Elecom WRC-2533";
17 compatible = "elecom,wrc-2533gent", "mediatek,mt7622";
18
19 aliases {
20 led-boot = &led_power;
21 led-failsafe = &led_power;
22 led-running = &led_power;
23 led-upgrade = &led_power;
24 serial0 = &uart0;
25 };
26
27 chosen {
28 stdout-path = "serial0:115200n8";
29 bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 console=ttyS0,115200n8";
30 };
31
32 cpus {
33 cpu@0 {
34 proc-supply = <&mt6380_vcpu_reg>;
35 sram-supply = <&mt6380_vm_reg>;
36 };
37
38 cpu@1 {
39 proc-supply = <&mt6380_vcpu_reg>;
40 sram-supply = <&mt6380_vm_reg>;
41 };
42 };
43
44 gpio-keys {
45 compatible = "gpio-keys";
46 poll-interval = <100>;
47
48 wps {
49 label = "wps";
50 linux,code = <KEY_WPS_BUTTON>;
51 gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
52 };
53
54 factory {
55 label = "factory";
56 linux,code = <KEY_WPS_BUTTON>;
57 gpios = <&pio 102 GPIO_ACTIVE_LOW>;
58 };
59
60 switch0 {
61 label = "switch0";
62 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
63 linux,code = <BTN_0>;
64 linux,input-type = <EV_SW>;
65 };
66
67 switch1 {
68 label = "switch1";
69 gpios = <&pio 16 GPIO_ACTIVE_LOW>;
70 linux,code = <BTN_1>;
71 linux,input-type = <EV_SW>;
72 };
73
74 switch2 {
75 label = "switch2";
76 gpios = <&pio 17 GPIO_ACTIVE_LOW>;
77 linux,code = <BTN_2>;
78 linux,input-type = <EV_SW>;
79 };
80
81 switch3 {
82 label = "switch3";
83 gpios = <&pio 18 GPIO_ACTIVE_LOW>;
84 linux,code = <BTN_3>;
85 linux,input-type = <EV_SW>;
86 };
87 };
88
89 leds {
90 compatible = "gpio-leds";
91
92 led_power: power_g {
93 label = "wrc-2533:green:power";
94 gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
95 };
96
97 power_b {
98 label = "wrc-2533:blue:power";
99 gpios = <&pio 19 GPIO_ACTIVE_HIGH>;
100 };
101
102 power_r {
103 label = "wrc-2533:red:power";
104 gpios = <&pio 73 GPIO_ACTIVE_HIGH>;
105 };
106
107 usb {
108 label = "wrc-2533:blue:usb";
109 gpios = <&pio 74 GPIO_ACTIVE_HIGH>;
110 };
111
112 wps {
113 label = "wrc-2533:red:wps";
114 gpios = <&pio 76 GPIO_ACTIVE_LOW>;
115 };
116
117 wifi2 {
118 label = "wrc-2533:blue:wifi2g";
119 gpios = <&pio 85 GPIO_ACTIVE_LOW>;
120 };
121
122 wifi5 {
123 label = "wrc-2533:blue:wifi5g";
124 gpios = <&pio 91 GPIO_ACTIVE_LOW>;
125 };
126 };
127
128 reg_usb_vbus: regulator {
129 compatible = "regulator-fixed";
130 regulator-name = "usb_vbus";
131 regulator-min-microvolt = <5000000>;
132 regulator-max-microvolt = <5000000>;
133 gpio = <&pio 22 GPIO_ACTIVE_LOW>;
134 enable-active-high;
135 };
136
137 memory {
138 reg = <0 0x40000000 0 0x3F000000>;
139 };
140
141 reg_1p8v: regulator-1p8v {
142 compatible = "regulator-fixed";
143 regulator-name = "fixed-1.8V";
144 regulator-min-microvolt = <1800000>;
145 regulator-max-microvolt = <1800000>;
146 regulator-always-on;
147 };
148
149 reg_3p3v: regulator-3p3v {
150 compatible = "regulator-fixed";
151 regulator-name = "fixed-3.3V";
152 regulator-min-microvolt = <3300000>;
153 regulator-max-microvolt = <3300000>;
154 regulator-boot-on;
155 regulator-always-on;
156 };
157
158 rtkgsw: rtkgsw@0 {
159 compatible = "mediatek,rtk-gsw";
160 mediatek,ethsys = <&ethsys>;
161 mediatek,mdio = <&mdio>;
162 mediatek,reset-pin = <&pio 54 0>;
163 status = "okay";
164 };
165 };
166
167 &pcie0 {
168 pinctrl-names = "default";
169 pinctrl-0 = <&pcie0_pins>;
170 status = "okay";
171 };
172
173 &slot0 {
174 mt7615@0,0 {
175 reg = <0x0000 0 0 0 0>;
176 mediatek,mtd-eeprom = <&factory 0x05000>;
177 };
178 };
179
180 &pio {
181 /* eMMC is shared pin with parallel NAND */
182 emmc_pins_default: emmc-pins-default {
183 mux {
184 function = "emmc", "emmc_rst";
185 groups = "emmc";
186 };
187
188 /* "NDL0","NDL1","NDL2","NDL3","NDL4","NDL5","NDL6","NDL7",
189 * "NRB","NCLE" pins are used as DAT0,DAT1,DAT2,DAT3,DAT4,
190 * DAT5,DAT6,DAT7,CMD,CLK for eMMC respectively
191 */
192 conf-cmd-dat {
193 pins = "NDL0", "NDL1", "NDL2",
194 "NDL3", "NDL4", "NDL5",
195 "NDL6", "NDL7", "NRB";
196 input-enable;
197 bias-pull-up;
198 };
199
200 conf-clk {
201 pins = "NCLE";
202 bias-pull-down;
203 };
204 };
205
206 emmc_pins_uhs: emmc-pins-uhs {
207 mux {
208 function = "emmc";
209 groups = "emmc";
210 };
211
212 conf-cmd-dat {
213 pins = "NDL0", "NDL1", "NDL2",
214 "NDL3", "NDL4", "NDL5",
215 "NDL6", "NDL7", "NRB";
216 input-enable;
217 drive-strength = <4>;
218 bias-pull-up;
219 };
220
221 conf-clk {
222 pins = "NCLE";
223 drive-strength = <4>;
224 bias-pull-down;
225 };
226 };
227
228 eth_pins: eth-pins {
229 mux {
230 function = "eth";
231 groups = "mdc_mdio", "rgmii_via_gmac2";
232 };
233 };
234
235 i2c1_pins: i2c1-pins {
236 mux {
237 function = "i2c";
238 groups = "i2c1_0";
239 };
240 };
241
242 i2c2_pins: i2c2-pins {
243 mux {
244 function = "i2c";
245 groups = "i2c2_0";
246 };
247 };
248
249 i2s1_pins: i2s1-pins {
250 mux {
251 function = "i2s";
252 groups = "i2s_out_mclk_bclk_ws",
253 "i2s1_in_data",
254 "i2s1_out_data";
255 };
256
257 conf {
258 pins = "I2S1_IN", "I2S1_OUT", "I2S_BCLK",
259 "I2S_WS", "I2S_MCLK";
260 drive-strength = <12>;
261 bias-pull-down;
262 };
263 };
264
265 irrx_pins: irrx-pins {
266 mux {
267 function = "ir";
268 groups = "ir_1_rx";
269 };
270 };
271
272 irtx_pins: irtx-pins {
273 mux {
274 function = "ir";
275 groups = "ir_1_tx";
276 };
277 };
278
279 /* Parallel nand is shared pin with eMMC */
280 parallel_nand_pins: parallel-nand-pins {
281 mux {
282 function = "flash";
283 groups = "par_nand";
284 };
285 };
286
287 pcie0_pins: pcie0-pins {
288 mux {
289 function = "pcie";
290 groups = "pcie0_pad_perst",
291 "pcie0_1_waken",
292 "pcie0_1_clkreq";
293 };
294 };
295
296 pcie1_pins: pcie1-pins {
297 mux {
298 function = "pcie";
299 groups = "pcie1_pad_perst",
300 "pcie1_0_waken",
301 "pcie1_0_clkreq";
302 };
303 };
304
305 pmic_bus_pins: pmic-bus-pins {
306 mux {
307 function = "pmic";
308 groups = "pmic_bus";
309 };
310 };
311
312 pwm7_pins: pwm1-2-pins {
313 mux {
314 function = "pwm";
315 groups = "pwm_ch7_2";
316 };
317 };
318
319 wled_pins: wled-pins {
320 mux {
321 function = "led";
322 groups = "wled";
323 };
324 };
325
326 sd0_pins_default: sd0-pins-default {
327 mux {
328 function = "sd";
329 groups = "sd_0";
330 };
331
332 /* "I2S2_OUT, "I2S4_IN"", "I2S3_IN", "I2S2_IN",
333 * "I2S4_OUT", "I2S3_OUT" are used as DAT0, DAT1,
334 * DAT2, DAT3, CMD, CLK for SD respectively.
335 */
336 conf-cmd-data {
337 pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN",
338 "I2S2_IN","I2S4_OUT";
339 input-enable;
340 drive-strength = <8>;
341 bias-pull-up;
342 };
343 conf-clk {
344 pins = "I2S3_OUT";
345 drive-strength = <12>;
346 bias-pull-down;
347 };
348 conf-cd {
349 pins = "TXD3";
350 bias-pull-up;
351 };
352 };
353
354 sd0_pins_uhs: sd0-pins-uhs {
355 mux {
356 function = "sd";
357 groups = "sd_0";
358 };
359
360 conf-cmd-data {
361 pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN",
362 "I2S2_IN","I2S4_OUT";
363 input-enable;
364 bias-pull-up;
365 };
366
367 conf-clk {
368 pins = "I2S3_OUT";
369 bias-pull-down;
370 };
371 };
372
373 /* Serial NAND is shared pin with SPI-NOR */
374 serial_nand_pins: serial-nand-pins {
375 mux {
376 function = "flash";
377 groups = "snfi";
378 };
379 };
380
381 spic0_pins: spic0-pins {
382 mux {
383 function = "spi";
384 groups = "spic0_0";
385 };
386 };
387
388 spic1_pins: spic1-pins {
389 mux {
390 function = "spi";
391 groups = "spic1_0";
392 };
393 };
394
395 /* SPI-NOR is shared pin with serial NAND */
396 spi_nor_pins: spi-nor-pins {
397 mux {
398 function = "flash";
399 groups = "spi_nor";
400 };
401 };
402
403 /* serial NAND is shared pin with SPI-NOR */
404 serial_nand_pins: serial-nand-pins {
405 mux {
406 function = "flash";
407 groups = "snfi";
408 };
409 };
410
411 uart0_pins: uart0-pins {
412 mux {
413 function = "uart";
414 groups = "uart0_0_tx_rx" ;
415 };
416 };
417
418 uart2_pins: uart2-pins {
419 mux {
420 function = "uart";
421 groups = "uart2_1_tx_rx" ;
422 };
423 };
424
425 watchdog_pins: watchdog-pins {
426 mux {
427 function = "watchdog";
428 groups = "watchdog";
429 };
430 };
431 };
432
433 &btif {
434 status = "disabled";
435 };
436
437 &cir {
438 pinctrl-names = "default";
439 pinctrl-0 = <&irrx_pins>;
440 status = "okay";
441 };
442
443 &eth {
444 status = "okay";
445 pinctrl-names = "default";
446 pinctrl-0 = <&eth_pins>;
447 gmac0: mac@0 {
448 compatible = "mediatek,eth-mac";
449 reg = <0>;
450 phy-mode = "sgmii";
451 fixed-link {
452 speed = <1000>;
453 full-duplex;
454 pause;
455 };
456 };
457
458 gmac1: mac@1 {
459 compatible = "mediatek,eth-mac";
460 reg = <1>;
461 phy-mode = "rgmii";
462 fixed-link {
463 speed = <1000>;
464 full-duplex;
465 pause;
466 };
467 };
468
469 mdio: mdio-bus {
470 #address-cells = <1>;
471 #size-cells = <0>;
472 };
473 };
474
475 &i2c1 {
476 pinctrl-names = "default";
477 pinctrl-0 = <&i2c1_pins>;
478 status = "okay";
479 };
480
481 &i2c2 {
482 pinctrl-names = "default";
483 pinctrl-0 = <&i2c2_pins>;
484 status = "okay";
485 };
486
487 &pwm {
488 pinctrl-names = "default";
489 pinctrl-0 = <&pwm7_pins>;
490 status = "okay";
491 };
492
493 &pwrap {
494 pinctrl-names = "default";
495 pinctrl-0 = <&pmic_bus_pins>;
496
497 status = "okay";
498 };
499
500 &snand {
501 mediatek,quad-spi;
502 pinctrl-names = "default";
503 pinctrl-0 = <&serial_nand_pins>;
504 status = "okay";
505
506 partitions {
507 compatible = "fixed-partitions";
508 #address-cells = <1>;
509 #size-cells = <1>;
510
511 partition@0 {
512 label = "Preloader";
513 reg = <0x00000 0x0080000>;
514 read-only;
515 };
516
517 partition@80000 {
518 label = "ATF";
519 reg = <0x80000 0x0040000>;
520 read-only;
521 };
522
523 partition@c0000 {
524 label = "uboot";
525 reg = <0xc0000 0x0080000>;
526 read-only;
527 };
528
529 partition@140000 {
530 label = "uboot-env";
531 reg = <0x140000 0x0080000>;
532 read-only;
533 };
534
535 factory: partition@1c0000 {
536 label = "factory";
537 reg = <0x1c0000 0x0040000>;
538 read-only;
539 };
540
541 partition@200000 {
542 label = "firmware";
543 reg = <0x200000 0x2000000>;
544 };
545
546 partition@2200000 {
547 label = "reserved";
548 reg = <0x2200000 0x4000000>;
549 };
550 };
551 };
552
553 &spi0 {
554 pinctrl-names = "default";
555 pinctrl-0 = <&spic0_pins>;
556 status = "okay";
557 };
558
559 &spi1 {
560 pinctrl-names = "default";
561 pinctrl-0 = <&spic1_pins>;
562 status = "okay";
563 };
564
565 &ssusb {
566 vusb33-supply = <&reg_3p3v>;
567 vbus-supply = <&reg_usb_vbus>;
568 status = "okay";
569 };
570
571 &u3phy {
572 status = "okay";
573 };
574
575 &uart0 {
576 pinctrl-names = "default";
577 pinctrl-0 = <&uart0_pins>;
578 status = "okay";
579 };
580
581 &uart2 {
582 pinctrl-names = "default";
583 pinctrl-0 = <&uart2_pins>;
584 status = "okay";
585 };
586
587 &watchdog {
588 pinctrl-names = "default";
589 pinctrl-0 = <&watchdog_pins>;
590 status = "okay";
591 };
592
593 &wmac {
594 mediatek,mtd-eeprom = <&factory 0x0000>;
595 status = "okay";
596 };