diff mbox series

[1/3] dt-bindings: dsp: support imx8ulp dsp clocks

Message ID 20240418203720.8492-2-laurentiumihalcea111@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series Add DSP node for imx8ulp | expand

Commit Message

Laurentiu Mihalcea April 18, 2024, 8:37 p.m. UTC
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

i.MX8ULP DSP node needs a MU clock, but doesn't need
a debug clock. Change "clocks" and "clock-names" properties
to allow for this case.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 .../devicetree/bindings/dsp/fsl,dsp.yaml      | 51 ++++++++++++++-----
 1 file changed, 39 insertions(+), 12 deletions(-)

Comments

Frank Li April 18, 2024, 9:08 p.m. UTC | #1
On Thu, Apr 18, 2024 at 11:37:18PM +0300, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> i.MX8ULP DSP node needs a MU clock, but doesn't need
> a debug clock. Change "clocks" and "clock-names" properties
> to allow for this case.
> 
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../devicetree/bindings/dsp/fsl,dsp.yaml      | 51 ++++++++++++++-----
>  1 file changed, 39 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
> index 9af40da5688e..4a39d57b1cc6 100644
> --- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
> +++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
> @@ -30,22 +30,12 @@ properties:
>      maxItems: 1
>  
>    clocks:
> -    items:
> -      - description: ipg clock
> -      - description: ocram clock
> -      - description: core clock
> -      - description: debug interface clock
> -      - description: message unit clock
>      minItems: 3
> +    maxItems: 5
>  
>    clock-names:
> -    items:
> -      - const: ipg
> -      - const: ocram
> -      - const: core
> -      - const: debug
> -      - const: mu
>      minItems: 3
> +    maxItems: 5
>  
>    power-domains:
>      description:
> @@ -93,6 +83,43 @@ required:
>    - memory-region
>  
>  allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: fsl,imx8ulp-hifi4
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: ipg clock
> +            - description: ocram clock
> +            - description: core clock
> +            - description: message unit clock
> +        clock-names:
> +          items:
> +            - const: ipg
> +            - const: ocram
> +            - const: core
> +            - const: mu
> +    else:
> +      properties:
> +        clocks:
> +          items:
> +            - description: ipg clock
> +            - description: ocram clock
> +            - description: core clock
> +            - description: debug interface clock
> +            - description: message unit clock
> +          minItems: 3
> +        clock-names:
> +          items:
> +            - const: ipg
> +            - const: ocram
> +            - const: core
> +            - const: debug
> +            - const: mu
> +          minItems: 3

According to your descript, look like only clk "debug" is difference.

How about

  clocks:                                                               
    items:                                                              
      - description: ipg clock                                          
      - description: ocram clock                                        
      - description: core clock                                         
      - description: message unit clock                                 
      - description: debug interface clock

   clock-names:                                                          
      items:                                                              
        - const: ipg                                                      
        - const: ocram                                                    
        - const: core
	- const: mu                                                     
        - const: debug                                                    

allOf:
   if:                                                                 
     properties:                                                       
       compatible:                                                     
          contains:                                                     
            const: fsl,imx8ulp-hifi4
   then:
     properties:
       clocks:
         minItems: 4
       clock-names:
         minItems: 4

   else:
     propertyies:
       clocks:
         minItems: 3
       clock-names:
         minItems: 3



