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
46 - const: sifive,rocket0
48 - const: riscv # Simulator only
50 Identifies that the hart uses the RISC-V instruction set
51 and identifies the type of the hart.
55 Identifies the MMU address translation mode used on this
56 hart. These values originate from the RISC-V Privileged
57 Specification document, available from
58 https://riscv.org/specifications/
59 $ref: "/schemas/types.yaml#/definitions/string"
68 Identifies the specific RISC-V instruction set architecture
69 supported by the hart. These are documented in the RISC-V
70 User-Level ISA document, available from
71 https://riscv.org/specifications/
73 While the isa strings in ISA specification are case
74 insensitive, letters in the riscv,isa string must be all
75 lowercase to simplify parsing.
76 $ref: "/schemas/types.yaml#/definitions/string"
81 # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
82 timebase-frequency: false
86 description: Describes the CPU's local interrupt controller
95 interrupt-controller: true
100 - interrupt-controller
103 $ref: '/schemas/types.yaml#/definitions/phandle-array'
107 List of phandles to idle state nodes supported
108 by this hart (see ./idle-states.yaml).
112 - interrupt-controller
114 additionalProperties: true
118 // Example 1: SiFive Freedom U540G Development Kit
120 #address-cells = <1>;
122 timebase-frequency = <1000000>;
124 clock-frequency = <0>;
125 compatible = "sifive,rocket0", "riscv";
127 i-cache-block-size = <64>;
128 i-cache-sets = <128>;
129 i-cache-size = <16384>;
131 riscv,isa = "rv64imac";
132 cpu_intc0: interrupt-controller {
133 #interrupt-cells = <1>;
134 compatible = "riscv,cpu-intc";
135 interrupt-controller;
139 clock-frequency = <0>;
140 compatible = "sifive,rocket0", "riscv";
141 d-cache-block-size = <64>;
143 d-cache-size = <32768>;
147 i-cache-block-size = <64>;
149 i-cache-size = <32768>;
152 mmu-type = "riscv,sv39";
154 riscv,isa = "rv64imafdc";
156 cpu_intc1: interrupt-controller {
157 #interrupt-cells = <1>;
158 compatible = "riscv,cpu-intc";
159 interrupt-controller;
165 // Example 2: Spike ISA Simulator with 1 Hart
167 #address-cells = <1>;
172 compatible = "riscv";
173 riscv,isa = "rv64imafdc";
174 mmu-type = "riscv,sv48";
175 interrupt-controller {
176 #interrupt-cells = <1>;
177 interrupt-controller;
178 compatible = "riscv,cpu-intc";