1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR MIT) 2c66ec88fSEmmanuel Vadot%YAML 1.2 3c66ec88fSEmmanuel Vadot--- 4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/riscv/cpus.yaml# 5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c66ec88fSEmmanuel Vadot 78bab661aSEmmanuel Vadottitle: RISC-V CPUs 8c66ec88fSEmmanuel Vadot 9c66ec88fSEmmanuel Vadotmaintainers: 10c66ec88fSEmmanuel Vadot - Paul Walmsley <paul.walmsley@sifive.com> 11c66ec88fSEmmanuel Vadot - Palmer Dabbelt <palmer@sifive.com> 127ef62cebSEmmanuel Vadot - Conor Dooley <conor@kernel.org> 13c66ec88fSEmmanuel Vadot 14c66ec88fSEmmanuel Vadotdescription: | 15c66ec88fSEmmanuel Vadot This document uses some terminology common to the RISC-V community 16c66ec88fSEmmanuel Vadot that is not widely used, the definitions of which are listed here: 17c66ec88fSEmmanuel Vadot 18c66ec88fSEmmanuel Vadot hart: A hardware execution context, which contains all the state 19c66ec88fSEmmanuel Vadot mandated by the RISC-V ISA: a PC and some registers. This 20c66ec88fSEmmanuel Vadot terminology is designed to disambiguate software's view of execution 21c66ec88fSEmmanuel Vadot contexts from any particular microarchitectural implementation 22c66ec88fSEmmanuel Vadot strategy. For example, an Intel laptop containing one socket with 23c66ec88fSEmmanuel Vadot two cores, each of which has two hyperthreads, could be described as 24c66ec88fSEmmanuel Vadot having four harts. 25c66ec88fSEmmanuel Vadot 26f126890aSEmmanuel VadotallOf: 27f126890aSEmmanuel Vadot - $ref: /schemas/cpu.yaml# 28f126890aSEmmanuel Vadot - $ref: extensions.yaml 29f126890aSEmmanuel Vadot 30c66ec88fSEmmanuel Vadotproperties: 31c66ec88fSEmmanuel Vadot compatible: 32c66ec88fSEmmanuel Vadot oneOf: 33c66ec88fSEmmanuel Vadot - items: 34c66ec88fSEmmanuel Vadot - enum: 358d13bc63SEmmanuel Vadot - amd,mbv32 368bab661aSEmmanuel Vadot - andestech,ax45mp 378bab661aSEmmanuel Vadot - canaan,k210 385def4c47SEmmanuel Vadot - sifive,bullet0 39c66ec88fSEmmanuel Vadot - sifive,e5 405def4c47SEmmanuel Vadot - sifive,e7 415def4c47SEmmanuel Vadot - sifive,e71 428bab661aSEmmanuel Vadot - sifive,rocket0 43fac71e4eSEmmanuel Vadot - sifive,s7 44c66ec88fSEmmanuel Vadot - sifive,u5 458bab661aSEmmanuel Vadot - sifive,u54 465def4c47SEmmanuel Vadot - sifive,u7 478bab661aSEmmanuel Vadot - sifive,u74 488bab661aSEmmanuel Vadot - sifive,u74-mc 498bab661aSEmmanuel Vadot - thead,c906 50*0e8011faSEmmanuel Vadot - thead,c908 518bab661aSEmmanuel Vadot - thead,c910 5284943d6fSEmmanuel Vadot - thead,c920 53c66ec88fSEmmanuel Vadot - const: riscv 548cc087a1SEmmanuel Vadot - items: 558cc087a1SEmmanuel Vadot - enum: 568cc087a1SEmmanuel Vadot - sifive,e51 578cc087a1SEmmanuel Vadot - sifive,u54-mc 588cc087a1SEmmanuel Vadot - const: sifive,rocket0 598cc087a1SEmmanuel Vadot - const: riscv 60c66ec88fSEmmanuel Vadot - const: riscv # Simulator only 61c66ec88fSEmmanuel Vadot description: 62c66ec88fSEmmanuel Vadot Identifies that the hart uses the RISC-V instruction set 63c66ec88fSEmmanuel Vadot and identifies the type of the hart. 64c66ec88fSEmmanuel Vadot 65c66ec88fSEmmanuel Vadot mmu-type: 66c66ec88fSEmmanuel Vadot description: 678d13bc63SEmmanuel Vadot Identifies the largest MMU address translation mode supported by 688d13bc63SEmmanuel Vadot this hart. These values originate from the RISC-V Privileged 69c66ec88fSEmmanuel Vadot Specification document, available from 70c66ec88fSEmmanuel Vadot https://riscv.org/specifications/ 71f126890aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string 72c66ec88fSEmmanuel Vadot enum: 73c66ec88fSEmmanuel Vadot - riscv,sv32 74c66ec88fSEmmanuel Vadot - riscv,sv39 75c66ec88fSEmmanuel Vadot - riscv,sv48 76fac71e4eSEmmanuel Vadot - riscv,sv57 775def4c47SEmmanuel Vadot - riscv,none 78c66ec88fSEmmanuel Vadot 7901950c46SEmmanuel Vadot reg: 8001950c46SEmmanuel Vadot description: 8101950c46SEmmanuel Vadot The hart ID of this CPU node. 8201950c46SEmmanuel Vadot 83b97ee269SEmmanuel Vadot riscv,cbom-block-size: 84b97ee269SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 85b97ee269SEmmanuel Vadot description: 86b97ee269SEmmanuel Vadot The blocksize in bytes for the Zicbom cache operations. 87b97ee269SEmmanuel Vadot 888d13bc63SEmmanuel Vadot riscv,cbop-block-size: 898d13bc63SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 908d13bc63SEmmanuel Vadot description: 918d13bc63SEmmanuel Vadot The blocksize in bytes for the Zicbop cache operations. 928d13bc63SEmmanuel Vadot 93fac71e4eSEmmanuel Vadot riscv,cboz-block-size: 94fac71e4eSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 95fac71e4eSEmmanuel Vadot description: 96fac71e4eSEmmanuel Vadot The blocksize in bytes for the Zicboz cache operations. 97fac71e4eSEmmanuel Vadot 98f126890aSEmmanuel Vadot # RISC-V has multiple properties for cache op block sizes as the sizes 99f126890aSEmmanuel Vadot # differ between individual CBO extensions 100f126890aSEmmanuel Vadot cache-op-block-size: false 101c66ec88fSEmmanuel Vadot # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here 102c66ec88fSEmmanuel Vadot timebase-frequency: false 103c66ec88fSEmmanuel Vadot 104c66ec88fSEmmanuel Vadot interrupt-controller: 105c66ec88fSEmmanuel Vadot type: object 106*0e8011faSEmmanuel Vadot $ref: /schemas/interrupt-controller/riscv,cpu-intc.yaml# 107c66ec88fSEmmanuel Vadot 108c9ccf3a3SEmmanuel Vadot cpu-idle-states: 109f126890aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 110c9ccf3a3SEmmanuel Vadot items: 111c9ccf3a3SEmmanuel Vadot maxItems: 1 112c9ccf3a3SEmmanuel Vadot description: | 113c9ccf3a3SEmmanuel Vadot List of phandles to idle state nodes supported 114c9ccf3a3SEmmanuel Vadot by this hart (see ./idle-states.yaml). 115c9ccf3a3SEmmanuel Vadot 116cb7aa33aSEmmanuel Vadot capacity-dmips-mhz: 117cb7aa33aSEmmanuel Vadot description: 118cb7aa33aSEmmanuel Vadot u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in 119cb7aa33aSEmmanuel Vadot DMIPS/MHz, relative to highest capacity-dmips-mhz 120cb7aa33aSEmmanuel Vadot in the system. 121cb7aa33aSEmmanuel Vadot 122f126890aSEmmanuel VadotanyOf: 123f126890aSEmmanuel Vadot - required: 124c66ec88fSEmmanuel Vadot - riscv,isa 125f126890aSEmmanuel Vadot - required: 126f126890aSEmmanuel Vadot - riscv,isa-base 127f126890aSEmmanuel Vadot 128f126890aSEmmanuel Vadotdependencies: 129f126890aSEmmanuel Vadot riscv,isa-base: [ "riscv,isa-extensions" ] 130f126890aSEmmanuel Vadot riscv,isa-extensions: [ "riscv,isa-base" ] 131f126890aSEmmanuel Vadot 132f126890aSEmmanuel Vadotrequired: 133c66ec88fSEmmanuel Vadot - interrupt-controller 134c66ec88fSEmmanuel Vadot 135f126890aSEmmanuel VadotunevaluatedProperties: false 1366be33864SEmmanuel Vadot 137c66ec88fSEmmanuel Vadotexamples: 138c66ec88fSEmmanuel Vadot - | 139c66ec88fSEmmanuel Vadot // Example 1: SiFive Freedom U540G Development Kit 140c66ec88fSEmmanuel Vadot cpus { 141c66ec88fSEmmanuel Vadot #address-cells = <1>; 142c66ec88fSEmmanuel Vadot #size-cells = <0>; 143c66ec88fSEmmanuel Vadot timebase-frequency = <1000000>; 144c66ec88fSEmmanuel Vadot cpu@0 { 145c66ec88fSEmmanuel Vadot clock-frequency = <0>; 146c66ec88fSEmmanuel Vadot compatible = "sifive,rocket0", "riscv"; 147c66ec88fSEmmanuel Vadot device_type = "cpu"; 148c66ec88fSEmmanuel Vadot i-cache-block-size = <64>; 149c66ec88fSEmmanuel Vadot i-cache-sets = <128>; 150c66ec88fSEmmanuel Vadot i-cache-size = <16384>; 151c66ec88fSEmmanuel Vadot reg = <0>; 152f126890aSEmmanuel Vadot riscv,isa-base = "rv64i"; 153f126890aSEmmanuel Vadot riscv,isa-extensions = "i", "m", "a", "c"; 154f126890aSEmmanuel Vadot 155c66ec88fSEmmanuel Vadot cpu_intc0: interrupt-controller { 156c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 157c66ec88fSEmmanuel Vadot compatible = "riscv,cpu-intc"; 158c66ec88fSEmmanuel Vadot interrupt-controller; 159c66ec88fSEmmanuel Vadot }; 160c66ec88fSEmmanuel Vadot }; 161c66ec88fSEmmanuel Vadot cpu@1 { 162c66ec88fSEmmanuel Vadot clock-frequency = <0>; 163c66ec88fSEmmanuel Vadot compatible = "sifive,rocket0", "riscv"; 164c66ec88fSEmmanuel Vadot d-cache-block-size = <64>; 165c66ec88fSEmmanuel Vadot d-cache-sets = <64>; 166c66ec88fSEmmanuel Vadot d-cache-size = <32768>; 167c66ec88fSEmmanuel Vadot d-tlb-sets = <1>; 168c66ec88fSEmmanuel Vadot d-tlb-size = <32>; 169c66ec88fSEmmanuel Vadot device_type = "cpu"; 170c66ec88fSEmmanuel Vadot i-cache-block-size = <64>; 171c66ec88fSEmmanuel Vadot i-cache-sets = <64>; 172c66ec88fSEmmanuel Vadot i-cache-size = <32768>; 173c66ec88fSEmmanuel Vadot i-tlb-sets = <1>; 174c66ec88fSEmmanuel Vadot i-tlb-size = <32>; 175c66ec88fSEmmanuel Vadot mmu-type = "riscv,sv39"; 176c66ec88fSEmmanuel Vadot reg = <1>; 177c66ec88fSEmmanuel Vadot tlb-split; 178f126890aSEmmanuel Vadot riscv,isa-base = "rv64i"; 179f126890aSEmmanuel Vadot riscv,isa-extensions = "i", "m", "a", "f", "d", "c"; 180f126890aSEmmanuel Vadot 181c66ec88fSEmmanuel Vadot cpu_intc1: interrupt-controller { 182c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 183c66ec88fSEmmanuel Vadot compatible = "riscv,cpu-intc"; 184c66ec88fSEmmanuel Vadot interrupt-controller; 185c66ec88fSEmmanuel Vadot }; 186c66ec88fSEmmanuel Vadot }; 187c66ec88fSEmmanuel Vadot }; 188c66ec88fSEmmanuel Vadot 189c66ec88fSEmmanuel Vadot - | 190c66ec88fSEmmanuel Vadot // Example 2: Spike ISA Simulator with 1 Hart 191c66ec88fSEmmanuel Vadot cpus { 192c66ec88fSEmmanuel Vadot #address-cells = <1>; 193c66ec88fSEmmanuel Vadot #size-cells = <0>; 194c66ec88fSEmmanuel Vadot cpu@0 { 195c66ec88fSEmmanuel Vadot device_type = "cpu"; 196c66ec88fSEmmanuel Vadot reg = <0>; 197c66ec88fSEmmanuel Vadot compatible = "riscv"; 198c66ec88fSEmmanuel Vadot mmu-type = "riscv,sv48"; 199f126890aSEmmanuel Vadot riscv,isa-base = "rv64i"; 200f126890aSEmmanuel Vadot riscv,isa-extensions = "i", "m", "a", "f", "d", "c"; 201f126890aSEmmanuel Vadot 202c66ec88fSEmmanuel Vadot interrupt-controller { 203c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 204c66ec88fSEmmanuel Vadot interrupt-controller; 205c66ec88fSEmmanuel Vadot compatible = "riscv,cpu-intc"; 206c66ec88fSEmmanuel Vadot }; 207c66ec88fSEmmanuel Vadot }; 208c66ec88fSEmmanuel Vadot }; 209c66ec88fSEmmanuel Vadot... 210