blob: faea94e45eeb4761ba06d15b9eb5901ca359b147 [file] [log] [blame]
Hans de Goede8b1ba942015-06-02 15:53:40 +02001/*
2 * Copyright 2014 Chen-Yu Tsai
3 *
4 * Chen-Yu Tsai <wens@csie.org>
5 *
6 * This file is dual-licensed: you can use it either under the terms
7 * of the GPL or the X11 license, at your option. Note that this dual
8 * licensing only applies to this file, and not this project as a
9 * whole.
10 *
11 * a) This file is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This file is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * Or, alternatively,
22 *
23 * b) Permission is hereby granted, free of charge, to any person
24 * obtaining a copy of this software and associated documentation
25 * files (the "Software"), to deal in the Software without
26 * restriction, including without limitation the rights to use,
27 * copy, modify, merge, publish, distribute, sublicense, and/or
28 * sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following
30 * conditions:
31 *
32 * The above copyright notice and this permission notice shall be
33 * included in all copies or substantial portions of the Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 * OTHER DEALINGS IN THE SOFTWARE.
43 */
44
45#include "skeleton.dtsi"
46
47#include <dt-bindings/interrupt-controller/arm-gic.h>
48
49#include <dt-bindings/pinctrl/sun4i-a10.h>
50
51/ {
52 interrupt-parent = <&gic>;
53
54 chosen {
55 #address-cells = <1>;
56 #size-cells = <1>;
57 ranges;
58
59 framebuffer@0 {
60 compatible = "allwinner,simple-framebuffer",
61 "simple-framebuffer";
62 allwinner,pipeline = "de_be0-lcd0";
63 clocks = <&pll6 0>;
64 status = "disabled";
65 };
66 };
67
68 timer {
69 compatible = "arm,armv7-timer";
70 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
71 <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
72 <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
73 <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
74 clock-frequency = <24000000>;
75 arm,cpu-registers-not-fw-configured;
76 };
77
78 cpus {
79 enable-method = "allwinner,sun8i-a23";
80 #address-cells = <1>;
81 #size-cells = <0>;
82
83 cpu@0 {
84 compatible = "arm,cortex-a7";
85 device_type = "cpu";
86 reg = <0>;
87 };
88
89 cpu@1 {
90 compatible = "arm,cortex-a7";
91 device_type = "cpu";
92 reg = <1>;
93 };
94 };
95
96 clocks {
97 #address-cells = <1>;
98 #size-cells = <1>;
99 ranges;
100
101 osc24M: osc24M_clk {
102 #clock-cells = <0>;
103 compatible = "fixed-clock";
104 clock-frequency = <24000000>;
105 clock-output-names = "osc24M";
106 };
107
108 osc32k: osc32k_clk {
109 #clock-cells = <0>;
110 compatible = "fixed-clock";
111 clock-frequency = <32768>;
112 clock-output-names = "osc32k";
113 };
114
115 pll1: clk@01c20000 {
116 #clock-cells = <0>;
117 compatible = "allwinner,sun8i-a23-pll1-clk";
118 reg = <0x01c20000 0x4>;
119 clocks = <&osc24M>;
120 clock-output-names = "pll1";
121 };
122
123 /* dummy clock until actually implemented */
124 pll5: pll5_clk {
125 #clock-cells = <0>;
126 compatible = "fixed-clock";
127 clock-frequency = <0>;
128 clock-output-names = "pll5";
129 };
130
131 pll6: clk@01c20028 {
132 #clock-cells = <1>;
133 compatible = "allwinner,sun6i-a31-pll6-clk";
134 reg = <0x01c20028 0x4>;
135 clocks = <&osc24M>;
136 clock-output-names = "pll6", "pll6x2";
137 };
138
139 cpu: cpu_clk@01c20050 {
140 #clock-cells = <0>;
141 compatible = "allwinner,sun4i-a10-cpu-clk";
142 reg = <0x01c20050 0x4>;
143
144 /*
145 * PLL1 is listed twice here.
146 * While it looks suspicious, it's actually documented
147 * that way both in the datasheet and in the code from
148 * Allwinner.
149 */
150 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
151 clock-output-names = "cpu";
152 };
153
154 axi: axi_clk@01c20050 {
155 #clock-cells = <0>;
156 compatible = "allwinner,sun8i-a23-axi-clk";
157 reg = <0x01c20050 0x4>;
158 clocks = <&cpu>;
159 clock-output-names = "axi";
160 };
161
162 ahb1: ahb1_clk@01c20054 {
163 #clock-cells = <0>;
164 compatible = "allwinner,sun6i-a31-ahb1-clk";
165 reg = <0x01c20054 0x4>;
166 clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
167 clock-output-names = "ahb1";
168 };
169
170 apb1: apb1_clk@01c20054 {
171 #clock-cells = <0>;
172 compatible = "allwinner,sun4i-a10-apb0-clk";
173 reg = <0x01c20054 0x4>;
174 clocks = <&ahb1>;
175 clock-output-names = "apb1";
176 };
177
178 ahb1_gates: clk@01c20060 {
179 #clock-cells = <1>;
180 compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
181 reg = <0x01c20060 0x8>;
182 clocks = <&ahb1>;
183 clock-output-names = "ahb1_mipidsi", "ahb1_dma",
184 "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
185 "ahb1_nand", "ahb1_sdram",
186 "ahb1_hstimer", "ahb1_spi0",
187 "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
188 "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
189 "ahb1_csi", "ahb1_be", "ahb1_fe",
190 "ahb1_gpu", "ahb1_spinlock",
191 "ahb1_drc";
192 };
193
194 apb1_gates: clk@01c20068 {
195 #clock-cells = <1>;
196 compatible = "allwinner,sun8i-a23-apb1-gates-clk";
197 reg = <0x01c20068 0x4>;
198 clocks = <&apb1>;
199 clock-output-names = "apb1_codec", "apb1_pio",
200 "apb1_daudio0", "apb1_daudio1";
201 };
202
203 apb2: clk@01c20058 {
204 #clock-cells = <0>;
205 compatible = "allwinner,sun4i-a10-apb1-clk";
206 reg = <0x01c20058 0x4>;
207 clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
208 clock-output-names = "apb2";
209 };
210
211 apb2_gates: clk@01c2006c {
212 #clock-cells = <1>;
213 compatible = "allwinner,sun8i-a23-apb2-gates-clk";
214 reg = <0x01c2006c 0x4>;
215 clocks = <&apb2>;
216 clock-output-names = "apb2_i2c0", "apb2_i2c1",
217 "apb2_i2c2", "apb2_uart0",
218 "apb2_uart1", "apb2_uart2",
219 "apb2_uart3", "apb2_uart4";
220 };
221
222 mmc0_clk: clk@01c20088 {
223 #clock-cells = <1>;
224 compatible = "allwinner,sun4i-a10-mmc-clk";
225 reg = <0x01c20088 0x4>;
226 clocks = <&osc24M>, <&pll6 0>;
227 clock-output-names = "mmc0",
228 "mmc0_output",
229 "mmc0_sample";
230 };
231
232 mmc1_clk: clk@01c2008c {
233 #clock-cells = <1>;
234 compatible = "allwinner,sun4i-a10-mmc-clk";
235 reg = <0x01c2008c 0x4>;
236 clocks = <&osc24M>, <&pll6 0>;
237 clock-output-names = "mmc1",
238 "mmc1_output",
239 "mmc1_sample";
240 };
241
242 mmc2_clk: clk@01c20090 {
243 #clock-cells = <1>;
244 compatible = "allwinner,sun4i-a10-mmc-clk";
245 reg = <0x01c20090 0x4>;
246 clocks = <&osc24M>, <&pll6 0>;
247 clock-output-names = "mmc2",
248 "mmc2_output",
249 "mmc2_sample";
250 };
251
252 usb_clk: clk@01c200cc {
253 #clock-cells = <1>;
254 #reset-cells = <1>;
255 compatible = "allwinner,sun8i-a23-usb-clk";
256 reg = <0x01c200cc 0x4>;
257 clocks = <&osc24M>;
258 clock-output-names = "usb_phy0", "usb_phy1", "usb_hsic",
259 "usb_hsic_12M", "usb_ohci0";
260 };
261 };
262
263 soc@01c00000 {
264 compatible = "simple-bus";
265 #address-cells = <1>;
266 #size-cells = <1>;
267 ranges;
268
269 dma: dma-controller@01c02000 {
270 compatible = "allwinner,sun8i-a23-dma";
271 reg = <0x01c02000 0x1000>;
272 interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
273 clocks = <&ahb1_gates 6>;
274 resets = <&ahb1_rst 6>;
275 #dma-cells = <1>;
276 };
277
278 mmc0: mmc@01c0f000 {
279 compatible = "allwinner,sun5i-a13-mmc";
280 reg = <0x01c0f000 0x1000>;
281 clocks = <&ahb1_gates 8>,
282 <&mmc0_clk 0>,
283 <&mmc0_clk 1>,
284 <&mmc0_clk 2>;
285 clock-names = "ahb",
286 "mmc",
287 "output",
288 "sample";
289 resets = <&ahb1_rst 8>;
290 reset-names = "ahb";
291 interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
292 status = "disabled";
293 #address-cells = <1>;
294 #size-cells = <0>;
295 };
296
297 mmc1: mmc@01c10000 {
298 compatible = "allwinner,sun5i-a13-mmc";
299 reg = <0x01c10000 0x1000>;
300 clocks = <&ahb1_gates 9>,
301 <&mmc1_clk 0>,
302 <&mmc1_clk 1>,
303 <&mmc1_clk 2>;
304 clock-names = "ahb",
305 "mmc",
306 "output",
307 "sample";
308 resets = <&ahb1_rst 9>;
309 reset-names = "ahb";
310 interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
311 status = "disabled";
312 #address-cells = <1>;
313 #size-cells = <0>;
314 };
315
316 mmc2: mmc@01c11000 {
317 compatible = "allwinner,sun5i-a13-mmc";
318 reg = <0x01c11000 0x1000>;
319 clocks = <&ahb1_gates 10>,
320 <&mmc2_clk 0>,
321 <&mmc2_clk 1>,
322 <&mmc2_clk 2>;
323 clock-names = "ahb",
324 "mmc",
325 "output",
326 "sample";
327 resets = <&ahb1_rst 10>;
328 reset-names = "ahb";
329 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
330 status = "disabled";
331 #address-cells = <1>;
332 #size-cells = <0>;
333 };
334
335 pio: pinctrl@01c20800 {
336 /* compatible gets set in SoC specific dtsi file */
337 reg = <0x01c20800 0x400>;
338 /* interrupts get set in SoC specific dtsi file */
339 clocks = <&apb1_gates 5>;
340 gpio-controller;
341 interrupt-controller;
342 #address-cells = <1>;
343 #size-cells = <0>;
344 #gpio-cells = <3>;
345
346 uart0_pins_a: uart0@0 {
347 allwinner,pins = "PF2", "PF4";
348 allwinner,function = "uart0";
349 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
350 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
351 };
352
353 mmc0_pins_a: mmc0@0 {
354 allwinner,pins = "PF0", "PF1", "PF2",
355 "PF3", "PF4", "PF5";
356 allwinner,function = "mmc0";
357 allwinner,drive = <SUN4I_PINCTRL_30_MA>;
358 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
359 };
360
361 mmc1_pins_a: mmc1@0 {
362 allwinner,pins = "PG0", "PG1", "PG2",
363 "PG3", "PG4", "PG5";
364 allwinner,function = "mmc1";
365 allwinner,drive = <SUN4I_PINCTRL_30_MA>;
366 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
367 };
368
369 i2c0_pins_a: i2c0@0 {
370 allwinner,pins = "PH2", "PH3";
371 allwinner,function = "i2c0";
372 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
373 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
374 };
375
376 i2c1_pins_a: i2c1@0 {
377 allwinner,pins = "PH4", "PH5";
378 allwinner,function = "i2c1";
379 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
380 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
381 };
382
383 i2c2_pins_a: i2c2@0 {
384 allwinner,pins = "PE12", "PE13";
385 allwinner,function = "i2c2";
386 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
387 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
388 };
389 };
390
391 ahb1_rst: reset@01c202c0 {
392 #reset-cells = <1>;
393 compatible = "allwinner,sun6i-a31-clock-reset";
394 reg = <0x01c202c0 0xc>;
395 };
396
397 apb1_rst: reset@01c202d0 {
398 #reset-cells = <1>;
399 compatible = "allwinner,sun6i-a31-clock-reset";
400 reg = <0x01c202d0 0x4>;
401 };
402
403 apb2_rst: reset@01c202d8 {
404 #reset-cells = <1>;
405 compatible = "allwinner,sun6i-a31-clock-reset";
406 reg = <0x01c202d8 0x4>;
407 };
408
409 timer@01c20c00 {
410 compatible = "allwinner,sun4i-a10-timer";
411 reg = <0x01c20c00 0xa0>;
412 interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
413 <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
414 clocks = <&osc24M>;
415 };
416
417 wdt0: watchdog@01c20ca0 {
418 compatible = "allwinner,sun6i-a31-wdt";
419 reg = <0x01c20ca0 0x20>;
420 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
421 };
422
423 lradc: lradc@01c22800 {
424 compatible = "allwinner,sun4i-a10-lradc-keys";
425 reg = <0x01c22800 0x100>;
426 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
427 status = "disabled";
428 };
429
430 uart0: serial@01c28000 {
431 compatible = "snps,dw-apb-uart";
432 reg = <0x01c28000 0x400>;
433 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
434 reg-shift = <2>;
435 reg-io-width = <4>;
436 clocks = <&apb2_gates 16>;
437 resets = <&apb2_rst 16>;
438 dmas = <&dma 6>, <&dma 6>;
439 dma-names = "rx", "tx";
440 status = "disabled";
441 };
442
443 uart1: serial@01c28400 {
444 compatible = "snps,dw-apb-uart";
445 reg = <0x01c28400 0x400>;
446 interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
447 reg-shift = <2>;
448 reg-io-width = <4>;
449 clocks = <&apb2_gates 17>;
450 resets = <&apb2_rst 17>;
451 dmas = <&dma 7>, <&dma 7>;
452 dma-names = "rx", "tx";
453 status = "disabled";
454 };
455
456 uart2: serial@01c28800 {
457 compatible = "snps,dw-apb-uart";
458 reg = <0x01c28800 0x400>;
459 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
460 reg-shift = <2>;
461 reg-io-width = <4>;
462 clocks = <&apb2_gates 18>;
463 resets = <&apb2_rst 18>;
464 dmas = <&dma 8>, <&dma 8>;
465 dma-names = "rx", "tx";
466 status = "disabled";
467 };
468
469 uart3: serial@01c28c00 {
470 compatible = "snps,dw-apb-uart";
471 reg = <0x01c28c00 0x400>;
472 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
473 reg-shift = <2>;
474 reg-io-width = <4>;
475 clocks = <&apb2_gates 19>;
476 resets = <&apb2_rst 19>;
477 dmas = <&dma 9>, <&dma 9>;
478 dma-names = "rx", "tx";
479 status = "disabled";
480 };
481
482 uart4: serial@01c29000 {
483 compatible = "snps,dw-apb-uart";
484 reg = <0x01c29000 0x400>;
485 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
486 reg-shift = <2>;
487 reg-io-width = <4>;
488 clocks = <&apb2_gates 20>;
489 resets = <&apb2_rst 20>;
490 dmas = <&dma 10>, <&dma 10>;
491 dma-names = "rx", "tx";
492 status = "disabled";
493 };
494
495 i2c0: i2c@01c2ac00 {
496 compatible = "allwinner,sun6i-a31-i2c";
497 reg = <0x01c2ac00 0x400>;
498 interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
499 clocks = <&apb2_gates 0>;
500 resets = <&apb2_rst 0>;
501 status = "disabled";
502 #address-cells = <1>;
503 #size-cells = <0>;
504 };
505
506 i2c1: i2c@01c2b000 {
507 compatible = "allwinner,sun6i-a31-i2c";
508 reg = <0x01c2b000 0x400>;
509 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
510 clocks = <&apb2_gates 1>;
511 resets = <&apb2_rst 1>;
512 status = "disabled";
513 #address-cells = <1>;
514 #size-cells = <0>;
515 };
516
517 i2c2: i2c@01c2b400 {
518 compatible = "allwinner,sun6i-a31-i2c";
519 reg = <0x01c2b400 0x400>;
520 interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
521 clocks = <&apb2_gates 2>;
522 resets = <&apb2_rst 2>;
523 status = "disabled";
524 #address-cells = <1>;
525 #size-cells = <0>;
526 };
527
528 gic: interrupt-controller@01c81000 {
529 compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
530 reg = <0x01c81000 0x1000>,
531 <0x01c82000 0x1000>,
532 <0x01c84000 0x2000>,
533 <0x01c86000 0x2000>;
534 interrupt-controller;
535 #interrupt-cells = <3>;
536 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
537 };
538
539 rtc: rtc@01f00000 {
540 compatible = "allwinner,sun6i-a31-rtc";
541 reg = <0x01f00000 0x54>;
542 interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
543 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
544 };
545
546 prcm@01f01400 {
547 compatible = "allwinner,sun8i-a23-prcm";
548 reg = <0x01f01400 0x200>;
549
550 ar100: ar100_clk {
551 compatible = "fixed-factor-clock";
552 #clock-cells = <0>;
553 clock-div = <1>;
554 clock-mult = <1>;
555 clocks = <&osc24M>;
556 clock-output-names = "ar100";
557 };
558
559 ahb0: ahb0_clk {
560 compatible = "fixed-factor-clock";
561 #clock-cells = <0>;
562 clock-div = <1>;
563 clock-mult = <1>;
564 clocks = <&ar100>;
565 clock-output-names = "ahb0";
566 };
567
568 apb0: apb0_clk {
569 compatible = "allwinner,sun8i-a23-apb0-clk";
570 #clock-cells = <0>;
571 clocks = <&ahb0>;
572 clock-output-names = "apb0";
573 };
574
575 apb0_gates: apb0_gates_clk {
576 compatible = "allwinner,sun8i-a23-apb0-gates-clk";
577 #clock-cells = <1>;
578 clocks = <&apb0>;
579 clock-output-names = "apb0_pio", "apb0_timer",
580 "apb0_rsb", "apb0_uart",
581 "apb0_i2c";
582 };
583
584 apb0_rst: apb0_rst {
585 compatible = "allwinner,sun6i-a31-clock-reset";
586 #reset-cells = <1>;
587 };
588 };
589
590 cpucfg@01f01c00 {
591 compatible = "allwinner,sun8i-a23-cpuconfig";
592 reg = <0x01f01c00 0x300>;
593 };
594
595 r_uart: serial@01f02800 {
596 compatible = "snps,dw-apb-uart";
597 reg = <0x01f02800 0x400>;
598 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
599 reg-shift = <2>;
600 reg-io-width = <4>;
601 clocks = <&apb0_gates 4>;
602 resets = <&apb0_rst 4>;
603 status = "disabled";
604 };
605
606 r_pio: pinctrl@01f02c00 {
607 compatible = "allwinner,sun8i-a23-r-pinctrl";
608 reg = <0x01f02c00 0x400>;
609 interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
610 clocks = <&apb0_gates 0>;
611 resets = <&apb0_rst 0>;
612 gpio-controller;
613 interrupt-controller;
614 #address-cells = <1>;
615 #size-cells = <0>;
616 #gpio-cells = <3>;
617
618 r_uart_pins_a: r_uart@0 {
619 allwinner,pins = "PL2", "PL3";
620 allwinner,function = "s_uart";
621 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
622 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
623 };
624 };
625 };
626};