1 # SPDX-License-Identifier: (GPL-2.0 OR MIT)
4 $id: http://devicetree.org/schemas/riscv/cpus.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Paul Walmsley <paul.walmsley@sifive.com>
11 - Palmer Dabbelt <palmer@sifive.com>
12 - Conor Dooley <conor@kernel.org>
15 This document uses some terminology common to the RISC-V community
16 that is not widely used, the definitions of which are listed here:
18 hart: A hardware execution context, which contains all the state
19 mandated by the RISC-V ISA: a PC and some registers. This
20 terminology is designed to disambiguate software's view of execution
21 contexts from any particular microarchitectural implementation
22 strategy. For example, an Intel laptop containing one socket with
23 two cores, each of which has two hyperthreads, could be described as
27 - $ref: /schemas/cpu.yaml#
28 - $ref: extensions.yaml
57 - const: sifive,rocket0
59 - const: riscv # Simulator only
61 Identifies that the hart uses the RISC-V instruction set
62 and identifies the type of the hart.
66 Identifies the largest MMU address translation mode supported by
67 this hart. These values originate from the RISC-V Privileged
68 Specification document, available from
69 https://riscv.org/specifications/
70 $ref: /schemas/types.yaml#/definitions/string
80 The hart ID of this CPU node.
82 riscv,cbom-block-size:
83 $ref: /schemas/types.yaml#/definitions/uint32
85 The blocksize in bytes for the Zicbom cache operations.
87 riscv,cbop-block-size:
88 $ref: /schemas/types.yaml#/definitions/uint32
90 The blocksize in bytes for the Zicbop cache operations.
92 riscv,cboz-block-size:
93 $ref: /schemas/types.yaml#/definitions/uint32
95 The blocksize in bytes for the Zicboz cache operations.
97 # RISC-V has multiple properties for cache op block sizes as the sizes
98 # differ between individual CBO extensions
99 cache-op-block-size: false
100 # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
101 timebase-frequency: false
103 interrupt-controller:
105 additionalProperties: false
106 description: Describes the CPU's local interrupt controller
115 - const: andestech,cpu-intc
116 - const: riscv,cpu-intc
117 - const: riscv,cpu-intc
119 interrupt-controller: true
124 - interrupt-controller
127 $ref: /schemas/types.yaml#/definitions/phandle-array
131 List of phandles to idle state nodes supported
132 by this hart (see ./idle-states.yaml).
136 u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in
137 DMIPS/MHz, relative to highest capacity-dmips-mhz
147 riscv,isa-base: [ "riscv,isa-extensions" ]
148 riscv,isa-extensions: [ "riscv,isa-base" ]
151 - interrupt-controller
153 unevaluatedProperties: false
157 // Example 1: SiFive Freedom U540G Development Kit
159 #address-cells = <1>;
161 timebase-frequency = <1000000>;
163 clock-frequency = <0>;
164 compatible = "sifive,rocket0", "riscv";
166 i-cache-block-size = <64>;
167 i-cache-sets = <128>;
168 i-cache-size = <16384>;
170 riscv,isa-base = "rv64i";
171 riscv,isa-extensions = "i", "m", "a", "c";
173 cpu_intc0: interrupt-controller {
174 #interrupt-cells = <1>;
175 compatible = "riscv,cpu-intc";
176 interrupt-controller;
180 clock-frequency = <0>;
181 compatible = "sifive,rocket0", "riscv";
182 d-cache-block-size = <64>;
184 d-cache-size = <32768>;
188 i-cache-block-size = <64>;
190 i-cache-size = <32768>;
193 mmu-type = "riscv,sv39";
196 riscv,isa-base = "rv64i";
197 riscv,isa-extensions = "i", "m", "a", "f", "d", "c";
199 cpu_intc1: interrupt-controller {
200 #interrupt-cells = <1>;
201 compatible = "riscv,cpu-intc";
202 interrupt-controller;
208 // Example 2: Spike ISA Simulator with 1 Hart
210 #address-cells = <1>;
215 compatible = "riscv";
216 mmu-type = "riscv,sv48";
217 riscv,isa-base = "rv64i";
218 riscv,isa-extensions = "i", "m", "a", "f", "d", "c";
220 interrupt-controller {
221 #interrupt-cells = <1>;
222 interrupt-controller;
223 compatible = "riscv,cpu-intc";