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