[PATCH v3 6/6] dt-bindings: riscv: document vector crypto requirements

From: Conor Dooley
Date: Wed Feb 05 2025 - 11:10:01 EST


From: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

Section 35.2. Extensions Overview of [1] says:
| The Zvknhb and Zvbc Vector Crypto Extensions --and accordingly the composite extensions Zvkn and
| Zvks-- (sic) require a Zve64x base, or application ("V") base Vector Extension.
| All of the other Vector Crypto Extensions can be built on any embedded (Zve*) or application ("V") base
| Vector Extension

Eric Biggars pointed out that the spec is actually incorrect, and that
the list of instructions requiring a Zve64x base is actually: Zvkn,
Zvknc, Zvkng and Zvksc. Implement the rules according to his PR [2].

Link: https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-698e64a-2024-09-09 [1]
Link: https://github.com/riscv/riscv-isa-manual/pull/1697 [2]
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Signed-off-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
---
.../devicetree/bindings/riscv/extensions.yaml | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)

diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
index 02065664f819..9aeb9d4731ca 100644
--- a/Documentation/devicetree/bindings/riscv/extensions.yaml
+++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
@@ -726,6 +726,39 @@ properties:
- contains:
const: zve64f

+ - if:
+ contains:
+ anyOf:
+ - const: zvbc
+ - const: zvkn
+ - const: zvknc
+ - const: zvkng
+ - const: zvknhb
+ - const: zvksc
+ then:
+ contains:
+ anyOf:
+ - const: v
+ - const: zve64x
+
+ - if:
+ contains:
+ anyOf:
+ - const: zvbb
+ - const: zvkb
+ - const: zvkg
+ - const: zvkned
+ - const: zvknha
+ - const: zvksed
+ - const: zvksh
+ - const: zvks
+ - const: zvkt
+ then:
+ contains:
+ anyOf:
+ - const: v
+ - const: zve32x
+
allOf:
# Zcf extension does not exist on rv64
- if:
--
2.45.2