diff mbox series

[v9,25/33] dt-bindings: crypto: rockchip: convert to new driver bindings

Message ID 20220901125710.3733083-26-clabbe@baylibre.com (mailing list archive)
State New, archived
Headers show
Series crypto: rockchip: permit to pass self-tests | expand

Commit Message

Corentin LABBE Sept. 1, 2022, 12:57 p.m. UTC
The latest addition to the rockchip crypto driver need to update the
driver bindings.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 .../crypto/rockchip,rk3288-crypto.yaml        | 79 +++++++++++++++++--
 1 file changed, 71 insertions(+), 8 deletions(-)

Comments

Rob Herring (Arm) Sept. 7, 2022, 8:38 p.m. UTC | #1
On Thu, Sep 01, 2022 at 12:57:02PM +0000, Corentin Labbe wrote:
> The latest addition to the rockchip crypto driver need to update the
> driver bindings.

This sounds like you changed the driver, so change the binding. That 
would be an ABI break. But it looks like you are adding support for new 
h/w, so say that. Bindings aren't about a driver.

> 
> Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
> ---
>  .../crypto/rockchip,rk3288-crypto.yaml        | 79 +++++++++++++++++--
>  1 file changed, 71 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml b/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
> index 8a219d439d02..b7870a4cbdbe 100644
> --- a/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
> +++ b/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
> @@ -13,6 +13,8 @@ properties:
>    compatible:
>      enum:
>        - rockchip,rk3288-crypto
> +      - rockchip,rk3328-crypto
> +      - rockchip,rk3399-crypto
>  
>    reg:
>      maxItems: 1
> @@ -21,21 +23,82 @@ properties:
>      maxItems: 1
>  
>    clocks:
> +    minItems: 3
>      maxItems: 4
>  
>    clock-names:
> -    items:
> -      - const: aclk
> -      - const: hclk
> -      - const: sclk
> -      - const: apb_pclk
> +    minItems: 3
> +    maxItems: 4
>  
>    resets:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 3
>  
>    reset-names:
> -    items:
> -      - const: crypto-rst
> +    minItems: 1
> +    maxItems: 3
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: rockchip,rk3288-crypto
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 4
> +        clock-names:
> +          items:
> +            - const: aclk
> +            - const: hclk
> +            - const: sclk
> +            - const: apb_pclk
> +        resets:
> +          maxItems: 1
> +        reset-names:
> +          items:
> +            - const: crypto-rst
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: rockchip,rk3328-crypto
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 3
> +        clock-names:
> +          items:
> +            - const: hclk_master
> +            - const: hclk_slave
> +            - const: sclk

Do we really need new names? Was 'aclk' not the bus master clock?

If the clocks and resets aren't the same, then maybe these 2 new chips 
should be their own binding.

> +        resets:
> +          maxItems: 1
> +        reset-names:
> +          items:
> +            - const: crypto-rst
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: rockchip,rk3399-crypto
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 3
> +        clock-names:
> +          items:
> +            - const: hclk_master
> +            - const: hclk_slave
> +            - const: sclk
> +        resets:
> +          minItems: 3
> +        reset-names:
> +          items:
> +            - const: rst_master
> +            - const: rst_slave

'rst_' is redundant, drop.

> +            - const: crypto-rst
>  
>  required:
>    - compatible
> -- 
> 2.35.1
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>
Corentin LABBE Sept. 9, 2022, 8:57 a.m. UTC | #2
Le Wed, Sep 07, 2022 at 03:38:53PM -0500, Rob Herring a écrit :
> On Thu, Sep 01, 2022 at 12:57:02PM +0000, Corentin Labbe wrote:
> > The latest addition to the rockchip crypto driver need to update the
> > driver bindings.
> 
> This sounds like you changed the driver, so change the binding. That 
> would be an ABI break. But it looks like you are adding support for new 
> h/w, so say that. Bindings aren't about a driver.
> 

Hello

Ok, I will change the commit log.

