blob: 0b79a2960087da05e0ec5fcb6854d1b2699841d6 [file] [log] [blame]
Sean Andersond11b5822020-06-24 06:41:23 -04001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2019-20 Sean Anderson <seanga2@gmail.com>
4 */
5
6#include <dt-bindings/clock/k210-sysctl.h>
7#include <dt-bindings/mfd/k210-sysctl.h>
Sean Anderson68705562020-09-14 11:02:04 -04008#include <dt-bindings/pinctrl/k210-pinctrl.h>
Sean Andersond11b5822020-06-24 06:41:23 -04009#include <dt-bindings/reset/k210-sysctl.h>
10
11/ {
12 /*
13 * Although the K210 is a 64-bit CPU, the address bus is only 32-bits
14 * wide, and the upper half of all addresses is ignored.
15 */
16 #address-cells = <1>;
17 #size-cells = <1>;
18 compatible = "kendryte,k210";
19
20 aliases {
Sean Andersonc6d0ef82020-09-28 10:52:28 -040021 cpu0 = &cpu0;
22 cpu1 = &cpu1;
Sean Andersond11b5822020-06-24 06:41:23 -040023 dma0 = &dmac0;
24 gpio0 = &gpio0;
25 gpio1 = &gpio1_0;
26 i2c0 = &i2c0;
27 i2c1 = &i2c1;
28 i2c2 = &i2c2;
29 pinctrl0 = &fpioa;
30 serial0 = &uarths0;
31 serial1 = &uart1;
32 serial2 = &uart2;
33 serial3 = &uart3;
34 spi0 = &spi0;
35 spi1 = &spi1;
36 spi2 = &spi2;
37 spi3 = &spi3;
38 timer0 = &timer0;
39 timer1 = &timer1;
40 timer2 = &timer2;
41 };
42
43 cpus {
44 #address-cells = <1>;
45 #size-cells = <0>;
46 timebase-frequency = <7800000>;
47 cpu0: cpu@0 {
48 device_type = "cpu";
49 compatible = "kendryte,k210", "sifive,rocket0", "riscv";
50 reg = <0>;
51 riscv,isa = "rv64imafdgc";
52 mmu-type = "sv39";
53 i-cache-block-size = <64>;
54 i-cache-size = <0x8000>;
55 d-cache-block-size = <64>;
56 d-cache-size = <0x8000>;
57 clocks = <&sysclk K210_CLK_CPU>;
58 cpu0_intc: interrupt-controller {
59 #interrupt-cells = <1>;
60 interrupt-controller;
61 compatible = "riscv,cpu-intc";
62 };
63 };
64 cpu1: cpu@1 {
65 device_type = "cpu";
66 compatible = "kendryte,k210", "sifive,rocket0", "riscv";
67 reg = <1>;
68 riscv,isa = "rv64imafdgc";
69 mmu-type = "sv39";
70 i-cache-block-size = <64>;
71 i-cache-size = <0x8000>;
72 d-cache-block-size = <64>;
73 d-cache-size = <0x8000>;
74 clocks = <&sysclk K210_CLK_CPU>;
75 cpu1_intc: interrupt-controller {
76 #interrupt-cells = <1>;
77 interrupt-controller;
78 compatible = "riscv,cpu-intc";
79 };
80 };
81 };
82
83 sram: memory@80000000 {
84 device_type = "memory";
85 compatible = "kendryte,k210-sram";
86 reg = <0x80000000 0x400000>,
87 <0x80400000 0x200000>,
88 <0x80600000 0x200000>;
89 reg-names = "sram0", "sram1", "airam";
90 clocks = <&sysclk K210_CLK_SRAM0>,
91 <&sysclk K210_CLK_SRAM1>,
92 <&sysclk K210_CLK_PLL1>;
93 clock-names = "sram0", "sram1", "airam";
94 };
95
96 reserved-memory {
97 #address-cells = <1>;
98 #size-cells = <1>;
99 ranges;
100
101 ai_reserved: ai@80600000 {
102 reg = <0x80600000 0x200000>;
103 reusable;
104 };
105 };
106
107 clocks {
108 in0: osc {
109 compatible = "fixed-clock";
110 #clock-cells = <0>;
111 clock-frequency = <26000000>;
112 };
113 };
114
115 soc {
116 #address-cells = <1>;
117 #size-cells = <1>;
118 compatible = "kendryte,k210-soc", "simple-bus";
119 ranges;
120 interrupt-parent = <&plic0>;
121
122 debug0: debug@0 {
123 compatible = "kendryte,k210-debug", "riscv,debug";
124 reg = <0x0 0x1000>;
125 };
126
127 rom0: nvmem@1000 {
128 reg = <0x1000 0x1000>;
129 read-only;
130 };
131
Sean Andersonc6d0ef82020-09-28 10:52:28 -0400132 clint0: clint@2000000 {
Sean Andersond11b5822020-06-24 06:41:23 -0400133 #interrupt-cells = <1>;
134 compatible = "kendryte,k210-clint", "riscv,clint0";
135 reg = <0x2000000 0xC000>;
Sean Andersond11b5822020-06-24 06:41:23 -0400136 interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>,
137 <&cpu1_intc 3>, <&cpu1_intc 7>;
Sean Andersonc6d0ef82020-09-28 10:52:28 -0400138 clocks = <&sysclk K210_CLK_CLINT>;
Sean Andersond11b5822020-06-24 06:41:23 -0400139 };
140
141 plic0: interrupt-controller@C000000 {
142 #interrupt-cells = <1>;
143 compatible = "kendryte,k210-plic", "riscv,plic0";
144 reg = <0xC000000 0x4000000>;
145 interrupt-controller;
146 interrupts-extended = <&cpu0_intc 9>, <&cpu0_intc 11>,
147 <&cpu1_intc 9>, <&cpu1_intc 11>;
148 riscv,ndev = <65>;
149 riscv,max-priority = <7>;
150 };
151
152 uarths0: serial@38000000 {
153 compatible = "kendryte,k210-uarths", "sifive,uart0";
154 reg = <0x38000000 0x1000>;
155 interrupts = <33>;
156 clocks = <&sysclk K210_CLK_CPU>;
157 status = "disabled";
158 };
159
160 gpio0: gpio-controller@38001000 {
161 #interrupt-cells = <2>;
162 #gpio-cells = <2>;
163 compatible = "kendryte,k210-gpiohs", "sifive,gpio0";
164 reg = <0x38001000 0x1000>;
165 interrupt-controller;
166 interrupts = <34 35 36 37 38 39 40 41
167 42 43 44 45 46 47 48 49
168 50 51 52 53 54 55 56 57
169 58 59 60 61 62 63 64 65>;
170 gpio-controller;
171 ngpios = <32>;
172 status = "disabled";
173 };
174
175 kpu0: kpu@40800000 {
176 compatible = "kendryte,k210-kpu";
177 reg = <0x40800000 0xc00000>;
178 interrupts = <25>;
179 clocks = <&sysclk K210_CLK_AI>;
180 memory-region = <&ai_reserved>;
181 status = "disabled";
182 };
183
184 fft0: fft@42000000 {
185 compatible = "kendryte,k210-fft";
186 reg = <0x42000000 0x400000>;
187 interrupts = <26>;
188 clocks = <&sysclk K210_CLK_FFT>;
189 resets = <&sysrst K210_RST_FFT>;
190 status = "disabled";
191 };
192
193 dmac0: dma-controller@50000000 {
194 compatible = "kendryte,k210-dmac", "snps,axi-dma-1.01a";
195 reg = <0x50000000 0x1000>;
196 interrupts = <27 28 29 30 31 32>;
197 clocks = <&sysclk K210_CLK_DMA>, <&sysclk K210_CLK_DMA>;
198 clock-names = "core-clk", "cfgr-clk";
199 resets = <&sysrst K210_RST_DMA>;
200 dma-channels = <6>;
201 snps,dma-masters = <2>;
202 snps,data-width = <5>;
Sean Andersond1b33212020-10-12 14:18:15 -0400203 snps,block-size = <0x200000 0x200000 0x200000
204 0x200000 0x200000 0x200000>;
Sean Andersond11b5822020-06-24 06:41:23 -0400205 snps,axi-max-burst-len = <256>;
206 status = "disabled";
207 };
208
209 apb0: bus@50200000 {
210 #address-cells = <1>;
211 #size-cells = <1>;
212 compatible = "kendryte,k210-apb", "simple-pm-bus";
213 ranges;
214 clocks = <&sysclk K210_CLK_APB0>;
215
216 gpio1: gpio-controller@50200000 {
217 #address-cells = <1>;
218 #size-cells = <0>;
219 compatible = "kendryte,k210-gpio",
220 "snps,dw-apb-gpio";
221 reg = <0x50200000 0x80>;
222 clocks = <&sysclk K210_CLK_GPIO>;
223 resets = <&sysrst K210_RST_GPIO>;
224 status = "disabled";
225
226 gpio1_0: gpio1@0 {
227 #gpio-cells = <2>;
228 #interrupt-cells = <2>;
229 compatible = "snps,dw-apb-gpio-port";
230 reg = <0>;
231 interrupt-controller;
232 interrupts = <23>;
233 gpio-controller;
234 snps,nr-gpios = <8>;
235 };
236 };
237
238 uart1: serial@50210000 {
239 compatible = "kendryte,k210-uart",
240 "snps,dw-apb-uart";
241 reg = <0x50210000 0x100>;
242 interrupts = <11>;
243 clocks = <&sysclk K210_CLK_UART1>;
244 resets = <&sysrst K210_RST_UART1>;
245 reg-io-width = <4>;
246 reg-shift = <2>;
247 dcd-override;
248 dsr-override;
249 cts-override;
250 ri-override;
251 status = "disabled";
252 };
253
254 uart2: serial@50220000 {
255 compatible = "kendryte,k210-uart",
256 "snps,dw-apb-uart";
257 reg = <0x50220000 0x100>;
258 interrupts = <12>;
259 clocks = <&sysclk K210_CLK_UART2>;
260 resets = <&sysrst K210_RST_UART2>;
261 reg-io-width = <4>;
262 reg-shift = <2>;
263 dcd-override;
264 dsr-override;
265 cts-override;
266 ri-override;
267 status = "disabled";
268 };
269
270 uart3: serial@50230000 {
271 compatible = "kendryte,k210-uart",
272 "snps,dw-apb-uart";
273 reg = <0x50230000 0x100>;
274 interrupts = <13>;
275 clocks = <&sysclk K210_CLK_UART3>;
276 resets = <&sysrst K210_RST_UART3>;
277 reg-io-width = <4>;
278 reg-shift = <2>;
279 dcd-override;
280 dsr-override;
281 cts-override;
282 ri-override;
283 status = "disabled";
284 };
285
286 spi2: spi@50240000 {
Sean Andersonfd9571a2020-10-16 18:57:50 -0400287 compatible = "canaan,kendryte-k210-spi",
288 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400289 "snps,dw-apb-ssi";
290 spi-slave;
291 reg = <0x50240000 0x100>;
292 interrupts = <2>;
293 clocks = <&sysclk K210_CLK_SPI2>;
294 resets = <&sysrst K210_RST_SPI2>;
295 spi-max-frequency = <25000000>;
296 status = "disabled";
297 };
298
299 i2s0: i2s@50250000 {
300 compatible = "kendryte,k210-i2s",
301 "snps,designware-i2s";
302 reg = <0x50250000 0x200>;
303 interrupts = <5>;
304 clocks = <&sysclk K210_CLK_I2S0>;
305 clock-names = "i2sclk";
306 resets = <&sysrst K210_RST_I2S0>;
307 status = "disabled";
308 };
309
310 apu0: sound@520250200 {
311 compatible = "kendryte,k210-apu";
312 reg = <0x50250200 0x200>;
313 status = "disabled";
314 };
315
316 i2s1: i2s@50260000 {
317 compatible = "kendryte,k210-i2s",
318 "snps,designware-i2s";
319 reg = <0x50260000 0x200>;
320 interrupts = <6>;
321 clocks = <&sysclk K210_CLK_I2S1>;
322 clock-names = "i2sclk";
323 resets = <&sysrst K210_RST_I2S1>;
324 status = "disabled";
325 };
326
327 i2s2: i2s@50270000 {
328 compatible = "kendryte,k210-i2s",
329 "snps,designware-i2s";
330 reg = <0x50270000 0x200>;
331 interrupts = <7>;
332 clocks = <&sysclk K210_CLK_I2S2>;
333 clock-names = "i2sclk";
334 resets = <&sysrst K210_RST_I2S2>;
335 status = "disabled";
336 };
337
338 i2c0: i2c@50280000 {
339 compatible = "kendryte,k210-i2c",
340 "snps,designware-i2c";
341 reg = <0x50280000 0x100>;
342 interrupts = <8>;
343 clocks = <&sysclk K210_CLK_I2C0>;
344 resets = <&sysrst K210_RST_I2C0>;
345 status = "disabled";
346 };
347
348 i2c1: i2c@50290000 {
349 compatible = "kendryte,k210-i2c",
350 "snps,designware-i2c";
351 reg = <0x50290000 0x100>;
352 interrupts = <9>;
353 clocks = <&sysclk K210_CLK_I2C1>;
354 resets = <&sysrst K210_RST_I2C1>;
355 status = "disabled";
356 };
357
358 i2c2: i2c@502A0000 {
359 compatible = "kendryte,k210-i2c",
360 "snps,designware-i2c";
361 reg = <0x502A0000 0x100>;
362 interrupts = <10>;
363 clocks = <&sysclk K210_CLK_I2C2>;
364 resets = <&sysrst K210_RST_I2C2>;
365 status = "disabled";
366 };
367
368 fpioa: pinmux@502B0000 {
369 compatible = "kendryte,k210-fpioa";
370 reg = <0x502B0000 0x100>;
371 clocks = <&sysclk K210_CLK_FPIOA>;
372 resets = <&sysrst K210_RST_FPIOA>;
Sean Anderson68705562020-09-14 11:02:04 -0400373 kendryte,sysctl = <&sysctl>;
374 kendryte,power-offset = <K210_SYSCTL_POWER_SEL>;
375 pinctrl-0 = <&fpioa_jtag>;
376 pinctrl-names = "default";
Sean Andersond11b5822020-06-24 06:41:23 -0400377 status = "disabled";
Sean Anderson68705562020-09-14 11:02:04 -0400378
379 fpioa_jtag: jtag {
380 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
381 <K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
382 <K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
383 <K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
384 };
Sean Andersond11b5822020-06-24 06:41:23 -0400385 };
386
387 sha256: sha256@502C0000 {
388 compatible = "kendryte,k210-sha256";
389 reg = <0x502C0000 0x100>;
390 clocks = <&sysclk K210_CLK_SHA>;
391 resets = <&sysrst K210_RST_SHA>;
392 status = "disabled";
393 };
394
395 timer0: timer@502D0000 {
396 compatible = "kendryte,k210-timer",
397 "snps,dw-apb-timer";
398 reg = <0x502D0000 0x100>;
399 interrupts = <14 15>;
400 clocks = <&sysclk K210_CLK_TIMER0>;
401 clock-names = "timer";
402 resets = <&sysrst K210_RST_TIMER0>;
403 status = "disabled";
404 };
405
406 timer1: timer@502E0000 {
407 compatible = "kendryte,k210-timer",
408 "snps,dw-apb-timer";
409 reg = <0x502E0000 0x100>;
410 interrupts = <16 17>;
411 clocks = <&sysclk K210_CLK_TIMER1>;
412 clock-names = "timer";
413 resets = <&sysrst K210_RST_TIMER1>;
414 status = "disabled";
415 };
416
417 timer2: timer@502F0000 {
418 compatible = "kendryte,k210-timer",
419 "snps,dw-apb-timer";
420 reg = <0x502F0000 0x100>;
421 interrupts = <18 19>;
422 clocks = <&sysclk K210_CLK_TIMER2>;
423 clock-names = "timer";
424 resets = <&sysrst K210_RST_TIMER2>;
425 status = "disabled";
426 };
427 };
428
429 apb1: bus@50400000 {
430 #address-cells = <1>;
431 #size-cells = <1>;
432 compatible = "kendryte,k210-apb", "simple-pm-bus";
433 ranges;
434 clocks = <&sysclk K210_CLK_APB1>;
435
436 wdt0: watchdog@50400000 {
437 compatible = "kendryte,k210-wdt", "snps,dw-wdt";
438 reg = <0x50400000 0x100>;
439 interrupts = <21>;
440 clocks = <&sysclk K210_CLK_WDT0>;
441 resets = <&sysrst K210_RST_WDT0>;
Sean Andersond11b5822020-06-24 06:41:23 -0400442 };
443
444 wdt1: watchdog@50410000 {
445 compatible = "kendryte,k210-wdt", "snps,dw-wdt";
446 reg = <0x50410000 0x100>;
447 interrupts = <22>;
448 clocks = <&sysclk K210_CLK_WDT1>;
449 resets = <&sysrst K210_RST_WDT1>;
450 status = "disabled";
451 };
452
453 otp0: nvmem@50420000 {
454 #address-cells = <1>;
455 #size-cells = <1>;
456 compatible = "kendryte,k210-otp";
457 reg = <0x50420000 0x100>,
458 <0x88000000 0x20000>;
459 reg-names = "reg", "mem";
460 clocks = <&sysclk K210_CLK_ROM>;
461 resets = <&sysrst K210_RST_ROM>;
462 read-only;
463 status = "disabled";
464
465 /* Bootloader */
466 firmware@00000 {
467 reg = <0x00000 0xC200>;
468 };
469
470 /*
471 * config string as described in RISC-V
472 * privileged spec 1.9
473 */
474 config-1-9@1c000 {
475 reg = <0x1C000 0x1000>;
476 };
477
478 /*
479 * Device tree containing only registers,
480 * interrupts, and cpus
481 */
482 fdt@1d000 {
483 reg = <0x1D000 0x2000>;
484 };
485
486 /* CPU/ROM credits */
487 credits@1f000 {
488 reg = <0x1F000 0x1000>;
489 };
490 };
491
492 dvp0: camera@50430000 {
493 compatible = "kendryte,k210-dvp";
494 reg = <0x50430000 0x100>;
495 interrupts = <24>;
496 clocks = <&sysclk K210_CLK_DVP>;
497 resets = <&sysrst K210_RST_DVP>;
Sean Anderson2ddd3e02020-10-16 18:57:54 -0400498 kendryte,sysctl = <&sysctl>;
499 kendryte,misc-offset = <K210_SYSCTL_MISC>;
Sean Andersond11b5822020-06-24 06:41:23 -0400500 status = "disabled";
501 };
502
503 sysctl: syscon@50440000 {
504 compatible = "kendryte,k210-sysctl",
505 "syscon", "simple-mfd";
506 reg = <0x50440000 0x100>;
507 reg-io-width = <4>;
508
509 sysclk: clock-controller {
510 #clock-cells = <1>;
511 compatible = "kendryte,k210-clk";
512 clocks = <&in0>;
513 };
514
515 sysrst: reset-controller {
516 compatible = "kendryte,k210-rst",
517 "syscon-reset";
518 #reset-cells = <1>;
519 regmap = <&sysctl>;
520 offset = <K210_SYSCTL_PERI_RESET>;
521 mask = <0x27FFFFFF>;
522 assert-high = <1>;
523 };
524
525 reboot {
526 compatible = "syscon-reboot";
527 regmap = <&sysctl>;
528 offset = <K210_SYSCTL_SOFT_RESET>;
529 mask = <1>;
530 value = <1>;
531 };
532 };
533
534 aes0: aes@50450000 {
535 compatible = "kendryte,k210-aes";
536 reg = <0x50450000 0x100>;
537 clocks = <&sysclk K210_CLK_AES>;
538 resets = <&sysrst K210_RST_AES>;
539 status = "disabled";
540 };
541
542 rtc: rtc@50460000 {
543 compatible = "kendryte,k210-rtc";
544 reg = <0x50460000 0x100>;
545 clocks = <&in0>;
546 resets = <&sysrst K210_RST_RTC>;
547 interrupts = <20>;
548 status = "disabled";
549 };
550 };
551
552 apb2: bus@52000000 {
553 #address-cells = <1>;
554 #size-cells = <1>;
555 compatible = "kendryte,k210-apb", "simple-pm-bus";
556 ranges;
557 clocks = <&sysclk K210_CLK_APB2>;
558
559 spi0: spi@52000000 {
560 #address-cells = <1>;
561 #size-cells = <0>;
Sean Andersonfd9571a2020-10-16 18:57:50 -0400562 compatible = "canaan,kendryte-k210-spi",
563 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400564 "snps,dw-apb-ssi";
565 reg = <0x52000000 0x100>;
566 interrupts = <1>;
567 clocks = <&sysclk K210_CLK_SPI0>;
568 clock-names = "ssi_clk";
569 resets = <&sysrst K210_RST_SPI0>;
570 spi-max-frequency = <25000000>;
571 num-cs = <4>;
572 reg-io-width = <4>;
573 status = "disabled";
574 };
575
576 spi1: spi@53000000 {
577 #address-cells = <1>;
578 #size-cells = <0>;
Sean Andersonfd9571a2020-10-16 18:57:50 -0400579 compatible = "canaan,kendryte-k210-spi",
580 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400581 "snps,dw-apb-ssi";
582 reg = <0x53000000 0x100>;
583 interrupts = <2>;
584 clocks = <&sysclk K210_CLK_SPI1>;
585 clock-names = "ssi_clk";
586 resets = <&sysrst K210_RST_SPI1>;
587 spi-max-frequency = <25000000>;
588 num-cs = <4>;
589 reg-io-width = <4>;
590 status = "disabled";
591 };
592
593 spi3: spi@54000000 {
594 #address-cells = <1>;
595 #size-cells = <0>;
Sean Andersonfd9571a2020-10-16 18:57:50 -0400596 compatible = "canaan,kendryte-k210-ssi",
597 "snps,dwc-ssi-1.01a";
Sean Andersond11b5822020-06-24 06:41:23 -0400598 reg = <0x54000000 0x200>;
599 interrupts = <4>;
600 clocks = <&sysclk K210_CLK_SPI3>;
601 clock-names = "ssi_clk";
602 resets = <&sysrst K210_RST_SPI3>;
603 /* Could possibly go up to 200 MHz */
604 spi-max-frequency = <100000000>;
605 num-cs = <4>;
606 reg-io-width = <4>;
607 status = "disabled";
608 };
609 };
610 };
611};