>    - if:
>        properties:
>          compatible:
> -- 
> 2.34.1
>
Rob Herring (Arm) April 22, 2024, 2:24 p.m. UTC | #2
On Thu, Apr 18, 2024 at 05:08:20PM -0400, Frank Li wrote:
> On Thu, Apr 18, 2024 at 11:37:18PM +0300, Laurentiu Mihalcea wrote:
> > From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > 
> > i.MX8ULP DSP node needs a MU clock, but doesn't need
> > a debug clock. Change "clocks" and "clock-names" properties
> > to allow for this case.
> > 
> > Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > ---
> >  .../devicetree/bindings/dsp/fsl,dsp.yaml      | 51 ++++++++++++++-----
> >  1 file changed, 39 insertions(+), 12 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
> > index 9af40da5688e..4a39d57b1cc6 100644
> > --- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
> > +++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
> > @@ -30,22 +30,12 @@ properties:
> >      maxItems: 1
> >  
> >    clocks:
> > -    items:
> > -      - description: ipg clock
> > -      - description: ocram clock
> > -      - description: core clock
> > -      - description: debug interface clock
> > -      - description: message unit clock
> >      minItems: 3
> > +    maxItems: 5
> >  
> >    clock-names:
> > -    items:
> > -      - const: ipg
> > -      - const: ocram
> > -      - const: core
> > -      - const: debug
> > -      - const: mu
> >      minItems: 3
> > +    maxItems: 5
> >  
> >    power-domains:
> >      description:
> > @@ -93,6 +83,43 @@ required:
> >    - memory-region
> >  
> >  allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: fsl,imx8ulp-hifi4
> > +    then:
> > +      properties:
> > +        clocks:
> > +          items:
> > +            - description: ipg clock
> > +            - description: ocram clock
> > +            - description: core clock
> > +            - description: message unit clock
> > +        clock-names:
> > +          items:
> > +            - const: ipg
> > +            - const: ocram
> > +            - const: core
> > +            - const: mu
> > +    else:
> > +      properties:
> > +        clocks:
> > +          items:
> > +            - description: ipg clock
> > +            - description: ocram clock
> > +            - description: core clock
> > +            - description: debug interface clock
> > +            - description: message unit clock
> > +          minItems: 3
> > +        clock-names:
> > +          items:
> > +            - const: ipg
> > +            - const: ocram
> > +            - const: core
> > +            - const: debug
> > +            - const: mu
> > +          minItems: 3
> 
> According to your descript, look like only clk "debug" is difference.
> 
> How about
> 
>   clocks:                                                               
>     items:                                                              
>       - description: ipg clock                                          
>       - description: ocram clock                                        
>       - description: core clock                                         
>       - description: message unit clock                                 
>       - description: debug interface clock
> 
>    clock-names:                                                          
>       items:                                                              
>         - const: ipg                                                      
>         - const: ocram                                                    
>         - const: core
> 	- const: mu                                                     
>         - const: debug                                                    

You can't change the existing order, so this does not work.

Rob
Rob Herring (Arm) April 22, 2024, 2:26 p.m. UTC | #3
On Thu, Apr 18, 2024 at 11:37:18PM +0300, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> i.MX8ULP DSP node needs a MU clock, but doesn't need
> a debug clock. Change "clocks" and "clock-names" properties
> to allow for this case.
> 
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../devicetree/bindings/dsp/fsl,dsp.yaml      | 51 ++++++++++++++-----
>  1 file changed, 39 insertions(+), 12 deletions(-)

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
index 9af40da5688e..4a39d57b1cc6 100644
--- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
@@ -30,22 +30,12 @@  properties:
     maxItems: 1
 
   clocks:
-    items:
-      - description: ipg clock
-      - description: ocram clock
-      - description: core clock
-      - description: debug interface clock
-      - description: message unit clock
     minItems: 3
+    maxItems: 5
 
   clock-names:
-    items:
-      - const: ipg
-      - const: ocram
-      - const: core
-      - const: debug
-      - const: mu
     minItems: 3
+    maxItems: 5
 
   power-domains:
     description:
@@ -93,6 +83,43 @@  required:
   - memory-region
 
 allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: fsl,imx8ulp-hifi4
+    then:
+      properties:
+        clocks:
+          items:
+            - description: ipg clock
+            - description: ocram clock
+            - description: core clock
+            - description: message unit clock
+        clock-names:
+          items:
+            - const: ipg
+            - const: ocram
+            - const: core
+            - const: mu
+    else:
+      properties:
+        clocks:
+          items:
+            - description: ipg clock
+            - description: ocram clock
+            - description: core clock
+            - description: debug interface clock
+            - description: message unit clock
+          minItems: 3
+        clock-names:
+          items:
+            - const: ipg
+            - const: ocram
+            - const: core
+            - const: debug
+            - const: mu
+          minItems: 3
   - if:
       properties:
         compatible: