blob: 5c88c8ea8ea2cfcb2afd13ff8ea05a6e0f3cb1d4 [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;
137 interrupts-extended = <&cpu0_intc 9>, <&cpu0_intc 11>,
138 <&cpu1_intc 9>, <&cpu1_intc 11>;
139 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 Moal6e5a8b72022-03-01 10:35:39 +0000381 canaan,k210-sysctl = <&sysctl>;
382 canaan,k210-power-offset = <K210_SYSCTL_POWER_SEL>;
Sean Anderson68705562020-09-14 11:02:04 -0400383 pinctrl-0 = <&fpioa_jtag>;
384 pinctrl-names = "default";
Sean Andersond11b5822020-06-24 06:41:23 -0400385 status = "disabled";
Sean Anderson68705562020-09-14 11:02:04 -0400386
387 fpioa_jtag: jtag {
388 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
389 <K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
390 <K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
391 <K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
392 };
Sean Andersond11b5822020-06-24 06:41:23 -0400393 };
394
395 sha256: sha256@502C0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000396 compatible = "canaan,k210-sha256";
Sean Andersond11b5822020-06-24 06:41:23 -0400397 reg = <0x502C0000 0x100>;
398 clocks = <&sysclk K210_CLK_SHA>;
399 resets = <&sysrst K210_RST_SHA>;
400 status = "disabled";
401 };
402
403 timer0: timer@502D0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000404 compatible = "canaan,k210-timer",
Sean Andersond11b5822020-06-24 06:41:23 -0400405 "snps,dw-apb-timer";
406 reg = <0x502D0000 0x100>;
407 interrupts = <14 15>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000408 clocks = <&sysclk K210_CLK_TIMER0>,
409 <&sysclk K210_CLK_APB0>;
410 clock-names = "timer", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400411 resets = <&sysrst K210_RST_TIMER0>;
412 status = "disabled";
413 };
414
415 timer1: timer@502E0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000416 compatible = "canaan,k210-timer",
Sean Andersond11b5822020-06-24 06:41:23 -0400417 "snps,dw-apb-timer";
418 reg = <0x502E0000 0x100>;
419 interrupts = <16 17>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000420 clocks = <&sysclk K210_CLK_TIMER1>,
421 <&sysclk K210_CLK_APB0>;
422 clock-names = "timer", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400423 resets = <&sysrst K210_RST_TIMER1>;
424 status = "disabled";
425 };
426
427 timer2: timer@502F0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000428 compatible = "canaan,k210-timer",
Sean Andersond11b5822020-06-24 06:41:23 -0400429 "snps,dw-apb-timer";
430 reg = <0x502F0000 0x100>;
431 interrupts = <18 19>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000432 clocks = <&sysclk K210_CLK_TIMER2>,
433 <&sysclk K210_CLK_APB0>;
434 clock-names = "timer", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400435 resets = <&sysrst K210_RST_TIMER2>;
436 status = "disabled";
437 };
438 };
439
440 apb1: bus@50400000 {
441 #address-cells = <1>;
442 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000443 compatible = "canaan,k210-apb", "simple-pm-bus";
Sean Andersond11b5822020-06-24 06:41:23 -0400444 ranges;
445 clocks = <&sysclk K210_CLK_APB1>;
446
447 wdt0: watchdog@50400000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000448 compatible = "canaan,k210-wdt", "snps,dw-wdt";
Sean Andersond11b5822020-06-24 06:41:23 -0400449 reg = <0x50400000 0x100>;
450 interrupts = <21>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000451 clocks = <&sysclk K210_CLK_WDT0>,
452 <&sysclk K210_CLK_APB1>;
453 clock-names = "tclk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400454 resets = <&sysrst K210_RST_WDT0>;
Sean Andersond11b5822020-06-24 06:41:23 -0400455 };
456
457 wdt1: watchdog@50410000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000458 compatible = "canaan,k210-wdt", "snps,dw-wdt";
Sean Andersond11b5822020-06-24 06:41:23 -0400459 reg = <0x50410000 0x100>;
460 interrupts = <22>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000461 clocks = <&sysclk K210_CLK_WDT1>,
462 <&sysclk K210_CLK_APB1>;
463 clock-names = "tclk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400464 resets = <&sysrst K210_RST_WDT1>;
465 status = "disabled";
466 };
467
468 otp0: nvmem@50420000 {
469 #address-cells = <1>;
470 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000471 compatible = "canaan,k210-otp";
Sean Andersond11b5822020-06-24 06:41:23 -0400472 reg = <0x50420000 0x100>,
473 <0x88000000 0x20000>;
474 reg-names = "reg", "mem";
475 clocks = <&sysclk K210_CLK_ROM>;
476 resets = <&sysrst K210_RST_ROM>;
477 read-only;
478 status = "disabled";
479
480 /* Bootloader */
481 firmware@00000 {
482 reg = <0x00000 0xC200>;
483 };
484
485 /*
486 * config string as described in RISC-V
487 * privileged spec 1.9
488 */
489 config-1-9@1c000 {
490 reg = <0x1C000 0x1000>;
491 };
492
493 /*
494 * Device tree containing only registers,
495 * interrupts, and cpus
496 */
497 fdt@1d000 {
498 reg = <0x1D000 0x2000>;
499 };
500
501 /* CPU/ROM credits */
502 credits@1f000 {
503 reg = <0x1F000 0x1000>;
504 };
505 };
506
507 dvp0: camera@50430000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000508 compatible = "canaan,k210-dvp";
Sean Andersond11b5822020-06-24 06:41:23 -0400509 reg = <0x50430000 0x100>;
510 interrupts = <24>;
511 clocks = <&sysclk K210_CLK_DVP>;
512 resets = <&sysrst K210_RST_DVP>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000513 canaan,k210-sysctl = <&sysctl>;
514 canaan,k210-misc-offset = <K210_SYSCTL_MISC>;
Sean Andersond11b5822020-06-24 06:41:23 -0400515 status = "disabled";
516 };
517
518 sysctl: syscon@50440000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000519 compatible = "canaan,k210-sysctl",
Sean Andersond11b5822020-06-24 06:41:23 -0400520 "syscon", "simple-mfd";
521 reg = <0x50440000 0x100>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000522 clocks = <&sysclk K210_CLK_APB1>;
523 clock-names = "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400524 reg-io-width = <4>;
Sean Andersone8d9e3a2021-04-08 22:13:09 -0400525 u-boot,dm-pre-reloc;
Sean Andersond11b5822020-06-24 06:41:23 -0400526
527 sysclk: clock-controller {
528 #clock-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000529 compatible = "canaan,k210-clk";
Sean Andersond11b5822020-06-24 06:41:23 -0400530 clocks = <&in0>;
Sean Andersone6638b42021-06-11 00:16:15 -0400531 assigned-clocks = <&sysclk K210_CLK_PLL1>;
532 assigned-clock-rates = <390000000>;
Sean Andersone8d9e3a2021-04-08 22:13:09 -0400533 u-boot,dm-pre-reloc;
Sean Andersond11b5822020-06-24 06:41:23 -0400534 };
535
536 sysrst: reset-controller {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000537 compatible = "canaan,k210-rst",
Sean Andersond11b5822020-06-24 06:41:23 -0400538 "syscon-reset";
539 #reset-cells = <1>;
540 regmap = <&sysctl>;
541 offset = <K210_SYSCTL_PERI_RESET>;
542 mask = <0x27FFFFFF>;
543 assert-high = <1>;
544 };
545
546 reboot {
547 compatible = "syscon-reboot";
548 regmap = <&sysctl>;
549 offset = <K210_SYSCTL_SOFT_RESET>;
550 mask = <1>;
551 value = <1>;
552 };
553 };
554
555 aes0: aes@50450000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000556 compatible = "canaan,k210-aes";
Sean Andersond11b5822020-06-24 06:41:23 -0400557 reg = <0x50450000 0x100>;
558 clocks = <&sysclk K210_CLK_AES>;
559 resets = <&sysrst K210_RST_AES>;
560 status = "disabled";
561 };
562
563 rtc: rtc@50460000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000564 compatible = "canaan,k210-rtc";
Sean Andersond11b5822020-06-24 06:41:23 -0400565 reg = <0x50460000 0x100>;
566 clocks = <&in0>;
567 resets = <&sysrst K210_RST_RTC>;
568 interrupts = <20>;
569 status = "disabled";
570 };
571 };
572
573 apb2: bus@52000000 {
574 #address-cells = <1>;
575 #size-cells = <1>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000576 compatible = "canaan,k210-apb", "simple-pm-bus";
Sean Andersond11b5822020-06-24 06:41:23 -0400577 ranges;
578 clocks = <&sysclk K210_CLK_APB2>;
579
580 spi0: spi@52000000 {
581 #address-cells = <1>;
582 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000583 compatible = "canaan,k210-spi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400584 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400585 "snps,dw-apb-ssi";
586 reg = <0x52000000 0x100>;
587 interrupts = <1>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000588 clocks = <&sysclk K210_CLK_SPI0>,
589 <&sysclk K210_CLK_APB2>;
590 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400591 resets = <&sysrst K210_RST_SPI0>;
592 spi-max-frequency = <25000000>;
593 num-cs = <4>;
594 reg-io-width = <4>;
595 status = "disabled";
596 };
597
598 spi1: spi@53000000 {
599 #address-cells = <1>;
600 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000601 compatible = "canaan,k210-spi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400602 "snps,dw-apb-ssi-4.01",
Sean Andersond11b5822020-06-24 06:41:23 -0400603 "snps,dw-apb-ssi";
604 reg = <0x53000000 0x100>;
605 interrupts = <2>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000606 clocks = <&sysclk K210_CLK_SPI1>,
607 <&sysclk K210_CLK_APB2>;
608 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400609 resets = <&sysrst K210_RST_SPI1>;
610 spi-max-frequency = <25000000>;
611 num-cs = <4>;
612 reg-io-width = <4>;
613 status = "disabled";
614 };
615
616 spi3: spi@54000000 {
617 #address-cells = <1>;
618 #size-cells = <0>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +0000619 compatible = "canaan,k210-ssi",
Sean Andersonfd9571a2020-10-16 18:57:50 -0400620 "snps,dwc-ssi-1.01a";
Sean Andersond11b5822020-06-24 06:41:23 -0400621 reg = <0x54000000 0x200>;
622 interrupts = <4>;
Damien Le Moal0a876d72022-03-01 10:35:40 +0000623 clocks = <&sysclk K210_CLK_SPI3>,
624 <&sysclk K210_CLK_APB2>;
625 clock-names = "ssi_clk", "pclk";
Sean Andersond11b5822020-06-24 06:41:23 -0400626 resets = <&sysrst K210_RST_SPI3>;
627 /* Could possibly go up to 200 MHz */
628 spi-max-frequency = <100000000>;
629 num-cs = <4>;
630 reg-io-width = <4>;
631 status = "disabled";
632 };
633 };
634 };
635};