diff mbox series

[v3,1/6] dt-bindings: crypto: starfive: Add jh8100 support

Message ID 20240227163758.198133-2-jiajie.ho@starfivetech.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series crypto: starfive: Add support for JH8100 | expand

Commit Message

Jia Jie Ho Feb. 27, 2024, 4:37 p.m. UTC
Add compatible string and additional interrupt for StarFive JH8100
crypto engine.

Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
---
 .../crypto/starfive,jh7110-crypto.yaml        | 30 +++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

Comments

Conor Dooley Feb. 28, 2024, 11:19 a.m. UTC | #1
On Wed, Feb 28, 2024 at 12:37:53AM +0800, Jia Jie Ho wrote:
> Add compatible string and additional interrupt for StarFive JH8100
> crypto engine.
> 
> Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  .../crypto/starfive,jh7110-crypto.yaml        | 30 +++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> index 71a2876bd6e4..d44d77908966 100644
> --- a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> +++ b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> @@ -12,7 +12,9 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: starfive,jh7110-crypto
> +    enum:
> +      - starfive,jh8100-crypto
> +      - starfive,jh7110-crypto
>  
>    reg:
>      maxItems: 1
> @@ -28,7 +30,10 @@ properties:
>        - const: ahb
>  
>    interrupts:
> -    maxItems: 1
> +    minItems: 1
> +    items:
> +      - description: SHA2 module irq
> +      - description: SM3 module irq
>  
>    resets:
>      maxItems: 1
> @@ -54,6 +59,27 @@ required:
>  
>  additionalProperties: false
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          const: starfive,jh7110-crypto
> +
> +    then:
> +      properties:
> +        interrupts:
> +          maxItems: 1
> +
> +  - if:
> +      properties:
> +        compatible:
> +          const: starfive,jh8100-crypto
> +
> +    then:
> +      properties:
> +        interrupts:
> +          maxItems: 2
> +
>  examples:
>    - |
>      crypto: crypto@16000000 {
> -- 
> 2.34.1
>
Rob Herring (Arm) Feb. 28, 2024, 3:51 p.m. UTC | #2
On Wed, Feb 28, 2024 at 12:37:53AM +0800, Jia Jie Ho wrote:
> Add compatible string and additional interrupt for StarFive JH8100
> crypto engine.
> 
> Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
> ---
>  .../crypto/starfive,jh7110-crypto.yaml        | 30 +++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> index 71a2876bd6e4..d44d77908966 100644
> --- a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> +++ b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> @@ -12,7 +12,9 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: starfive,jh7110-crypto
> +    enum:
> +      - starfive,jh8100-crypto
> +      - starfive,jh7110-crypto
>  
>    reg:
>      maxItems: 1
> @@ -28,7 +30,10 @@ properties:
>        - const: ahb
>  
>    interrupts:
> -    maxItems: 1
> +    minItems: 1
> +    items:
> +      - description: SHA2 module irq
> +      - description: SM3 module irq
>  
>    resets:
>      maxItems: 1
> @@ -54,6 +59,27 @@ required:
>  
>  additionalProperties: false
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          const: starfive,jh7110-crypto
> +
> +    then:
> +      properties:
> +        interrupts:
> +          maxItems: 1
> +
> +  - if:
> +      properties:
> +        compatible:
> +          const: starfive,jh8100-crypto
> +
> +    then:
> +      properties:
> +        interrupts:
> +          maxItems: 2

This is already the max. Don't you want 'minItems: 2'?

> +
>  examples:
>    - |
>      crypto: crypto@16000000 {
> -- 
> 2.34.1
>
Jia Jie Ho Feb. 29, 2024, 2:17 a.m. UTC | #3
> > Add compatible string and additional interrupt for StarFive JH8100
> > crypto engine.
> >
> > Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
> > ---
> >  .../crypto/starfive,jh7110-crypto.yaml        | 30 +++++++++++++++++--
> >  1 file changed, 28 insertions(+), 2 deletions(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> > b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> > index 71a2876bd6e4..d44d77908966 100644
> > ---
> > a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
> > +++ b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.
> > +++ yaml
> > @@ -12,7 +12,9 @@ maintainers:
> >
> >  properties:
> >    compatible:
> > -    const: starfive,jh7110-crypto
> > +    enum:
> > +      - starfive,jh8100-crypto
> > +      - starfive,jh7110-crypto
> >
> >    reg:
> >      maxItems: 1
> > @@ -28,7 +30,10 @@ properties:
> >        - const: ahb
> >
> >    interrupts:
> > -    maxItems: 1
> > +    minItems: 1
> > +    items:
> > +      - description: SHA2 module irq
> > +      - description: SM3 module irq
> >
> >    resets:
> >      maxItems: 1
> > @@ -54,6 +59,27 @@ required:
> >
> >  additionalProperties: false
> >
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          const: starfive,jh7110-crypto
> > +
> > +    then:
> > +      properties:
> > +        interrupts:
> > +          maxItems: 1
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          const: starfive,jh8100-crypto
> > +
> > +    then:
> > +      properties:
> > +        interrupts:
> > +          maxItems: 2
> 
> This is already the max. Don't you want 'minItems: 2'?

I'll fix this in the next version.
Thanks for reviewing this.

Regards,
Jia Jie
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
index 71a2876bd6e4..d44d77908966 100644
--- a/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
+++ b/Documentation/devicetree/bindings/crypto/starfive,jh7110-crypto.yaml
@@ -12,7 +12,9 @@  maintainers:
 
 properties:
   compatible:
-    const: starfive,jh7110-crypto
+    enum:
+      - starfive,jh8100-crypto
+      - starfive,jh7110-crypto
 
   reg:
     maxItems: 1
@@ -28,7 +30,10 @@  properties:
       - const: ahb
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    items:
+      - description: SHA2 module irq
+      - description: SM3 module irq
 
   resets:
     maxItems: 1
@@ -54,6 +59,27 @@  required:
 
 additionalProperties: false
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          const: starfive,jh7110-crypto
+
+    then:
+      properties:
+        interrupts:
+          maxItems: 1
+
+  - if:
+      properties:
+        compatible:
+          const: starfive,jh8100-crypto
+
+    then:
+      properties:
+        interrupts:
+          maxItems: 2
+
 examples:
   - |
     crypto: crypto@16000000 {