blob: 3cc83791339e55f49d69ef7c2ad1487b23b6dd15 [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>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000018 compatible = "canaan,kendryte-k210";
Sean Andersond11b5822020-06-24 06:41:23 -040019
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";
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000049 compatible = "canaan,k210", "sifive,rocket0", "riscv";
Sean Andersond11b5822020-06-24 06:41:23 -040050 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";
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000066 compatible = "canaan,k210", "sifive,rocket0", "riscv";
Sean Andersond11b5822020-06-24 06:41:23 -040067 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";
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000085 compatible = "canaan,k210-sram";
Sean Andersond11b5822020-06-24 06:41:23 -040086 reg = <0x80000000 0x400000>,
87 <0x80400000 0x200000>,
88 <0x80600000 0x200000>;
Sean Anderson7be6d2b2021-04-08 22:13:11 -040089 reg-names = "sram0", "sram1", "aisram";
Sean Andersond11b5822020-06-24 06:41:23 -040090 clocks = <&sysclk K210_CLK_SRAM0>,
91 <&sysclk K210_CLK_SRAM1>,
Sean Andersonb23d7572021-04-08 22:13:12 -040092 <&sysclk K210_CLK_AI>;
Sean Anderson7be6d2b2021-04-08 22:13:11 -040093 clock-names = "sram0", "sram1", "aisram";
Sean Andersone8d9e3a2021-04-08 22:13:09 -040094 u-boot,dm-pre-reloc;
Sean Andersond11b5822020-06-24 06:41:23 -040095 };
96
Sean Andersond11b5822020-06-24 06:41:23 -040097 clocks {
98 in0: osc {
99 compatible = "fixed-clock";
100 #clock-cells = <0>;
101 clock-frequency = <26000000>;
Sean Andersone8d9e3a2021-04-08 22:13:09 -0400102 u-boot,dm-pre-reloc;
Sean Andersond11b5822020-06-24 06:41:23 -0400103 };
104 };
105
106 soc {
107 #address-cells = <1>;
108 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000109 compatible = "canaan,k210-soc", "simple-bus";
Sean Andersond11b5822020-06-24 06:41:23 -0400110 ranges;
111 interrupt-parent = <&plic0>;
112
113 debug0: debug@0 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000114 compatible = "canaan,k210-debug", "riscv,debug";
Sean Andersond11b5822020-06-24 06:41:23 -0400115 reg = <0x0 0x1000>;
116 };
117
118 rom0: nvmem@1000 {
119 reg = <0x1000 0x1000>;
120 read-only;
121 };
122
Sean Andersonc6d0ef82020-09-28 10:52:28 -0400123 clint0: clint@2000000 {
Sean Andersond11b5822020-06-24 06:41:23 -0400124 #interrupt-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000125 compatible = "canaan,k210-clint", "sifive,clint0", "riscv,clint0";
Sean Andersond11b5822020-06-24 06:41:23 -0400126 reg = <0x2000000 0xC000>;
Sean Andersond11b5822020-06-24 06:41:23 -0400127 interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>,
128 <&cpu1_intc 3>, <&cpu1_intc 7>;
Sean Andersonc6d0ef82020-09-28 10:52:28 -0400129 clocks = <&sysclk K210_CLK_CLINT>;
Sean Andersond11b5822020-06-24 06:41:23 -0400130 };
131
132 plic0: interrupt-controller@C000000 {
133 #interrupt-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000134 compatible = "canaan,k210-plic", "sifive,plic-1.0.0", "riscv,plic0";
Sean Andersond11b5822020-06-24 06:41:23 -0400135 reg = <0xC000000 0x4000000>;
136 interrupt-controller;
Niklas Cassel5b845a42022-03-01 10:35:42 +0000137 interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>,
138 <&cpu1_intc 11>, <&cpu1_intc 9>;
Sean Andersond11b5822020-06-24 06:41:23 -0400139 riscv,ndev = <65>;
140 riscv,max-priority = <7>;
141 };
142
143 uarths0: serial@38000000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000144 compatible = "canaan,k210-uarths", "sifive,uart0";
Sean Andersond11b5822020-06-24 06:41:23 -0400145 reg = <0x38000000 0x1000>;
146 interrupts = <33>;
147 clocks = <&sysclk K210_CLK_CPU>;
148 status = "disabled";
149 };
150
151 gpio0: gpio-controller@38001000 {
152 #interrupt-cells = <2>;
153 #gpio-cells = <2>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000154 compatible = "canaan,k210-gpiohs", "sifive,gpio0";
Sean Andersond11b5822020-06-24 06:41:23 -0400155 reg = <0x38001000 0x1000>;
156 interrupt-controller;
157 interrupts = <34 35 36 37 38 39 40 41
158 42 43 44 45 46 47 48 49
159 50 51 52 53 54 55 56 57
160 58 59 60 61 62 63 64 65>;
161 gpio-controller;
162 ngpios = <32>;
163 status = "disabled";
164 };
165
166 kpu0: kpu@40800000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000167 compatible = "canaan,k210-kpu";
Sean Andersond11b5822020-06-24 06:41:23 -0400168 reg = <0x40800000 0xc00000>;
169 interrupts = <25>;
170 clocks = <&sysclk K210_CLK_AI>;
Sean Andersond11b5822020-06-24 06:41:23 -0400171 status = "disabled";
172 };
173
174 fft0: fft@42000000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000175 compatible = "canaan,k210-fft";
Sean Andersond11b5822020-06-24 06:41:23 -0400176 reg = <0x42000000 0x400000>;
177 interrupts = <26>;
178 clocks = <&sysclk K210_CLK_FFT>;
179 resets = <&sysrst K210_RST_FFT>;
180 status = "disabled";
181 };
182
183 dmac0: dma-controller@50000000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000184 compatible = "canaan,k210-dmac", "snps,axi-dma-1.01a";
Sean Andersond11b5822020-06-24 06:41:23 -0400185 reg = <0x50000000 0x1000>;
186 interrupts = <27 28 29 30 31 32>;
187 clocks = <&sysclk K210_CLK_DMA>, <&sysclk K210_CLK_DMA>;
188 clock-names = "core-clk", "cfgr-clk";
189 resets = <&sysrst K210_RST_DMA>;
190 dma-channels = <6>;
191 snps,dma-masters = <2>;
192 snps,data-width = <5>;
Sean Andersond1b33212020-10-12 14:18:15 -0400193 snps,block-size = <0x200000 0x200000 0x200000
194 0x200000 0x200000 0x200000>;
Sean Andersond11b5822020-06-24 06:41:23 -0400195 snps,axi-max-burst-len = <256>;
196 status = "disabled";
197 };
198
199 apb0: bus@50200000 {
200 #address-cells = <1>;
201 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000202 compatible = "canaan,k210-apb", "simple-pm-bus";
Sean Andersond11b5822020-06-24 06:41:23 -0400203 ranges;
204 clocks = <&sysclk K210_CLK_APB0>;
205
206 gpio1: gpio-controller@50200000 {
207 #address-cells = <1>;
208 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000209 compatible = "canaan,k210-gpio",
Sean Andersond11b5822020-06-24 06:41:23 -0400210 "snps,dw-apb-gpio";
211 reg = <0x50200000 0x80>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000212 clocks = <&sysclk K210_CLK_APB0>,
213 <&sysclk K210_CLK_GPIO>;
214 clock-names = "bus", "db";
Sean Andersond11b5822020-06-24 06:41:23 -0400215 resets = <&sysrst K210_RST_GPIO>;
216 status = "disabled";
217
218 gpio1_0: gpio1@0 {
219 #gpio-cells = <2>;
220 #interrupt-cells = <2>;
221 compatible = "snps,dw-apb-gpio-port";
222 reg = <0>;
223 interrupt-controller;
224 interrupts = <23>;
225 gpio-controller;
226 snps,nr-gpios = <8>;
227 };
228 };
229
230 uart1: serial@50210000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000231 compatible = "canaan,k210-uart",
Sean Andersond11b5822020-06-24 06:41:23 -0400232 "snps,dw-apb-uart";
233 reg = <0x50210000 0x100>;
234 interrupts = <11>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000235 clocks = <&sysclk K210_CLK_UART1>,
236 <&sysclk K210_CLK_APB0>;
237 clock-names = "baudclk", "apb_pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400238 resets = <&sysrst K210_RST_UART1>;
239 reg-io-width = <4>;
240 reg-shift = <2>;
241 dcd-override;
242 dsr-override;
243 cts-override;
244 ri-override;
245 status = "disabled";
246 };
247
248 uart2: serial@50220000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000249 compatible = "canaan,k210-uart",
Sean Andersond11b5822020-06-24 06:41:23 -0400250 "snps,dw-apb-uart";
251 reg = <0x50220000 0x100>;
252 interrupts = <12>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000253 clocks = <&sysclk K210_CLK_UART2>,
254 <&sysclk K210_CLK_APB0>;
255 clock-names = "baudclk", "apb_pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400256 resets = <&sysrst K210_RST_UART2>;
257 reg-io-width = <4>;
258 reg-shift = <2>;
259 dcd-override;
260 dsr-override;
261 cts-override;
262 ri-override;
263 status = "disabled";
264 };
265
266 uart3: serial@50230000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000267 compatible = "canaan,k210-uart",
Sean Andersond11b5822020-06-24 06:41:23 -0400268 "snps,dw-apb-uart";
269 reg = <0x50230000 0x100>;
270 interrupts = <13>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000271 clocks = <&sysclk K210_CLK_UART3>,
272 <&sysclk K210_CLK_APB0>;
273 clock-names = "baudclk", "apb_pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400274 resets = <&sysrst K210_RST_UART3>;
275 reg-io-width = <4>;
276 reg-shift = <2>;
277 dcd-override;
278 dsr-override;
279 cts-override;
280 ri-override;
281 status = "disabled";
282 };
283
284 spi2: spi@50240000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000285 compatible = "canaan,k210-spi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400286 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400287 "snps,dw-apb-ssi";
288 spi-slave;
289 reg = <0x50240000 0x100>;
290 interrupts = <2>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000291 clocks = <&sysclk K210_CLK_SPI2>,
292 <&sysclk K210_CLK_APB0>;
293 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400294 resets = <&sysrst K210_RST_SPI2>;
295 spi-max-frequency = <25000000>;
296 status = "disabled";
297 };
298
299 i2s0: i2s@50250000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000300 compatible = "canaan,k210-i2s",
Sean Andersond11b5822020-06-24 06:41:23 -0400301 "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 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000311 compatible = "canaan,k210-apu";
Sean Andersond11b5822020-06-24 06:41:23 -0400312 reg = <0x50250200 0x200>;
313 status = "disabled";
314 };
315
316 i2s1: i2s@50260000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000317 compatible = "canaan,k210-i2s",
Sean Andersond11b5822020-06-24 06:41:23 -0400318 "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 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000328 compatible = "canaan,k210-i2s",
Sean Andersond11b5822020-06-24 06:41:23 -0400329 "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 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000339 compatible = "canaan,k210-i2c",
Sean Andersond11b5822020-06-24 06:41:23 -0400340 "snps,designware-i2c";
341 reg = <0x50280000 0x100>;
342 interrupts = <8>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000343 clocks = <&sysclk K210_CLK_I2C0>,
344 <&sysclk K210_CLK_APB0>;
345 clock-names = "ref", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400346 resets = <&sysrst K210_RST_I2C0>;
347 status = "disabled";
348 };
349
350 i2c1: i2c@50290000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000351 compatible = "canaan,k210-i2c",
Sean Andersond11b5822020-06-24 06:41:23 -0400352 "snps,designware-i2c";
353 reg = <0x50290000 0x100>;
354 interrupts = <9>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000355 clocks = <&sysclk K210_CLK_I2C1>,
356 <&sysclk K210_CLK_APB0>;
357 clock-names = "ref", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400358 resets = <&sysrst K210_RST_I2C1>;
359 status = "disabled";
360 };
361
362 i2c2: i2c@502A0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000363 compatible = "canaan,k210-i2c",
Sean Andersond11b5822020-06-24 06:41:23 -0400364 "snps,designware-i2c";
365 reg = <0x502A0000 0x100>;
366 interrupts = <10>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000367 clocks = <&sysclk K210_CLK_I2C2>,
368 <&sysclk K210_CLK_APB0>;
369 clock-names = "ref", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400370 resets = <&sysrst K210_RST_I2C2>;
371 status = "disabled";
372 };
373
374 fpioa: pinmux@502B0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000375 compatible = "canaan,k210-fpioa";
Sean Andersond11b5822020-06-24 06:41:23 -0400376 reg = <0x502B0000 0x100>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000377 clocks = <&sysclk K210_CLK_FPIOA>,
378 <&sysclk K210_CLK_APB0>;
379 clock-names = "ref", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400380 resets = <&sysrst K210_RST_FPIOA>;
Damien Le Moalb2c0bb42022-03-01 10:35:41 +0000381 canaan,k210-sysctl-power = <&sysctl K210_SYSCTL_POWER_SEL>;
Sean Anderson68705562020-09-14 11:02:04 -0400382 pinctrl-0 = <&fpioa_jtag>;
383 pinctrl-names = "default";
Sean Andersond11b5822020-06-24 06:41:23 -0400384 status = "disabled";
Sean Anderson68705562020-09-14 11:02:04 -0400385
386 fpioa_jtag: jtag {
387 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
388 <K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
389 <K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
390 <K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
391 };
Sean Andersond11b5822020-06-24 06:41:23 -0400392 };
393
394 sha256: sha256@502C0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000395 compatible = "canaan,k210-sha256";
Sean Andersond11b5822020-06-24 06:41:23 -0400396 reg = <0x502C0000 0x100>;
397 clocks = <&sysclk K210_CLK_SHA>;
398 resets = <&sysrst K210_RST_SHA>;
399 status = "disabled";
400 };
401
402 timer0: timer@502D0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000403 compatible = "canaan,k210-timer",
Sean Andersond11b5822020-06-24 06:41:23 -0400404 "snps,dw-apb-timer";
405 reg = <0x502D0000 0x100>;
406 interrupts = <14 15>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000407 clocks = <&sysclk K210_CLK_TIMER0>,
408 <&sysclk K210_CLK_APB0>;
409 clock-names = "timer", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400410 resets = <&sysrst K210_RST_TIMER0>;
411 status = "disabled";
412 };
413
414 timer1: timer@502E0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000415 compatible = "canaan,k210-timer",
Sean Andersond11b5822020-06-24 06:41:23 -0400416 "snps,dw-apb-timer";
417 reg = <0x502E0000 0x100>;
418 interrupts = <16 17>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000419 clocks = <&sysclk K210_CLK_TIMER1>,
420 <&sysclk K210_CLK_APB0>;
421 clock-names = "timer", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400422 resets = <&sysrst K210_RST_TIMER1>;
423 status = "disabled";
424 };
425
426 timer2: timer@502F0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000427 compatible = "canaan,k210-timer",
Sean Andersond11b5822020-06-24 06:41:23 -0400428 "snps,dw-apb-timer";
429 reg = <0x502F0000 0x100>;
430 interrupts = <18 19>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000431 clocks = <&sysclk K210_CLK_TIMER2>,
432 <&sysclk K210_CLK_APB0>;
433 clock-names = "timer", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400434 resets = <&sysrst K210_RST_TIMER2>;
435 status = "disabled";
436 };
437 };
438
439 apb1: bus@50400000 {
440 #address-cells = <1>;
441 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000442 compatible = "canaan,k210-apb", "simple-pm-bus";
Sean Andersond11b5822020-06-24 06:41:23 -0400443 ranges;
444 clocks = <&sysclk K210_CLK_APB1>;
445
446 wdt0: watchdog@50400000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000447 compatible = "canaan,k210-wdt", "snps,dw-wdt";
Sean Andersond11b5822020-06-24 06:41:23 -0400448 reg = <0x50400000 0x100>;
449 interrupts = <21>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000450 clocks = <&sysclk K210_CLK_WDT0>,
451 <&sysclk K210_CLK_APB1>;
452 clock-names = "tclk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400453 resets = <&sysrst K210_RST_WDT0>;
Sean Andersond11b5822020-06-24 06:41:23 -0400454 };
455
456 wdt1: watchdog@50410000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000457 compatible = "canaan,k210-wdt", "snps,dw-wdt";
Sean Andersond11b5822020-06-24 06:41:23 -0400458 reg = <0x50410000 0x100>;
459 interrupts = <22>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000460 clocks = <&sysclk K210_CLK_WDT1>,
461 <&sysclk K210_CLK_APB1>;
462 clock-names = "tclk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400463 resets = <&sysrst K210_RST_WDT1>;
464 status = "disabled";
465 };
466
467 otp0: nvmem@50420000 {
468 #address-cells = <1>;
469 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000470 compatible = "canaan,k210-otp";
Sean Andersond11b5822020-06-24 06:41:23 -0400471 reg = <0x50420000 0x100>,
472 <0x88000000 0x20000>;
473 reg-names = "reg", "mem";
474 clocks = <&sysclk K210_CLK_ROM>;
475 resets = <&sysrst K210_RST_ROM>;
476 read-only;
477 status = "disabled";
478
479 /* Bootloader */
480 firmware@00000 {
481 reg = <0x00000 0xC200>;
482 };
483
484 /*
485 * config string as described in RISC-V
486 * privileged spec 1.9
487 */
488 config-1-9@1c000 {
489 reg = <0x1C000 0x1000>;
490 };
491
492 /*
493 * Device tree containing only registers,
494 * interrupts, and cpus
495 */
496 fdt@1d000 {
497 reg = <0x1D000 0x2000>;
498 };
499
500 /* CPU/ROM credits */
501 credits@1f000 {
502 reg = <0x1F000 0x1000>;
503 };
504 };
505
506 dvp0: camera@50430000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000507 compatible = "canaan,k210-dvp";
Sean Andersond11b5822020-06-24 06:41:23 -0400508 reg = <0x50430000 0x100>;
509 interrupts = <24>;
510 clocks = <&sysclk K210_CLK_DVP>;
511 resets = <&sysrst K210_RST_DVP>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000512 canaan,k210-sysctl = <&sysctl>;
513 canaan,k210-misc-offset = <K210_SYSCTL_MISC>;
Sean Andersond11b5822020-06-24 06:41:23 -0400514 status = "disabled";
515 };
516
517 sysctl: syscon@50440000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000518 compatible = "canaan,k210-sysctl",
Sean Andersond11b5822020-06-24 06:41:23 -0400519 "syscon", "simple-mfd";
520 reg = <0x50440000 0x100>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000521 clocks = <&sysclk K210_CLK_APB1>;
522 clock-names = "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400523 reg-io-width = <4>;
Sean Andersone8d9e3a2021-04-08 22:13:09 -0400524 u-boot,dm-pre-reloc;
Sean Andersond11b5822020-06-24 06:41:23 -0400525
526 sysclk: clock-controller {
527 #clock-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000528 compatible = "canaan,k210-clk";
Sean Andersond11b5822020-06-24 06:41:23 -0400529 clocks = <&in0>;
Sean Andersone6638b42021-06-11 00:16:15 -0400530 assigned-clocks = <&sysclk K210_CLK_PLL1>;
531 assigned-clock-rates = <390000000>;
Sean Andersone8d9e3a2021-04-08 22:13:09 -0400532 u-boot,dm-pre-reloc;
Sean Andersond11b5822020-06-24 06:41:23 -0400533 };
534
535 sysrst: reset-controller {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000536 compatible = "canaan,k210-rst",
Sean Andersond11b5822020-06-24 06:41:23 -0400537 "syscon-reset";
538 #reset-cells = <1>;
539 regmap = <&sysctl>;
540 offset = <K210_SYSCTL_PERI_RESET>;
541 mask = <0x27FFFFFF>;
542 assert-high = <1>;
543 };
544
545 reboot {
546 compatible = "syscon-reboot";
547 regmap = <&sysctl>;
548 offset = <K210_SYSCTL_SOFT_RESET>;
549 mask = <1>;
550 value = <1>;
551 };
552 };
553
554 aes0: aes@50450000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000555 compatible = "canaan,k210-aes";
Sean Andersond11b5822020-06-24 06:41:23 -0400556 reg = <0x50450000 0x100>;
557 clocks = <&sysclk K210_CLK_AES>;
558 resets = <&sysrst K210_RST_AES>;
559 status = "disabled";
560 };
561
562 rtc: rtc@50460000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000563 compatible = "canaan,k210-rtc";
Sean Andersond11b5822020-06-24 06:41:23 -0400564 reg = <0x50460000 0x100>;
565 clocks = <&in0>;
566 resets = <&sysrst K210_RST_RTC>;
567 interrupts = <20>;
568 status = "disabled";
569 };
570 };
571
572 apb2: bus@52000000 {
573 #address-cells = <1>;
574 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000575 compatible = "canaan,k210-apb", "simple-pm-bus";
Sean Andersond11b5822020-06-24 06:41:23 -0400576 ranges;
577 clocks = <&sysclk K210_CLK_APB2>;
578
579 spi0: spi@52000000 {
580 #address-cells = <1>;
581 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000582 compatible = "canaan,k210-spi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400583 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400584 "snps,dw-apb-ssi";
585 reg = <0x52000000 0x100>;
586 interrupts = <1>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000587 clocks = <&sysclk K210_CLK_SPI0>,
588 <&sysclk K210_CLK_APB2>;
589 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400590 resets = <&sysrst K210_RST_SPI0>;
591 spi-max-frequency = <25000000>;
592 num-cs = <4>;
593 reg-io-width = <4>;
594 status = "disabled";
595 };
596
597 spi1: spi@53000000 {
598 #address-cells = <1>;
599 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000600 compatible = "canaan,k210-spi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400601 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400602 "snps,dw-apb-ssi";
603 reg = <0x53000000 0x100>;
604 interrupts = <2>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000605 clocks = <&sysclk K210_CLK_SPI1>,
606 <&sysclk K210_CLK_APB2>;
607 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400608 resets = <&sysrst K210_RST_SPI1>;
609 spi-max-frequency = <25000000>;
610 num-cs = <4>;
611 reg-io-width = <4>;
612 status = "disabled";
613 };
614
615 spi3: spi@54000000 {
616 #address-cells = <1>;
617 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000618 compatible = "canaan,k210-ssi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400619 "snps,dwc-ssi-1.01a";
Sean Andersond11b5822020-06-24 06:41:23 -0400620 reg = <0x54000000 0x200>;
621 interrupts = <4>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000622 clocks = <&sysclk K210_CLK_SPI3>,
623 <&sysclk K210_CLK_APB2>;
624 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400625 resets = <&sysrst K210_RST_SPI3>;
626 /* Could possibly go up to 200 MHz */
627 spi-max-frequency = <100000000>;
628 num-cs = <4>;
629 reg-io-width = <4>;
630 status = "disabled";
631 };
632 };
633 };
634};