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