ramips: mt7621-dts: add missing device_type in pcie root ports
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621.dtsi
1 /dts-v1/;
2
3 #include <dt-bindings/interrupt-controller/mips-gic.h>
4 #include <dt-bindings/clock/mt7621-clk.h>
5 #include <dt-bindings/gpio/gpio.h>
6
7 / {
8 #address-cells = <1>;
9 #size-cells = <1>;
10 compatible = "mediatek,mt7621-soc";
11
12 aliases {
13 serial0 = &uartlite;
14 };
15
16 cpus {
17 #address-cells = <1>;
18 #size-cells = <0>;
19
20 cpu@0 {
21 device_type = "cpu";
22 compatible = "mips,mips1004Kc";
23 reg = <0>;
24 };
25
26 cpu@1 {
27 device_type = "cpu";
28 compatible = "mips,mips1004Kc";
29 reg = <1>;
30 };
31 };
32
33 cpuintc: cpuintc {
34 #address-cells = <0>;
35 #interrupt-cells = <1>;
36 interrupt-controller;
37 compatible = "mti,cpu-interrupt-controller";
38 };
39
40 chosen {
41 bootargs = "console=ttyS0,57600";
42 };
43
44 pll: pll {
45 compatible = "mediatek,mt7621-pll", "syscon";
46
47 #clock-cells = <1>;
48 clock-output-names = "cpu", "bus";
49 };
50
51 sysclock: sysclock {
52 #clock-cells = <0>;
53 compatible = "fixed-clock";
54
55 /* FIXME: there should be way to detect this */
56 clock-frequency = <50000000>;
57 };
58
59 palmbus: palmbus@1e000000 {
60 compatible = "palmbus";
61 reg = <0x1e000000 0x100000>;
62 ranges = <0x0 0x1e000000 0x0fffff>;
63
64 #address-cells = <1>;
65 #size-cells = <1>;
66
67 sysc: syscon@0 {
68 compatible = "mtk,mt7621-sysc", "syscon";
69 reg = <0x0 0x100>;
70 };
71
72 wdt: wdt@100 {
73 compatible = "mediatek,mt7621-wdt";
74 reg = <0x100 0x100>;
75 };
76
77 gpio: gpio@600 {
78 #gpio-cells = <2>;
79 #interrupt-cells = <2>;
80 compatible = "mediatek,mt7621-gpio";
81 gpio-controller;
82 interrupt-controller;
83 reg = <0x600 0x100>;
84 interrupt-parent = <&gic>;
85 interrupts = <GIC_SHARED 12 IRQ_TYPE_LEVEL_HIGH>;
86 };
87
88 i2c: i2c@900 {
89 compatible = "mediatek,mt7621-i2c";
90 reg = <0x900 0x100>;
91
92 clocks = <&sysclock>;
93
94 resets = <&rstctrl 16>;
95 reset-names = "i2c";
96
97 #address-cells = <1>;
98 #size-cells = <0>;
99
100 status = "disabled";
101
102 pinctrl-names = "default";
103 pinctrl-0 = <&i2c_pins>;
104 };
105
106 i2s: i2s@a00 {
107 compatible = "mediatek,mt7621-i2s";
108 reg = <0xa00 0x100>;
109
110 clocks = <&sysclock>;
111
112 resets = <&rstctrl 17>;
113 reset-names = "i2s";
114
115 interrupt-parent = <&gic>;
116 interrupts = <GIC_SHARED 16 IRQ_TYPE_LEVEL_HIGH>;
117
118 txdma-req = <2>;
119 rxdma-req = <3>;
120
121 dmas = <&gdma 4>,
122 <&gdma 6>;
123 dma-names = "tx", "rx";
124
125 status = "disabled";
126 };
127
128 systick: systick@500 {
129 compatible = "ralink,mt7621-systick", "ralink,cevt-systick";
130 reg = <0x500 0x10>;
131
132 resets = <&rstctrl 28>;
133 reset-names = "intc";
134
135 interrupt-parent = <&gic>;
136 interrupts = <GIC_SHARED 5 IRQ_TYPE_LEVEL_HIGH>;
137 };
138
139 memc: syscon@5000 {
140 compatible = "mtk,mt7621-memc", "syscon";
141 reg = <0x5000 0x1000>;
142 };
143
144 uartlite: uartlite@c00 {
145 compatible = "ns16550a";
146 reg = <0xc00 0x100>;
147
148 clock-frequency = <50000000>;
149
150 interrupt-parent = <&gic>;
151 interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
152
153 reg-shift = <2>;
154 reg-io-width = <4>;
155 no-loopback-test;
156 };
157
158 uartlite2: uartlite2@d00 {
159 compatible = "ns16550a";
160 reg = <0xd00 0x100>;
161
162 clock-frequency = <50000000>;
163
164 interrupt-parent = <&gic>;
165 interrupts = <GIC_SHARED 27 IRQ_TYPE_LEVEL_HIGH>;
166
167 reg-shift = <2>;
168 reg-io-width = <4>;
169
170 pinctrl-names = "default";
171 pinctrl-0 = <&uart2_pins>;
172
173 status = "disabled";
174 };
175
176 uartlite3: uartlite3@e00 {
177 compatible = "ns16550a";
178 reg = <0xe00 0x100>;
179
180 clock-frequency = <50000000>;
181
182 interrupt-parent = <&gic>;
183 interrupts = <GIC_SHARED 28 IRQ_TYPE_LEVEL_HIGH>;
184
185 reg-shift = <2>;
186 reg-io-width = <4>;
187
188 pinctrl-names = "default";
189 pinctrl-0 = <&uart3_pins>;
190
191 status = "disabled";
192 };
193
194 spi0: spi@b00 {
195 status = "disabled";
196
197 compatible = "ralink,mt7621-spi";
198 reg = <0xb00 0x100>;
199
200 clocks = <&pll MT7621_CLK_BUS>;
201
202 resets = <&rstctrl 18>;
203 reset-names = "spi";
204
205 #address-cells = <1>;
206 #size-cells = <0>;
207
208 pinctrl-names = "default";
209 pinctrl-0 = <&spi_pins>;
210 };
211
212 gdma: gdma@2800 {
213 compatible = "ralink,rt3883-gdma";
214 reg = <0x2800 0x800>;
215
216 resets = <&rstctrl 14>;
217 reset-names = "dma";
218
219 interrupt-parent = <&gic>;
220 interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>;
221
222 #dma-cells = <1>;
223 #dma-channels = <16>;
224 #dma-requests = <16>;
225
226 status = "disabled";
227 };
228
229 hsdma: hsdma@7000 {
230 compatible = "mediatek,mt7621-hsdma";
231 reg = <0x7000 0x1000>;
232
233 resets = <&rstctrl 5>;
234 reset-names = "hsdma";
235
236 interrupt-parent = <&gic>;
237 interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
238
239 #dma-cells = <1>;
240 #dma-channels = <1>;
241 #dma-requests = <1>;
242
243 status = "disabled";
244 };
245 };
246
247 pinctrl: pinctrl {
248 compatible = "ralink,rt2880-pinmux";
249 pinctrl-names = "default";
250 pinctrl-0 = <&state_default>;
251
252 state_default: pinctrl0 {
253 };
254
255 i2c_pins: i2c_pins {
256 i2c_pins {
257 groups = "i2c";
258 function = "i2c";
259 };
260 };
261
262 spi_pins: spi_pins {
263 spi_pins {
264 groups = "spi";
265 function = "spi";
266 };
267 };
268
269 uart1_pins: uart1 {
270 uart1 {
271 groups = "uart1";
272 function = "uart1";
273 };
274 };
275
276 uart2_pins: uart2 {
277 uart2 {
278 groups = "uart2";
279 function = "uart2";
280 };
281 };
282
283 uart3_pins: uart3 {
284 uart3 {
285 groups = "uart3";
286 function = "uart3";
287 };
288 };
289
290 rgmii1_pins: rgmii1 {
291 rgmii1 {
292 groups = "rgmii1";
293 function = "rgmii1";
294 };
295 };
296
297 rgmii2_pins: rgmii2 {
298 rgmii2 {
299 groups = "rgmii2";
300 function = "rgmii2";
301 };
302 };
303
304 mdio_pins: mdio {
305 mdio {
306 groups = "mdio";
307 function = "mdio";
308 };
309 };
310
311 pcie_pins: pcie {
312 pcie {
313 groups = "pcie";
314 function = "gpio";
315 };
316 };
317
318 nand_pins: nand {
319 spi-nand {
320 groups = "spi";
321 function = "nand1";
322 };
323
324 sdhci-nand {
325 groups = "sdhci";
326 function = "nand2";
327 };
328 };
329
330 sdhci_pins: sdhci {
331 sdhci {
332 groups = "sdhci";
333 function = "sdhci";
334 };
335 };
336 };
337
338 rstctrl: rstctrl {
339 compatible = "ralink,rt2880-reset";
340 #reset-cells = <1>;
341 };
342
343 clkctrl: clkctrl {
344 compatible = "ralink,rt2880-clock";
345 #clock-cells = <1>;
346 };
347
348 sdhci: sdhci@1e130000 {
349 status = "disabled";
350
351 compatible = "ralink,mt7620-sdhci";
352 reg = <0x1e130000 0x4000>;
353
354 interrupt-parent = <&gic>;
355 interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
356
357 pinctrl-names = "default";
358 pinctrl-0 = <&sdhci_pins>;
359 };
360
361 xhci: xhci@1e1c0000 {
362 #address-cells = <1>;
363 #size-cells = <0>;
364
365 compatible = "mediatek,mt8173-xhci";
366 reg = <0x1e1c0000 0x1000
367 0x1e1d0700 0x0100>;
368 reg-names = "mac", "ippc";
369
370 clocks = <&sysclock>;
371 clock-names = "sys_ck";
372
373 interrupt-parent = <&gic>;
374 interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
375
376 /*
377 * Port 1 of both hubs is one usb slot and referenced here.
378 * The binding doesn't allow to address individual hubs.
379 * hub 1 - port 1 is ehci and ohci, hub 2 - port 1 is xhci.
380 */
381 xhci_ehci_port1: port@1 {
382 reg = <1>;
383 #trigger-source-cells = <0>;
384 };
385
386 /*
387 * Only the second usb hub has a second port. That port serves
388 * ehci and ohci.
389 */
390 ehci_port2: port@2 {
391 reg = <2>;
392 #trigger-source-cells = <0>;
393 };
394 };
395
396 gic: interrupt-controller@1fbc0000 {
397 compatible = "mti,gic";
398 reg = <0x1fbc0000 0x2000>;
399
400 interrupt-controller;
401 #interrupt-cells = <3>;
402
403 mti,reserved-cpu-vectors = <7>;
404
405 timer {
406 compatible = "mti,gic-timer";
407 interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
408 clocks = <&pll MT7621_CLK_CPU>;
409 };
410 };
411
412 nficlock: nficlock {
413 #clock-cells = <0>;
414 compatible = "fixed-clock";
415
416 clock-frequency = <125000000>;
417 };
418
419 cpc: cpc@1fbf0000 {
420 compatible = "mti,mips-cpc";
421 reg = <0x1fbf0000 0x8000>;
422 };
423
424 mc: mc@1fbf8000 {
425 compatible = "mti,mips-cdmm";
426 reg = <0x1fbf8000 0x8000>;
427 };
428
429 nand: nand@1e003000 {
430 status = "disabled";
431
432 compatible = "mediatek,mt7621-nfc";
433 reg = <0x1e003000 0x800
434 0x1e003800 0x800>;
435 reg-names = "nfi", "ecc";
436
437 clocks = <&nficlock>;
438 clock-names = "nfi_clk";
439 };
440
441 ethernet: ethernet@1e100000 {
442 compatible = "mediatek,mt7621-eth";
443 reg = <0x1e100000 0x10000>;
444
445 clocks = <&sysclock>;
446 clock-names = "ethif";
447
448 #address-cells = <1>;
449 #size-cells = <0>;
450
451 resets = <&rstctrl 6 &rstctrl 23>;
452 reset-names = "fe", "eth";
453
454 interrupt-parent = <&gic>;
455 interrupts = <GIC_SHARED 3 IRQ_TYPE_LEVEL_HIGH>;
456
457 mediatek,ethsys = <&sysc>;
458
459 gmac0: mac@0 {
460 compatible = "mediatek,eth-mac";
461 reg = <0>;
462 phy-mode = "rgmii";
463
464 fixed-link {
465 speed = <1000>;
466 full-duplex;
467 pause;
468 };
469 };
470
471 gmac1: mac@1 {
472 compatible = "mediatek,eth-mac";
473 reg = <1>;
474 status = "disabled";
475 phy-mode = "rgmii-rxid";
476 };
477
478 mdio: mdio-bus {
479 #address-cells = <1>;
480 #size-cells = <0>;
481
482 switch0: switch@1f {
483 compatible = "mediatek,mt7621";
484 #address-cells = <1>;
485 #size-cells = <0>;
486 reg = <0x1f>;
487 mediatek,mcm;
488 resets = <&rstctrl 2>;
489 reset-names = "mcm";
490
491 ports {
492 #address-cells = <1>;
493 #size-cells = <0>;
494 reg = <0>;
495
496 port@0 {
497 status = "disabled";
498 reg = <0>;
499 label = "lan0";
500 };
501
502 port@1 {
503 status = "disabled";
504 reg = <1>;
505 label = "lan1";
506 };
507
508 port@2 {
509 status = "disabled";
510 reg = <2>;
511 label = "lan2";
512 };
513
514 port@3 {
515 status = "disabled";
516 reg = <3>;
517 label = "lan3";
518 };
519
520 port@4 {
521 status = "disabled";
522 reg = <4>;
523 label = "lan4";
524 };
525
526 port@6 {
527 reg = <6>;
528 label = "cpu";
529 ethernet = <&gmac0>;
530 phy-mode = "rgmii";
531
532 fixed-link {
533 speed = <1000>;
534 full-duplex;
535 };
536 };
537 };
538 };
539 };
540 };
541
542 pcie: pcie@1e140000 {
543 compatible = "mediatek,mt7621-pci";
544 reg = <0x1e140000 0x100 /* host-pci bridge registers */
545 0x1e142000 0x100 /* pcie port 0 RC control registers */
546 0x1e143000 0x100 /* pcie port 1 RC control registers */
547 0x1e144000 0x100>; /* pcie port 2 RC control registers */
548 #address-cells = <3>;
549 #size-cells = <2>;
550
551 pinctrl-names = "default";
552 pinctrl-0 = <&pcie_pins>;
553
554 device_type = "pci";
555
556 ranges = <
557 0x02000000 0 0x00000000 0x60000000 0 0x10000000 /* pci memory */
558 0x01000000 0 0x00000000 0x1e160000 0 0x00010000 /* io space */
559 >;
560
561 interrupt-parent = <&gic>;
562 interrupts = <GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH
563 GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH
564 GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
565
566 status = "disabled";
567
568 resets = <&rstctrl 24 &rstctrl 25 &rstctrl 26>;
569 reset-names = "pcie0", "pcie1", "pcie2";
570 clocks = <&clkctrl 24 &clkctrl 25 &clkctrl 26>;
571 clock-names = "pcie0", "pcie1", "pcie2";
572 phys = <&pcie0_phy 1>, <&pcie2_phy 0>;
573 phy-names = "pcie-phy0", "pcie-phy2";
574
575 reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
576
577 pcie0: pcie@0,0 {
578 reg = <0x0000 0 0 0 0>;
579 #address-cells = <3>;
580 #size-cells = <2>;
581 device_type = "pci";
582 ranges;
583 };
584
585 pcie1: pcie@1,0 {
586 reg = <0x0800 0 0 0 0>;
587 #address-cells = <3>;
588 #size-cells = <2>;
589 device_type = "pci";
590 ranges;
591 };
592
593 pcie2: pcie@2,0 {
594 reg = <0x1000 0 0 0 0>;
595 #address-cells = <3>;
596 #size-cells = <2>;
597 device_type = "pci";
598 ranges;
599 };
600 };
601
602 pcie0_phy: pcie-phy@1e149000 {
603 compatible = "mediatek,mt7621-pci-phy";
604 reg = <0x1e149000 0x0700>;
605 #phy-cells = <1>;
606 };
607
608 pcie2_phy: pcie-phy@1e14a000 {
609 compatible = "mediatek,mt7621-pci-phy";
610 reg = <0x1e14a000 0x0700>;
611 #phy-cells = <1>;
612 };
613 };