diff mbox series

[RFC,v1,5/5] dt-bindings: riscv: document vector crypto requirements

Message ID 20241002-sincerity-urgent-acdb0e8d8a66@spud (mailing list archive)
State Superseded
Headers show
Series Add some validation for vector, vector crypto and fp stuff | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-5-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 128.51s
conchuod/patch-5-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1262.34s
conchuod/patch-5-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1495.66s
conchuod/patch-5-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 19.68s
conchuod/patch-5-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 21.48s
conchuod/patch-5-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.38s
conchuod/patch-5-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 41.39s
conchuod/patch-5-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-5-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.48s
conchuod/patch-5-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-5-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-5-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.03s

Commit Message

Conor Dooley Oct. 2, 2024, 4:10 p.m. UTC
From: Conor Dooley <conor.dooley@microchip.com>

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

Apply these rules in the binding, so that invalid combinations can be
avoided.

Link: https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-698e64a-2024-09-09 [1]
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 .../devicetree/bindings/riscv/extensions.yaml | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Clément Léger Oct. 3, 2024, 7:59 a.m. UTC | #1
On 02/10/2024 18:10, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> 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
> 
> Apply these rules in the binding, so that invalid combinations can be
> avoided.
> 
> Link: https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-698e64a-2024-09-09 [1]
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  .../devicetree/bindings/riscv/extensions.yaml | 32 +++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
> index abf2579171c5b..02b822bbf341d 100644
> --- a/Documentation/devicetree/bindings/riscv/extensions.yaml
> +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
> @@ -651,6 +651,38 @@ properties:
>              - contains:
>                  const: zve64f
>  
> +      - if:
> +          contains:
> +            anyOf:
> +              - const: zvbc
> +              - const: zvkn
> +              - const: zvknhb
> +              - const: zvks

Hey Conor,

Shouldn't zvksed and zvksh be part odf this list ? My understanding of
the spec might be wrong but "Zvks--" seems like a poor-man's wildcard
for Zvks* extensions ?

Thanks,

Clément

> +        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: zvknc
> +              - const: zvkng
> +              - const: zvkt
> +        then:
> +          contains:
> +            anyOf:
> +              - const: v
> +              - const: zve32x
> +
>  allOf:
>    # Zcf extension does not exist on rv64
>    - if:
Krzysztof Kozlowski Oct. 3, 2024, 9:52 a.m. UTC | #2
On Wed, Oct 02, 2024 at 05:10:58PM +0100, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> 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
> 
> Apply these rules in the binding, so that invalid combinations can be
> avoided.
> 
> Link: https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-698e64a-2024-09-09 [1]
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  .../devicetree/bindings/riscv/extensions.yaml | 32 +++++++++++++++++++
>  1 file changed, 32 insertions(+)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Conor Dooley Oct. 3, 2024, 11:05 a.m. UTC | #3
On Thu, Oct 03, 2024 at 09:59:38AM +0200, Clément Léger wrote:
> 
> 
> On 02/10/2024 18:10, Conor Dooley wrote:
> > From: Conor Dooley <conor.dooley@microchip.com>
> > 
> > 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
> > 
> > Apply these rules in the binding, so that invalid combinations can be
> > avoided.
> > 
> > Link: https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-698e64a-2024-09-09 [1]
> > Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> > ---
> >  .../devicetree/bindings/riscv/extensions.yaml | 32 +++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
> > index abf2579171c5b..02b822bbf341d 100644
> > --- a/Documentation/devicetree/bindings/riscv/extensions.yaml
> > +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
> > @@ -651,6 +651,38 @@ properties:
> >              - contains:
> >                  const: zve64f
> >  
> > +      - if:
> > +          contains:
> > +            anyOf:
> > +              - const: zvbc
> > +              - const: zvkn
> > +              - const: zvknhb
> > +              - const: zvks
> 
> Shouldn't zvksed and zvksh be part odf this list ? My understanding of
> the spec might be wrong but "Zvks--" seems like a poor-man's wildcard
> for Zvks* extensions ?

I don't think so, there's a corresponding -- on the first line of the
quote. I think it is some really odd styling that should be replaced by
commas.
Clément Léger Oct. 3, 2024, 11:36 a.m. UTC | #4
On 03/10/2024 13:05, Conor Dooley wrote:
> On Thu, Oct 03, 2024 at 09:59:38AM +0200, Clément Léger wrote:
>>
>>
>> On 02/10/2024 18:10, Conor Dooley wrote:
>>> From: Conor Dooley <conor.dooley@microchip.com>
>>>
>>> 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
>>>
>>> Apply these rules in the binding, so that invalid combinations can be
>>> avoided.
>>>
>>> Link: https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-698e64a-2024-09-09 [1]
>>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>>> ---
>>>  .../devicetree/bindings/riscv/extensions.yaml | 32 +++++++++++++++++++
>>>  1 file changed, 32 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
>>> index abf2579171c5b..02b822bbf341d 100644
>>> --- a/Documentation/devicetree/bindings/riscv/extensions.yaml
>>> +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
>>> @@ -651,6 +651,38 @@ properties:
>>>              - contains:
>>>                  const: zve64f
>>>  
>>> +      - if:
>>> +          contains:
>>> +            anyOf:
>>> +              - const: zvbc
>>> +              - const: zvkn
>>> +              - const: zvknhb
>>> +              - const: zvks
>>
>> Shouldn't zvksed and zvksh be part odf this list ? My understanding of
>> the spec might be wrong but "Zvks--" seems like a poor-man's wildcard
>> for Zvks* extensions ?
> 
> I don't think so, there's a corresponding -- on the first line of the
> quote. I think it is some really odd styling that should be replaced by
> commas.
> 

Oh yes, my bad.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
index abf2579171c5b..02b822bbf341d 100644
--- a/Documentation/devicetree/bindings/riscv/extensions.yaml
+++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
@@ -651,6 +651,38 @@  properties:
             - contains:
                 const: zve64f
 
+      - if:
+          contains:
+            anyOf:
+              - const: zvbc
+              - const: zvkn
+              - const: zvknhb
+              - const: zvks
+        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: zvknc
+              - const: zvkng
+              - const: zvkt
+        then:
+          contains:
+            anyOf:
+              - const: v
+              - const: zve32x
+
 allOf:
   # Zcf extension does not exist on rv64
   - if: