cpus.yaml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. title: RISC-V CPUs
  7. maintainers:
  8. - Paul Walmsley <paul.walmsley@sifive.com>
  9. - Palmer Dabbelt <palmer@sifive.com>
  10. - Conor Dooley <conor@kernel.org>
  11. description: |
  12. This document uses some terminology common to the RISC-V community
  13. that is not widely used, the definitions of which are listed here:
  14. hart: A hardware execution context, which contains all the state
  15. mandated by the RISC-V ISA: a PC and some registers. This
  16. terminology is designed to disambiguate software's view of execution
  17. contexts from any particular microarchitectural implementation
  18. strategy. For example, an Intel laptop containing one socket with
  19. two cores, each of which has two hyperthreads, could be described as
  20. having four harts.
  21. allOf:
  22. - $ref: /schemas/cpu.yaml#
  23. - $ref: extensions.yaml
  24. properties:
  25. compatible:
  26. oneOf:
  27. - items:
  28. - enum:
  29. - amd,mbv32
  30. - andestech,ax45mp
  31. - canaan,k210
  32. - sifive,bullet0
  33. - sifive,e5
  34. - sifive,e7
  35. - sifive,e71
  36. - sifive,rocket0
  37. - sifive,s7
  38. - sifive,u5
  39. - sifive,u54
  40. - sifive,u7
  41. - sifive,u74
  42. - sifive,u74-mc
  43. - thead,c906
  44. - thead,c908
  45. - thead,c910
  46. - thead,c920
  47. - const: riscv
  48. - items:
  49. - enum:
  50. - sifive,e51
  51. - sifive,u54-mc
  52. - const: sifive,rocket0
  53. - const: riscv
  54. - const: riscv # Simulator only
  55. description:
  56. Identifies that the hart uses the RISC-V instruction set
  57. and identifies the type of the hart.
  58. mmu-type:
  59. description:
  60. Identifies the largest MMU address translation mode supported by
  61. this hart. These values originate from the RISC-V Privileged
  62. Specification document, available from
  63. https://riscv.org/specifications/
  64. $ref: /schemas/types.yaml#/definitions/string
  65. enum:
  66. - riscv,sv32
  67. - riscv,sv39
  68. - riscv,sv48
  69. - riscv,sv57
  70. - riscv,none
  71. reg:
  72. description:
  73. The hart ID of this CPU node.
  74. riscv,cbom-block-size:
  75. $ref: /schemas/types.yaml#/definitions/uint32
  76. description:
  77. The blocksize in bytes for the Zicbom cache operations.
  78. riscv,cbop-block-size:
  79. $ref: /schemas/types.yaml#/definitions/uint32
  80. description:
  81. The blocksize in bytes for the Zicbop cache operations.
  82. riscv,cboz-block-size:
  83. $ref: /schemas/types.yaml#/definitions/uint32
  84. description:
  85. The blocksize in bytes for the Zicboz cache operations.
  86. # RISC-V has multiple properties for cache op block sizes as the sizes
  87. # differ between individual CBO extensions
  88. cache-op-block-size: false
  89. # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
  90. timebase-frequency: false
  91. interrupt-controller:
  92. type: object
  93. $ref: /schemas/interrupt-controller/riscv,cpu-intc.yaml#
  94. cpu-idle-states:
  95. $ref: /schemas/types.yaml#/definitions/phandle-array
  96. items:
  97. maxItems: 1
  98. description: |
  99. List of phandles to idle state nodes supported
  100. by this hart (see ./idle-states.yaml).
  101. capacity-dmips-mhz:
  102. description:
  103. u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in
  104. DMIPS/MHz, relative to highest capacity-dmips-mhz
  105. in the system.
  106. anyOf:
  107. - required:
  108. - riscv,isa
  109. - required:
  110. - riscv,isa-base
  111. dependencies:
  112. riscv,isa-base: [ "riscv,isa-extensions" ]
  113. riscv,isa-extensions: [ "riscv,isa-base" ]
  114. required:
  115. - interrupt-controller
  116. unevaluatedProperties: false
  117. examples:
  118. - |
  119. // Example 1: SiFive Freedom U540G Development Kit
  120. cpus {
  121. #address-cells = <1>;
  122. #size-cells = <0>;
  123. timebase-frequency = <1000000>;
  124. cpu@0 {
  125. clock-frequency = <0>;
  126. compatible = "sifive,rocket0", "riscv";
  127. device_type = "cpu";
  128. i-cache-block-size = <64>;
  129. i-cache-sets = <128>;
  130. i-cache-size = <16384>;
  131. reg = <0>;
  132. riscv,isa-base = "rv64i";
  133. riscv,isa-extensions = "i", "m", "a", "c";
  134. cpu_intc0: interrupt-controller {
  135. #interrupt-cells = <1>;
  136. compatible = "riscv,cpu-intc";
  137. interrupt-controller;
  138. };
  139. };
  140. cpu@1 {
  141. clock-frequency = <0>;
  142. compatible = "sifive,rocket0", "riscv";
  143. d-cache-block-size = <64>;
  144. d-cache-sets = <64>;
  145. d-cache-size = <32768>;
  146. d-tlb-sets = <1>;
  147. d-tlb-size = <32>;
  148. device_type = "cpu";
  149. i-cache-block-size = <64>;
  150. i-cache-sets = <64>;
  151. i-cache-size = <32768>;
  152. i-tlb-sets = <1>;
  153. i-tlb-size = <32>;
  154. mmu-type = "riscv,sv39";
  155. reg = <1>;
  156. tlb-split;
  157. riscv,isa-base = "rv64i";
  158. riscv,isa-extensions = "i", "m", "a", "f", "d", "c";
  159. cpu_intc1: interrupt-controller {
  160. #interrupt-cells = <1>;
  161. compatible = "riscv,cpu-intc";
  162. interrupt-controller;
  163. };
  164. };
  165. };
  166. - |
  167. // Example 2: Spike ISA Simulator with 1 Hart
  168. cpus {
  169. #address-cells = <1>;
  170. #size-cells = <0>;
  171. cpu@0 {
  172. device_type = "cpu";
  173. reg = <0>;
  174. compatible = "riscv";
  175. mmu-type = "riscv,sv48";
  176. riscv,isa-base = "rv64i";
  177. riscv,isa-extensions = "i", "m", "a", "f", "d", "c";
  178. interrupt-controller {
  179. #interrupt-cells = <1>;
  180. interrupt-controller;
  181. compatible = "riscv,cpu-intc";
  182. };
  183. };
  184. };
  185. ...