5 The device tree allows to describe the layout of CPUs in a system through
6 the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
7 defining properties for every cpu.
9 Bindings for CPU nodes follow the Devicetree Specification, available from:
11 https://www.devicetree.org/specifications/
13 with updates for 32-bit and 64-bit RISC-V systems provided in this document.
19 This document uses some terminology common to the RISC-V community that is not
20 widely used, the definitions of which are listed here:
22 * hart: A hardware execution context, which contains all the state mandated by
23 the RISC-V ISA: a PC and some registers. This terminology is designed to
24 disambiguate software's view of execution contexts from any particular
25 microarchitectural implementation strategy. For example, my Intel laptop is
26 described as having one socket with two cores, each of which has two hyper
27 threads. Therefore this system has four harts.
29 =====================================
30 cpus and cpu node bindings definition
31 =====================================
33 The RISC-V architecture, in accordance with the Devicetree Specification,
34 requires the cpus and cpu nodes to be present and contain the properties
39 Description: Container of cpu nodes
41 The node name must be "cpus".
43 A cpus node must define the following properties:
48 Definition: must be set to 1
52 Definition: must be set to 0
56 Description: Describes a hart context
63 Definition: must be "cpu"
67 Definition: The hart ID of this CPU node
70 Value type: <stringlist>
71 Definition: must contain "riscv", may contain one of
76 Definition: Specifies the CPU's MMU type. Possible values are
83 Definition: Contains the RISC-V ISA string of this hart. These
84 ISA strings are defined by the RISC-V ISA manual.
86 Example: SiFive Freedom U540G Development Kit
87 ---------------------------------------------
89 This system contains two harts: a hart marked as disabled that's used for
90 low-level system tasks and should be ignored by Linux, and a second hart that
91 Linux is allowed to run on.
96 timebase-frequency = <1000000>;
98 clock-frequency = <1600000000>;
99 compatible = "sifive,rocket0", "riscv";
101 i-cache-block-size = <64>;
102 i-cache-sets = <128>;
103 i-cache-size = <16384>;
104 next-level-cache = <&L15 &L0>;
106 riscv,isa = "rv64imac";
108 L10: interrupt-controller {
109 #interrupt-cells = <1>;
110 compatible = "riscv,cpu-intc";
111 interrupt-controller;
115 clock-frequency = <1600000000>;
116 compatible = "sifive,rocket0", "riscv";
117 d-cache-block-size = <64>;
119 d-cache-size = <32768>;
123 i-cache-block-size = <64>;
125 i-cache-size = <32768>;
128 mmu-type = "riscv,sv39";
129 next-level-cache = <&L15 &L0>;
131 riscv,isa = "rv64imafdc";
134 L13: interrupt-controller {
135 #interrupt-cells = <1>;
136 compatible = "riscv,cpu-intc";
137 interrupt-controller;
142 Example: Spike ISA Simulator with 1 Hart
143 ----------------------------------------
145 This device tree matches the Spike ISA golden model as run with `spike -p1`.
152 compatible = "riscv";
153 riscv,isa = "rv64imafdc";
154 mmu-type = "riscv,sv48";
155 clock-frequency = <0x3b9aca00>;
156 interrupt-controller {
157 #interrupt-cells = <0x00000001>;
158 interrupt-controller;
159 compatible = "riscv,cpu-intc";