Merge tag 'for-5.18/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[linux-2.6-block.git] / Documentation / devicetree / bindings / riscv / cpus.yaml
CommitLineData
4fd669a8
PW
1# SPDX-License-Identifier: (GPL-2.0 OR MIT)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/riscv/cpus.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: RISC-V bindings for 'cpus' DT nodes
8
9maintainers:
10 - Paul Walmsley <paul.walmsley@sifive.com>
11 - Palmer Dabbelt <palmer@sifive.com>
12
8e5e72e3
PW
13description: |
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:
16
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
23 having four harts.
24
4fd669a8 25properties:
7d9ef7f3 26 compatible:
9af865d9
RH
27 oneOf:
28 - items:
29 - enum:
30 - sifive,rocket0
75e6d724 31 - sifive,bullet0
9af865d9 32 - sifive,e5
75e6d724 33 - sifive,e7
75e6d724 34 - sifive,e71
75e6d724 35 - sifive,u74-mc
9af865d9 36 - sifive,u54
75e6d724 37 - sifive,u74
9af865d9 38 - sifive,u5
75e6d724 39 - sifive,u7
7ef71c71 40 - canaan,k210
9af865d9 41 - const: riscv
f46428f0
KK
42 - items:
43 - enum:
44 - sifive,e51
45 - sifive,u54-mc
46 - const: sifive,rocket0
47 - const: riscv
9af865d9 48 - const: riscv # Simulator only
7d9ef7f3
RH
49 description:
50 Identifies that the hart uses the RISC-V instruction set
51 and identifies the type of the hart.
52
53 mmu-type:
7d9ef7f3
RH
54 description:
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/
3d21a460
RH
59 $ref: "/schemas/types.yaml#/definitions/string"
60 enum:
61 - riscv,sv32
62 - riscv,sv39
63 - riscv,sv48
7ef71c71 64 - riscv,none
7d9ef7f3
RH
65
66 riscv,isa:
7d9ef7f3
RH
67 description:
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/
72
94ed3fde
AP
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.
3d21a460
RH
76 $ref: "/schemas/types.yaml#/definitions/string"
77 enum:
78 - rv64imac
79 - rv64imafdc
94ed3fde 80
9af865d9
RH
81 # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
82 timebase-frequency: false
7d9ef7f3
RH
83
84 interrupt-controller:
85 type: object
86 description: Describes the CPU's local interrupt controller
4fd669a8 87
4fd669a8 88 properties:
7d9ef7f3
RH
89 '#interrupt-cells':
90 const: 1
4fd669a8 91
7d9ef7f3
RH
92 compatible:
93 const: riscv,cpu-intc
4fd669a8 94
7d9ef7f3 95 interrupt-controller: true
4fd669a8
PW
96
97 required:
7d9ef7f3
RH
98 - '#interrupt-cells'
99 - compatible
4fd669a8
PW
100 - interrupt-controller
101
1bd524f7
AP
102 cpu-idle-states:
103 $ref: '/schemas/types.yaml#/definitions/phandle-array'
104 description: |
105 List of phandles to idle state nodes supported
106 by this hart (see ./idle-states.yaml).
107
7d9ef7f3
RH
108required:
109 - riscv,isa
7d9ef7f3
RH
110 - interrupt-controller
111
6a0e321e
RH
112additionalProperties: true
113
4fd669a8
PW
114examples:
115 - |
116 // Example 1: SiFive Freedom U540G Development Kit
117 cpus {
118 #address-cells = <1>;
119 #size-cells = <0>;
120 timebase-frequency = <1000000>;
121 cpu@0 {
122 clock-frequency = <0>;
123 compatible = "sifive,rocket0", "riscv";
124 device_type = "cpu";
125 i-cache-block-size = <64>;
126 i-cache-sets = <128>;
127 i-cache-size = <16384>;
128 reg = <0>;
129 riscv,isa = "rv64imac";
130 cpu_intc0: interrupt-controller {
131 #interrupt-cells = <1>;
132 compatible = "riscv,cpu-intc";
133 interrupt-controller;
134 };
135 };
136 cpu@1 {
137 clock-frequency = <0>;
138 compatible = "sifive,rocket0", "riscv";
139 d-cache-block-size = <64>;
140 d-cache-sets = <64>;
141 d-cache-size = <32768>;
142 d-tlb-sets = <1>;
143 d-tlb-size = <32>;
144 device_type = "cpu";
145 i-cache-block-size = <64>;
146 i-cache-sets = <64>;
147 i-cache-size = <32768>;
148 i-tlb-sets = <1>;
149 i-tlb-size = <32>;
150 mmu-type = "riscv,sv39";
151 reg = <1>;
152 riscv,isa = "rv64imafdc";
153 tlb-split;
154 cpu_intc1: interrupt-controller {
155 #interrupt-cells = <1>;
156 compatible = "riscv,cpu-intc";
157 interrupt-controller;
158 };
159 };
160 };
161
162 - |
163 // Example 2: Spike ISA Simulator with 1 Hart
164 cpus {
3cdb0157
PW
165 #address-cells = <1>;
166 #size-cells = <0>;
167 cpu@0 {
168 device_type = "cpu";
169 reg = <0>;
170 compatible = "riscv";
171 riscv,isa = "rv64imafdc";
172 mmu-type = "riscv,sv48";
173 interrupt-controller {
174 #interrupt-cells = <1>;
175 interrupt-controller;
176 compatible = "riscv,cpu-intc";
177 };
178 };
4fd669a8
PW
179 };
180...