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#
7 title: RISC-V bindings for 'cpus' DT nodes
10 - Paul Walmsley <paul.walmsley@sifive.com>
11 - Palmer Dabbelt <palmer@sifive.com>
14 This document uses some terminology common to the RISC-V community
15 that is not widely used, the definitions of which are listed here:
17 hart: A hardware execution context, which contains all the state
18 mandated by the RISC-V ISA: a PC and some registers. This
19 terminology is designed to disambiguate software's view of execution
20 contexts from any particular microarchitectural implementation
21 strategy. For example, an Intel laptop containing one socket with
22 two cores, each of which has two hyperthreads, could be described as
44 - const: riscv # Simulator only
46 Identifies that the hart uses the RISC-V instruction set
47 and identifies the type of the hart.
51 Identifies the MMU address translation mode used on this
52 hart. These values originate from the RISC-V Privileged
53 Specification document, available from
54 https://riscv.org/specifications/
55 $ref: "/schemas/types.yaml#/definitions/string"
64 Identifies the specific RISC-V instruction set architecture
65 supported by the hart. These are documented in the RISC-V
66 User-Level ISA document, available from
67 https://riscv.org/specifications/
69 While the isa strings in ISA specification are case
70 insensitive, letters in the riscv,isa string must be all
71 lowercase to simplify parsing.
72 $ref: "/schemas/types.yaml#/definitions/string"
77 # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
78 timebase-frequency: false
82 description: Describes the CPU's local interrupt controller
91 interrupt-controller: true
96 - interrupt-controller
100 - interrupt-controller
102 additionalProperties: true
106 // Example 1: SiFive Freedom U540G Development Kit
108 #address-cells = <1>;
110 timebase-frequency = <1000000>;
112 clock-frequency = <0>;
113 compatible = "sifive,rocket0", "riscv";
115 i-cache-block-size = <64>;
116 i-cache-sets = <128>;
117 i-cache-size = <16384>;
119 riscv,isa = "rv64imac";
120 cpu_intc0: interrupt-controller {
121 #interrupt-cells = <1>;
122 compatible = "riscv,cpu-intc";
123 interrupt-controller;
127 clock-frequency = <0>;
128 compatible = "sifive,rocket0", "riscv";
129 d-cache-block-size = <64>;
131 d-cache-size = <32768>;
135 i-cache-block-size = <64>;
137 i-cache-size = <32768>;
140 mmu-type = "riscv,sv39";
142 riscv,isa = "rv64imafdc";
144 cpu_intc1: interrupt-controller {
145 #interrupt-cells = <1>;
146 compatible = "riscv,cpu-intc";
147 interrupt-controller;
153 // Example 2: Spike ISA Simulator with 1 Hart
155 #address-cells = <1>;
160 compatible = "riscv";
161 riscv,isa = "rv64imafdc";
162 mmu-type = "riscv,sv48";
163 interrupt-controller {
164 #interrupt-cells = <1>;
165 interrupt-controller;
166 compatible = "riscv,cpu-intc";