6f45ff6863b2c84d7fbf8b2bb44dca0dcecdb290
[openwrt/openwrt.git] / target / linux / mediatek / files / arch / arm / boot / dts / mt7623-eMMC.dts
1 /*
2 * Copyright (c) 2016 MediaTek Inc.
3 * Author: John Crispin <blogic@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15 /dts-v1/;
16
17 #include "_mt7623.dtsi"
18 #include <dt-bindings/gpio/gpio.h>
19
20 / {
21 model = "MediaTek MT7623 eMMC reference board";
22 compatible = "mediatek,mt7623-rfb-emmc", "mediatek,mt7623";
23
24 chosen {
25 stdout-path = &uart2;
26 bootargs = "earlyprintk block2mtd.block2mtd=/dev/mmcblk0,65536,eMMC,5 mtdparts=eMMC:256k(mbr)ro,512k(uboot)ro,256k(config)ro,256k(factory)ro,32M(kernel),32M(recovery),1024M(rootfs),2048M(usrdata),-(bmtpool) rootfstype=squashfs,jffs2";
27 };
28
29 memory {
30 reg = <0 0x80000000 0 0x20000000>;
31 };
32
33 usb_p1_vbus: regulator@0 {
34 compatible = "regulator-fixed";
35 regulator-name = "usb_vbus";
36 regulator-min-microvolt = <5000000>;
37 regulator-max-microvolt = <5000000>;
38 gpio = <&pio 135 GPIO_ACTIVE_HIGH>;
39 enable-active-high;
40 };
41
42 switch {
43 compatible = "mediatek,mt7530";
44 #address-cells = <1>;
45 #size-cells = <0>;
46 reg = <0>;
47
48 dsa,mii-bus = <&mdio0>;
49
50 pinctrl-names = "default";
51 pinctrl-0 = <&eth_default>;
52
53 core-supply = <&mt6323_vpa_reg>;
54 io-supply = <&mt6323_vemc3v3_reg>;
55
56 mediatek,mcm;
57 resets = <&ethsys 2>;
58 reset-names = "mcm";
59
60 ports {
61 #address-cells = <1>;
62 #size-cells = <0>;
63 reg = <0>;
64 port@0 {
65 reg = <0>;
66 label = "lan0";
67 };
68
69 port@1 {
70 reg = <1>;
71 label = "lan1";
72 };
73
74 port@2 {
75 reg = <2>;
76 label = "lan2";
77 };
78
79 port@3 {
80 reg = <3>;
81 label = "lan3";
82 };
83
84 port@6 {
85 reg = <6>;
86 label = "cpu";
87 ethernet = <&gmac1>;
88 phy-mode = "trgmii";
89 fixed-link {
90 speed = <1000>;
91 full-duplex;
92 };
93 };
94 };
95 };
96 };
97
98 &cpu0 {
99 proc-supply = <&mt6323_vproc_reg>;
100 };
101
102 &cpu1 {
103 proc-supply = <&mt6323_vproc_reg>;
104 };
105
106 &cpu2 {
107 proc-supply = <&mt6323_vproc_reg>;
108 };
109
110 &cpu3 {
111 proc-supply = <&mt6323_vproc_reg>;
112 };
113
114 &pwrap {
115 pmic: mt6323 {
116 compatible = "mediatek,mt6323";
117 interrupt-parent = <&pio>;
118 interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
119 interrupt-controller;
120 #interrupt-cells = <2>;
121
122 mt6323regulator: mt6323regulator{
123 compatible = "mediatek,mt6323-regulator";
124
125 mt6323_vproc_reg: buck_vproc{
126 regulator-name = "vproc";
127 regulator-min-microvolt = < 700000>;
128 regulator-max-microvolt = <1350000>;
129 regulator-ramp-delay = <12500>;
130 regulator-always-on;
131 regulator-boot-on;
132 };
133
134 mt6323_vsys_reg: buck_vsys{
135 regulator-name = "vsys";
136 regulator-min-microvolt = <1400000>;
137 regulator-max-microvolt = <2987500>;
138 regulator-ramp-delay = <25000>;
139 regulator-always-on;
140 regulator-boot-on;
141 };
142
143 mt6323_vpa_reg: buck_vpa{
144 regulator-name = "vpa";
145 regulator-min-microvolt = < 500000>;
146 regulator-max-microvolt = <3650000>;
147 };
148
149 mt6323_vtcxo_reg: ldo_vtcxo{
150 regulator-name = "vtcxo";
151 regulator-min-microvolt = <2800000>;
152 regulator-max-microvolt = <2800000>;
153 regulator-enable-ramp-delay = <90>;
154 regulator-always-on;
155 regulator-boot-on;
156 };
157
158 mt6323_vcn28_reg: ldo_vcn28{
159 regulator-name = "vcn28";
160 regulator-min-microvolt = <2800000>;
161 regulator-max-microvolt = <2800000>;
162 regulator-enable-ramp-delay = <185>;
163 };
164
165 mt6323_vcn33_bt_reg: ldo_vcn33_bt{
166 regulator-name = "vcn33_bt";
167 regulator-min-microvolt = <3300000>;
168 regulator-max-microvolt = <3600000>;
169 regulator-enable-ramp-delay = <185>;
170 };
171
172 mt6323_vcn33_wifi_reg: ldo_vcn33_wifi{
173 regulator-name = "vcn33_wifi";
174 regulator-min-microvolt = <3300000>;
175 regulator-max-microvolt = <3600000>;
176 regulator-enable-ramp-delay = <185>;
177 };
178
179 mt6323_va_reg: ldo_va{
180 regulator-name = "va";
181 regulator-min-microvolt = <2800000>;
182 regulator-max-microvolt = <2800000>;
183 regulator-enable-ramp-delay = <216>;
184 regulator-always-on;
185 regulator-boot-on;
186 };
187
188 mt6323_vcama_reg: ldo_vcama{
189 regulator-name = "vcama";
190 regulator-min-microvolt = <1500000>;
191 regulator-max-microvolt = <2800000>;
192 regulator-enable-ramp-delay = <216>;
193 };
194
195 mt6323_vio28_reg: ldo_vio28{
196 regulator-name = "vio28";
197 regulator-min-microvolt = <2800000>;
198 regulator-max-microvolt = <2800000>;
199 regulator-enable-ramp-delay = <216>;
200 regulator-always-on;
201 regulator-boot-on;
202 };
203
204 mt6323_vusb_reg: ldo_vusb{
205 regulator-name = "vusb";
206 regulator-min-microvolt = <3300000>;
207 regulator-max-microvolt = <3300000>;
208 regulator-enable-ramp-delay = <216>;
209 regulator-boot-on;
210 };
211
212 mt6323_vmc_reg: ldo_vmc{
213 regulator-name = "vmc";
214 regulator-min-microvolt = <1800000>;
215 regulator-max-microvolt = <3300000>;
216 regulator-enable-ramp-delay = <36>;
217 regulator-boot-on;
218 };
219
220 mt6323_vmch_reg: ldo_vmch{
221 regulator-name = "vmch";
222 regulator-min-microvolt = <3000000>;
223 regulator-max-microvolt = <3300000>;
224 regulator-enable-ramp-delay = <36>;
225 regulator-boot-on;
226 };
227
228 mt6323_vemc3v3_reg: ldo_vemc3v3{
229 regulator-name = "vemc3v3";
230 regulator-min-microvolt = <3000000>;
231 regulator-max-microvolt = <3300000>;
232 regulator-enable-ramp-delay = <36>;
233 regulator-boot-on;
234 };
235
236 mt6323_vgp1_reg: ldo_vgp1{
237 regulator-name = "vgp1";
238 regulator-min-microvolt = <1200000>;
239 regulator-max-microvolt = <3300000>;
240 regulator-enable-ramp-delay = <216>;
241 };
242
243 mt6323_vgp2_reg: ldo_vgp2{
244 regulator-name = "vgp2";
245 regulator-min-microvolt = <1200000>;
246 regulator-max-microvolt = <3000000>;
247 regulator-enable-ramp-delay = <216>;
248 };
249
250 mt6323_vgp3_reg: ldo_vgp3{
251 regulator-name = "vgp3";
252 regulator-min-microvolt = <1200000>;
253 regulator-max-microvolt = <1800000>;
254 regulator-enable-ramp-delay = <216>;
255 };
256
257 mt6323_vcn18_reg: ldo_vcn18{
258 regulator-name = "vcn18";
259 regulator-min-microvolt = <1800000>;
260 regulator-max-microvolt = <1800000>;
261 regulator-enable-ramp-delay = <216>;
262 };
263
264 mt6323_vsim1_reg: ldo_vsim1{
265 regulator-name = "vsim1";
266 regulator-min-microvolt = <1800000>;
267 regulator-max-microvolt = <3000000>;
268 regulator-enable-ramp-delay = <216>;
269 };
270
271 mt6323_vsim2_reg: ldo_vsim2{
272 regulator-name = "vsim2";
273 regulator-min-microvolt = <1800000>;
274 regulator-max-microvolt = <3000000>;
275 regulator-enable-ramp-delay = <216>;
276 };
277
278 mt6323_vrtc_reg: ldo_vrtc{
279 regulator-name = "vrtc";
280 regulator-min-microvolt = <2800000>;
281 regulator-max-microvolt = <2800000>;
282 regulator-always-on;
283 regulator-boot-on;
284 };
285
286 mt6323_vcamaf_reg: ldo_vcamaf{
287 regulator-name = "vcamaf";
288 regulator-min-microvolt = <1200000>;
289 regulator-max-microvolt = <3300000>;
290 regulator-enable-ramp-delay = <216>;
291 };
292
293 mt6323_vibr_reg: ldo_vibr{
294 regulator-name = "vibr";
295 regulator-min-microvolt = <1200000>;
296 regulator-max-microvolt = <3300000>;
297 regulator-enable-ramp-delay = <36>;
298 };
299
300 mt6323_vrf18_reg: ldo_vrf18{
301 regulator-name = "vrf18";
302 regulator-min-microvolt = <1825000>;
303 regulator-max-microvolt = <1825000>;
304 regulator-enable-ramp-delay = <187>;
305 };
306
307 mt6323_vm_reg: ldo_vm{
308 regulator-name = "vm";
309 regulator-min-microvolt = <1200000>;
310 regulator-max-microvolt = <1800000>;
311 regulator-enable-ramp-delay = <216>;
312 regulator-always-on;
313 regulator-boot-on;
314 };
315
316 mt6323_vio18_reg: ldo_vio18{
317 regulator-name = "vio18";
318 regulator-min-microvolt = <1800000>;
319 regulator-max-microvolt = <1800000>;
320 regulator-enable-ramp-delay = <216>;
321 regulator-always-on;
322 regulator-boot-on;
323 };
324
325 mt6323_vcamd_reg: ldo_vcamd{
326 regulator-name = "vcamd";
327 regulator-min-microvolt = <1200000>;
328 regulator-max-microvolt = <1800000>;
329 regulator-enable-ramp-delay = <216>;
330 };
331
332 mt6323_vcamio_reg: ldo_vcamio{
333 regulator-name = "vcamio";
334 regulator-min-microvolt = <1800000>;
335 regulator-max-microvolt = <1800000>;
336 regulator-enable-ramp-delay = <216>;
337 };
338 };
339 };
340 };
341
342 &uart2 {
343 status = "okay";
344 };
345
346 &mmc0 {
347 status = "okay";
348 pinctrl-names = "default", "state_uhs";
349 pinctrl-0 = <&mmc0_pins_default>;
350 pinctrl-1 = <&mmc0_pins_uhs>;
351 bus-width = <8>;
352 max-frequency = <50000000>;
353 cap-mmc-highspeed;
354 vmmc-supply = <&mt6323_vemc3v3_reg>;
355 vqmmc-supply = <&mt6323_vio18_reg>;
356 non-removable;
357 };
358
359 &mmc1 {
360 status = "okay";
361 pinctrl-names = "default", "state_uhs";
362 pinctrl-0 = <&mmc1_pins_default>;
363 pinctrl-1 = <&mmc1_pins_uhs>;
364 bus-width = <4>;
365 max-frequency = <50000000>;
366 cap-sd-highspeed;
367 sd-uhs-sdr25;
368 // cd-gpios = <&pio 132 0>;
369 vmmc-supply = <&mt6323_vmch_reg>;
370 vqmmc-supply = <&mt6323_vmc_reg>;
371 };
372
373 &pio {
374 mmc0_pins_default: mmc0default {
375 pins_cmd_dat {
376 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
377 <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
378 <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
379 <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
380 <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
381 <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
382 <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
383 <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
384 <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
385 input-enable;
386 bias-pull-up;
387 };
388
389 pins_clk {
390 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
391 bias-pull-down;
392 };
393
394 pins_rst {
395 pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
396 bias-pull-up;
397 };
398 };
399
400 mmc0_pins_uhs: mmc0 {
401 pins_cmd_dat {
402 pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
403 <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
404 <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
405 <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
406 <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
407 <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
408 <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
409 <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
410 <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
411 input-enable;
412 drive-strength = <MTK_DRIVE_2mA>;
413 bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
414 };
415
416 pins_clk {
417 pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
418 drive-strength = <MTK_DRIVE_2mA>;
419 bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
420 };
421
422 pins_rst {
423 pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
424 bias-pull-up;
425 };
426 };
427
428 mmc1_pins_default: mmc1default {
429 pins_cmd_dat {
430 pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
431 <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
432 <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
433 <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
434 <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
435 input-enable;
436 drive-strength = <MTK_DRIVE_4mA>;
437 bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
438 };
439
440 pins_clk {
441 pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
442 bias-pull-down;
443 drive-strength = <MTK_DRIVE_4mA>;
444 };
445
446 // pins_insert {
447 // pinmux = <MT8173_PIN_132_I2S0_DATA1_FUNC_GPIO132>;
448 // bias-pull-up;
449 // };
450 };
451
452 mmc1_pins_uhs: mmc1 {
453 pins_cmd_dat {
454 pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
455 <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
456 <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
457 <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
458 <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
459 input-enable;
460 drive-strength = <MTK_DRIVE_4mA>;
461 bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
462 };
463
464 pins_clk {
465 pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
466 drive-strength = <MTK_DRIVE_4mA>;
467 bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
468 };
469 };
470
471 eth_default: eth {
472 pins_eth {
473 pinmux = <MT7623_PIN_275_G2_MDC_FUNC_MDC>,
474 <MT7623_PIN_276_G2_MDIO_FUNC_MDIO>,
475 <MT7623_PIN_262_G2_TXEN_FUNC_G2_TXEN>,
476 <MT7623_PIN_263_G2_TXD3_FUNC_G2_TXD3>,
477 <MT7623_PIN_264_G2_TXD2_FUNC_G2_TXD2>,
478 <MT7623_PIN_265_G2_TXD1_FUNC_G2_TXD1>,
479 <MT7623_PIN_266_G2_TXD0_FUNC_G2_TXD0>,
480 <MT7623_PIN_267_G2_TXCLK_FUNC_G2_TXC>,
481 <MT7623_PIN_268_G2_RXCLK_FUNC_G2_RXC>,
482 <MT7623_PIN_269_G2_RXD0_FUNC_G2_RXD0>,
483 <MT7623_PIN_270_G2_RXD1_FUNC_G2_RXD1>,
484 <MT7623_PIN_271_G2_RXD2_FUNC_G2_RXD2>,
485 <MT7623_PIN_272_G2_RXD3_FUNC_G2_RXD3>,
486 <MT7623_PIN_274_G2_RXDV_FUNC_G2_RXDV>;
487 };
488
489 pins_eth_rst {
490 pinmux = <MT7623_PIN_15_GPIO15_FUNC_GPIO15>;
491 output-low;
492 };
493 };
494
495 pwm_pins: pwm {
496 pins_pwm1 {
497 pinmux = <MT7623_PIN_204_PWM1_FUNC_PWM1>;
498 };
499
500 pins_pwm2 {
501 pinmux = <MT7623_PIN_205_PWM2_FUNC_PWM2>;
502 };
503 };
504 };
505
506 &usb1 {
507 vusb33-supply = <&mt6323_vusb_reg>;
508 vbus-supply = <&usb_p1_vbus>;
509 status = "okay";
510 };
511
512 &u3phy1 {
513 status = "okay";
514 };
515
516 &pcie {
517 status = "okay";
518 };
519
520 &eth {
521 status = "okay";
522 };
523
524 &gmac1 {
525 mac-address = [00 11 22 33 44 56];
526 status = "okay";
527 };
528
529 &gmac2 {
530 mac-address = [00 11 22 33 44 55];
531 status = "okay";
532
533 phy-handle = <&phy5>;
534 };
535
536 &mdio0 {
537 phy5: ethernet-phy@5 {
538 reg = <5>;
539 phy-mode = "rgmii-rxid";
540 };
541 };
542
543 &pwm {
544 pinctrl-names = "default";
545 pinctrl-0 = <&pwm_pins>;
546 status = "okay";
547 };