> > 
> > Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
> > ---
> >  .../crypto/rockchip,rk3288-crypto.yaml        | 79 +++++++++++++++++--
> >  1 file changed, 71 insertions(+), 8 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml b/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
> > index 8a219d439d02..b7870a4cbdbe 100644
> > --- a/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
> > +++ b/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
> > @@ -13,6 +13,8 @@ properties:
> >    compatible:
> >      enum:
> >        - rockchip,rk3288-crypto
> > +      - rockchip,rk3328-crypto
> > +      - rockchip,rk3399-crypto
> >  
> >    reg:
> >      maxItems: 1
> > @@ -21,21 +23,82 @@ properties:
> >      maxItems: 1
> >  
> >    clocks:
> > +    minItems: 3
> >      maxItems: 4
> >  
> >    clock-names:
> > -    items:
> > -      - const: aclk
> > -      - const: hclk
> > -      - const: sclk
> > -      - const: apb_pclk
> > +    minItems: 3
> > +    maxItems: 4
> >  
> >    resets:
> > -    maxItems: 1
> > +    minItems: 1
> > +    maxItems: 3
> >  
> >    reset-names:
> > -    items:
> > -      - const: crypto-rst
> > +    minItems: 1
> > +    maxItems: 3
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: rockchip,rk3288-crypto
> > +    then:
> > +      properties:
> > +        clocks:
> > +          minItems: 4
> > +        clock-names:
> > +          items:
> > +            - const: aclk
> > +            - const: hclk
> > +            - const: sclk
> > +            - const: apb_pclk
> > +        resets:
> > +          maxItems: 1
> > +        reset-names:
> > +          items:
> > +            - const: crypto-rst
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: rockchip,rk3328-crypto
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 3
> > +        clock-names:
> > +          items:
> > +            - const: hclk_master
> > +            - const: hclk_slave
> > +            - const: sclk
> 
> Do we really need new names? Was 'aclk' not the bus master clock?

I follow name convention from dt-bindings/clock/rk3328-cru.h

> 
> If the clocks and resets aren't the same, then maybe these 2 new chips 
> should be their own binding.

I dont understand what you mean ?
You mean having a rk3288-crypto.yaml and a rk3328-crypto.yaml (which will be related to the same driver) ?

> > +        resets:
> > +          maxItems: 1
> > +        reset-names:
> > +          items:
> > +            - const: crypto-rst
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: rockchip,rk3399-crypto
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 3
> > +        clock-names:
> > +          items:
> > +            - const: hclk_master
> > +            - const: hclk_slave
> > +            - const: sclk
> > +        resets:
> > +          minItems: 3
> > +        reset-names:
> > +          items:
> > +            - const: rst_master
> > +            - const: rst_slave
> 
> 'rst_' is redundant, drop.
> 

I will fix it

Thanks for the review
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml b/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
index 8a219d439d02..b7870a4cbdbe 100644
--- a/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
+++ b/Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
@@ -13,6 +13,8 @@  properties:
   compatible:
     enum:
       - rockchip,rk3288-crypto
+      - rockchip,rk3328-crypto
+      - rockchip,rk3399-crypto
 
   reg:
     maxItems: 1
@@ -21,21 +23,82 @@  properties:
     maxItems: 1
 
   clocks:
+    minItems: 3
     maxItems: 4
 
   clock-names:
-    items:
-      - const: aclk
-      - const: hclk
-      - const: sclk
-      - const: apb_pclk
+    minItems: 3
+    maxItems: 4
 
   resets:
-    maxItems: 1
+    minItems: 1
+    maxItems: 3
 
   reset-names:
-    items:
-      - const: crypto-rst
+    minItems: 1
+    maxItems: 3
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3288-crypto
+    then:
+      properties:
+        clocks:
+          minItems: 4
+        clock-names:
+          items:
+            - const: aclk
+            - const: hclk
+            - const: sclk
+            - const: apb_pclk
+        resets:
+          maxItems: 1
+        reset-names:
+          items:
+            - const: crypto-rst
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3328-crypto
+    then:
+      properties:
+        clocks:
+          maxItems: 3
+        clock-names:
+          items:
+            - const: hclk_master
+            - const: hclk_slave
+            - const: sclk
+        resets:
+          maxItems: 1
+        reset-names:
+          items:
+            - const: crypto-rst
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3399-crypto
+    then:
+      properties:
+        clocks:
+          maxItems: 3
+        clock-names:
+          items:
+            - const: hclk_master
+            - const: hclk_slave
+            - const: sclk
+        resets:
+          minItems: 3
+        reset-names:
+          items:
+            - const: rst_master
+            - const: rst_slave
+            - const: crypto-rst
 
 required:
   - compatible