summaryrefslogtreecommitdiffstats
path: root/bsps/riscv/riscv/dts/kendryte-k210.dts
blob: cad413dc81f3ffd23360a5620d95e1d4ae633a91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/* SPDX-License-Identifier: BSD-2-Clause */

/*
 * Copyright (C) Alan Cudmore
 * Copyright (C) Padmarao Begari
 * Copyright (C) 2022 Microchip Technology Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *	notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *	notice, this list of conditions and the following disclaimer in the
 *	documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

 /* This is a device tree for the Kendryte K210 SoC. It is a simplified tree
  * to support the current RTEMS BSP, but it is not sufficient enough for
  * full linux or u-boot support.
  * The file structure is based on the device tree source for the
  * Polarfire SoC created by Padmaro Begari. The K210 device trees from
  * u-boot were originally used to bring up the RTEMS BSP and were
  * referenced to develop this file.
  */

/dts-v1/;

/ {
        /* 32 bit address bus - upper 32 bits are ignored */
	#address-cells = <1>;
	#size-cells = <1>;

	model = "Kendtryte K210 generic";
	compatible = "canaan,kendryte-k210";

	aliases {
		serial0 = &uarths0;
		serial1 = &uart1;
		/* serial2 = &uart2; */
		/* serial3 = &uart3; */
	};

	chosen {
		stdout-path = "serial0";
	};

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		timebase-frequency = <7800000>;

		cpu0: cpu@0 {
			compatible = "canaan,k210", "riscv";
			device_type = "cpu";
			reg = <0>;
			riscv,isa = "rv64imafdc";
			i-cache-block-size = <64>;
			i-cache-size = <0x8000>;
			d-cache-block-size = <64>;
			d-cache-size = <0x8000>;
			cpu0_intc: interrupt-controller {
				#interrupt-cells = <1>;
				compatible = "riscv,cpu-intc";
				interrupt-controller;
			};
		};
		cpu1: cpu@1 {
			compatible = "canaan,k210", "riscv";
			device_type = "cpu";
			reg = <1>;
			riscv,isa = "rv64imafdc";
			i-cache-block-size = <64>;
			i-cache-size = <0x8000>;
			d-cache-block-size = <64>;
			d-cache-size = <0x8000>;
			cpu1_intc: interrupt-controller {
				#interrupt-cells = <1>;
				compatible = "riscv,cpu-intc";
				interrupt-controller;
			};
		};

	};

	clocks {
                in0: oscillator {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <26000000>;
		};
	};

	sram: memory@80000000 {
		device_type = "memory";
                compatible = "canaan,k210-sram";
		reg = <0x80000000 0x400000>,
		      <0x80400000 0x200000>,
		      <0x80600000 0x200000>;
                reg-names = "sram0",
                            "sram1",
                            "aisram";

	};

	soc: soc {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges;
                interrupt-parent = <&plic0>;

                rom0: nvmem@1000 {
                         reg = <0x1000 0x1000>;
                         read-only;
                };

		clint0: timer@2000000 {
			compatible = "riscv,clint0","sifive,clint0";
			reg = <0x2000000 0xC000>;
			interrupts-extended = <&cpu0_intc 3>,<&cpu0_intc 7>,
					      <&cpu1_intc 3>,<&cpu1_intc 7>;
		};

		plic0: interrupt-controller@c000000 {
			#interrupt-cells = <1>;
			#address-cells = <0>;
			compatible = "riscv,plic0","sifive,plic-1.0.0";
			reg = <0xC000000 0x4000000>;
			riscv,ndev = <65>;
			interrupt-controller;
			interrupts-extended =
				<&cpu0_intc 11>, <&cpu0_intc 9>,
				<&cpu1_intc 11>, <&cpu1_intc 9>;
		};

		uarths0: serial@38000000 {
			compatible = "canaan,k210-uarths","sifive,uart0";
			reg = <0x38000000 0x1000>;
			interrupts = <33>;
			clocks = <&sysclk 0>;

		};

                /* apb0 has gpio1 and additional uarts */
		apb0: bus@50200000 {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "simple-pm-bus";
			ranges;
			clocks = <&sysclk 8>;

			uart1: serial@50210000 {
				compatible = "snps,dw-apb-uart";
				reg = <0x50210000 0x100>;
				interrupts = <11>;
				clocks = <&sysclk 30>,
					 <&sysclk 8>;
				clock-namees = "baudclk", "abp_pclk";
				resets = <&sysrst 16>;
				reg-io-width = <4>;
				reg-shift = <2>;
				dcd-override;
				dsr-override;
				cts-override;
				ri-override;
			};
                };

                apb1: bus@50400000 {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "simple-pm-bus";
			ranges;
			clocks = <&sysclk 9>;

			sysctl: syscon@50440000 {
				compatible = "canaan,k210-sysctl","syscon",
				             "simple-mfd";
				reg = <0x50440000 0x100>;
				clocks = <&sysclk 9>;
				clock-names = "pclk";
				sysclk: clock-controller {
					#clock-cells = <1>;
					compatible = "canaan,k210-rst";
					clock = <&in0>;
				};
				sysrst: reset-coontroller {
					compatible = "canaan,k210-rst";
					#reset-cells = <1>;
				};
				reboot: syscon-reboot {
					compatible = "syscon-reboot";
					regmap = <&sysctl>;
					offset = <48>;
					mask = <1>;
					value = <1>;
				};
			};
		};

	};
};