source: rtems/bsps/riscv/riscv/dts/kendryte-k210.dts @ ca1c4e70

Last change on this file since ca1c4e70 was ca1c4e70, checked in by Alan Cudmore <alan.cudmore@…>, on 03/15/23 at 13:39:20

bsps/riscv: add device tree source and device tree blob header for k210 bsp variant

This patch adds the k210 device tree source and the corresponding
device tree blob encoded in the header which is used for the
embedded device tree blob for the Kendryte K210 BSP variant.

Updates #4876

  • Property mode set to 100644
File size: 5.7 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * Copyright (C) Alan Cudmore
5 * Copyright (C) Padmarao Begari
6 * Copyright (C) 2022 Microchip Technology Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *      notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *      notice, this list of conditions and the following disclaimer in the
15 *      documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 /* This is a device tree for the Kendryte K210 SoC. It is a simplified tree
31  * to support the current RTEMS BSP, but it is not sufficient enough for
32  * full linux or u-boot support.
33  * The file structure is based on the device tree source for the
34  * Polarfire SoC created by Padmaro Begari. The K210 device trees from
35  * u-boot were originally used to bring up the RTEMS BSP and were
36  * referenced to develop this file.
37  */
38
39/dts-v1/;
40
41/ {
42        /* 32 bit address bus - upper 32 bits are ignored */
43        #address-cells = <1>;
44        #size-cells = <1>;
45
46        model = "Kendtryte K210 generic";
47        compatible = "canaan,kendryte-k210";
48
49        aliases {
50                serial0 = &uarths0;
51                serial1 = &uart1;
52                /* serial2 = &uart2; */
53                /* serial3 = &uart3; */
54        };
55
56        chosen {
57                stdout-path = "serial0";
58        };
59
60        cpus {
61                #address-cells = <1>;
62                #size-cells = <0>;
63
64                timebase-frequency = <7800000>;
65
66                cpu0: cpu@0 {
67                        compatible = "canaan,k210", "riscv";
68                        device_type = "cpu";
69                        reg = <0>;
70                        riscv,isa = "rv64imafdc";
71                        i-cache-block-size = <64>;
72                        i-cache-size = <0x8000>;
73                        d-cache-block-size = <64>;
74                        d-cache-size = <0x8000>;
75                        cpu0_intc: interrupt-controller {
76                                #interrupt-cells = <1>;
77                                compatible = "riscv,cpu-intc";
78                                interrupt-controller;
79                        };
80                };
81                cpu1: cpu@1 {
82                        compatible = "canaan,k210", "riscv";
83                        device_type = "cpu";
84                        reg = <1>;
85                        riscv,isa = "rv64imafdc";
86                        i-cache-block-size = <64>;
87                        i-cache-size = <0x8000>;
88                        d-cache-block-size = <64>;
89                        d-cache-size = <0x8000>;
90                        cpu1_intc: interrupt-controller {
91                                #interrupt-cells = <1>;
92                                compatible = "riscv,cpu-intc";
93                                interrupt-controller;
94                        };
95                };
96
97        };
98
99        clocks {
100                in0: oscillator {
101                        compatible = "fixed-clock";
102                        #clock-cells = <0>;
103                        clock-frequency = <26000000>;
104                };
105        };
106
107        sram: memory@80000000 {
108                device_type = "memory";
109                compatible = "canaan,k210-sram";
110                reg = <0x80000000 0x400000>,
111                      <0x80400000 0x200000>,
112                      <0x80600000 0x200000>;
113                reg-names = "sram0",
114                            "sram1",
115                            "aisram";
116
117        };
118
119        soc: soc {
120                #address-cells = <1>;
121                #size-cells = <1>;
122                compatible = "simple-bus";
123                ranges;
124                interrupt-parent = <&plic0>;
125
126                rom0: nvmem@1000 {
127                         reg = <0x1000 0x1000>;
128                         read-only;
129                };
130
131                clint0: timer@2000000 {
132                        compatible = "riscv,clint0","sifive,clint0";
133                        reg = <0x2000000 0xC000>;
134                        interrupts-extended = <&cpu0_intc 3>,<&cpu0_intc 7>,
135                                              <&cpu1_intc 3>,<&cpu1_intc 7>;
136                };
137
138                plic0: interrupt-controller@c000000 {
139                        #interrupt-cells = <1>;
140                        #address-cells = <0>;
141                        compatible = "riscv,plic0","sifive,plic-1.0.0";
142                        reg = <0xC000000 0x4000000>;
143                        riscv,ndev = <65>;
144                        interrupt-controller;
145                        interrupts-extended =
146                                <&cpu0_intc 11>, <&cpu0_intc 9>,
147                                <&cpu1_intc 11>, <&cpu1_intc 9>;
148                };
149
150                uarths0: serial@38000000 {
151                        compatible = "canaan,k210-uarths","sifive,uart0";
152                        reg = <0x38000000 0x1000>;
153                        interrupts = <33>;
154                        clocks = <&sysclk 0>;
155
156                };
157
158                /* apb0 has gpio1 and additional uarts */
159                apb0: bus@50200000 {
160                        #address-cells = <1>;
161                        #size-cells = <1>;
162                        compatible = "simple-pm-bus";
163                        ranges;
164                        clocks = <&sysclk 8>;
165
166                        uart1: serial@50210000 {
167                                compatible = "snps,dw-apb-uart";
168                                reg = <0x50210000 0x100>;
169                                interrupts = <11>;
170                                clocks = <&sysclk 30>,
171                                         <&sysclk 8>;
172                                clock-namees = "baudclk", "abp_pclk";
173                                resets = <&sysrst 16>;
174                                reg-io-width = <4>;
175                                reg-shift = <2>;
176                                dcd-override;
177                                dsr-override;
178                                cts-override;
179                                ri-override;
180                        };
181                };
182
183                apb1: bus@50400000 {
184                        #address-cells = <1>;
185                        #size-cells = <1>;
186                        compatible = "simple-pm-bus";
187                        ranges;
188                        clocks = <&sysclk 9>;
189
190                        sysctl: syscon@50440000 {
191                                compatible = "canaan,k210-sysctl","syscon",
192                                             "simple-mfd";
193                                reg = <0x50440000 0x100>;
194                                clocks = <&sysclk 9>;
195                                clock-names = "pclk";
196                                sysclk: clock-controller {
197                                        #clock-cells = <1>;
198                                        compatible = "canaan,k210-rst";
199                                        clock = <&in0>;
200                                };
201                                sysrst: reset-coontroller {
202                                        compatible = "canaan,k210-rst";
203                                        #reset-cells = <1>;
204                                };
205                                reboot: syscon-reboot {
206                                        compatible = "syscon-reboot";
207                                        regmap = <&sysctl>;
208                                        offset = <48>;
209                                        mask = <1>;
210                                        value = <1>;
211                                };
212                        };
213                };
214
215        };
216};
Note: See TracBrowser for help on using the repository browser.