Skip to content

Commit 299824e

Browse files
ConchuODpalmer-dabbelt
authored andcommitted
dt-bindings: riscv: add new riscv,isa strings for emulators
The QEMU virt and spike machines currently export a riscv,isa string of "rv64imafdcsuh", While the RISC-V foundation has been ratifying a bunch of extenstions etc, the kernel has remained relatively static with what hardware is supported - but the same is not true of QEMU. Using the virt machine and running dt-validate on the dumped dtb fails, partly due to the unexpected isa string. Rather than enumerate the many many possbilities, change the pattern to a regex, with the following assumptions: - ima are required - the single letter order is fixed & we don't care about things that can't even do "ima" - the standard multi letter extensions are all in a "_z<foo>" format where the first letter of <foo> is a valid single letter extension - _s & _h are used for supervisor and hyper visor extensions - convention says that after the first two chars, a standard multi letter extension name could be an english word (ifencei anyone?) so it's not worth restricting the charset - as the above is just convention, don't apply any charset restrictions to reduce future churn - vendor ISA extensions begind with _x and have no charset restrictions - we don't care about an e extension from an OS pov - that attempting to validate the contents of the multiletter extensions with dt-validate beyond the formatting is a futile, massively verbose or unwieldy exercise at best The following limitations also apply: - multi letter extension ordering is not enforced. dt-schema does not appear to allow for named match groups, so the resulting regex would be even more of a headache - ditto for the numbered extensions Finally, add me as a maintainer of the binding so that when it breaks in the future, I can be held responsible! Reported-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Guo Ren <guoren@kernel.org> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220823183319.3314940-4-mail@conchuod.ie Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 6e965c9 commit 299824e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • Documentation/devicetree/bindings/riscv

Documentation/devicetree/bindings/riscv/cpus.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ title: RISC-V bindings for 'cpus' DT nodes
99
maintainers:
1010
- Paul Walmsley <paul.walmsley@sifive.com>
1111
- Palmer Dabbelt <palmer@sifive.com>
12+
- Conor Dooley <conor@kernel.org>
1213

1314
description: |
1415
This document uses some terminology common to the RISC-V community
@@ -79,9 +80,7 @@ properties:
7980
insensitive, letters in the riscv,isa string must be all
8081
lowercase to simplify parsing.
8182
$ref: "/schemas/types.yaml#/definitions/string"
82-
enum:
83-
- rv64imac
84-
- rv64imafdc
83+
pattern: ^rv(?:64|32)imaf?d?q?c?b?v?k?h?(?:_[hsxz](?:[a-z])+)*$
8584

8685
# RISC-V requires 'timebase-frequency' in /cpus, so disallow it here
8786
timebase-frequency: false

0 commit comments

Comments
 (0)