[PATCH v4 3/4] dt-bindings: crypto: fsl,sec-v4.0: Add power domains for iMX8QM and iMX8QXP

John Ernberg posted 4 patches 6 months, 2 weeks ago
There is a newer version of this series
[PATCH v4 3/4] dt-bindings: crypto: fsl,sec-v4.0: Add power domains for iMX8QM and iMX8QXP
Posted by John Ernberg 6 months, 2 weeks ago
NXP SoCs like the iMX8QM, iMX8QXP or iMX8DXP use power domains for
resource management.

Add compatible strings for these SoCs (QXP and DXP gets to share as their
only difference is a core-count, Q=Quad core and D=Dual core), and allow
power-domains for them only. Keep the old restriction for others.

Signed-off-by: John Ernberg <john.ernberg@actia.se>

---

v4:
 - Reword commit message (Frank Li)
 - Add explicit imx8qxp compatible (Frank Li)
 - Move the job-ring constraints back to the job-ring section under an
   'allOf:' to avoid the warning from v2 (Rob Herring)

v3:
 - Fix warnings discovered by Rob Herring's bot
 - Declare the compatibles correctly (Krzysztof Kozlowski)

v2:
 - Adjust commit message (Frank Li)
 - Only allow power-domains when compatible with imx8qm (Frank Li)
---
 .../bindings/crypto/fsl,sec-v4.0.yaml         | 41 ++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml b/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
index 75afa441e019..eab43e7a354c 100644
--- a/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
+++ b/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
@@ -46,6 +46,8 @@ properties:
       - items:
           - enum:
               - fsl,imx6ul-caam
+              - fsl,imx8qm-caam
+              - fsl,imx8qxp-caam
               - fsl,sec-v5.0
           - const: fsl,sec-v4.0
       - const: fsl,sec-v4.0
@@ -77,6 +79,9 @@ properties:
   interrupts:
     maxItems: 1
 
+  power-domains:
+    maxItems: 1
+
   fsl,sec-era:
     description: Defines the 'ERA' of the SEC device.
     $ref: /schemas/types.yaml#/definitions/uint32
@@ -106,7 +111,10 @@ patternProperties:
               - const: fsl,sec-v5.0-job-ring
               - const: fsl,sec-v4.0-job-ring
           - items:
-              - const: fsl,sec-v5.0-job-ring
+              - enum:
+                - fsl,imx8qm-job-ring
+                - fsl,imx8qxp-job-ring
+                - fsl,sec-v5.0-job-ring
               - const: fsl,sec-v4.0-job-ring
           - const: fsl,sec-v4.0-job-ring
 
@@ -116,6 +124,9 @@ patternProperties:
       interrupts:
         maxItems: 1
 
+      power-domains:
+        maxItems: 1
+
       fsl,liodn:
         description:
           Specifies the LIODN to be used in conjunction with the ppid-to-liodn
@@ -125,6 +136,20 @@ patternProperties:
         $ref: /schemas/types.yaml#/definitions/uint32-array
         items:
           - maximum: 0xfff
+    allOf:
+      - if:
+          properties:
+            compatible:
+              contains:
+                enum:
+                  - fsl,imx8qm-job-ring
+                  - fsl,imx8qxp-job-ring
+        then:
+          required:
+            - power-domains
+        else:
+          properties:
+            power-domains: false
 
   '^rtic@[0-9a-f]+$':
     type: object
@@ -212,6 +237,20 @@ required:
   - reg
   - ranges
 
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - fsl,imx8qm-caam
+          - fsl,imx8qxp-caam
+then:
+  required:
+    - power-domains
+else:
+  properties:
+    power-domains: false
+
 additionalProperties: false
 
 examples:
-- 
2.49.0
Re: [PATCH v4 3/4] dt-bindings: crypto: fsl,sec-v4.0: Add power domains for iMX8QM and iMX8QXP
Posted by Rob Herring (Arm) 6 months, 2 weeks ago
On Thu, 05 Jun 2025 13:28:02 +0000, John Ernberg wrote:
> NXP SoCs like the iMX8QM, iMX8QXP or iMX8DXP use power domains for
> resource management.
> 
> Add compatible strings for these SoCs (QXP and DXP gets to share as their
> only difference is a core-count, Q=Quad core and D=Dual core), and allow
> power-domains for them only. Keep the old restriction for others.
> 
> Signed-off-by: John Ernberg <john.ernberg@actia.se>
> 
> ---
> 
> v4:
>  - Reword commit message (Frank Li)
>  - Add explicit imx8qxp compatible (Frank Li)
>  - Move the job-ring constraints back to the job-ring section under an
>    'allOf:' to avoid the warning from v2 (Rob Herring)
> 
> v3:
>  - Fix warnings discovered by Rob Herring's bot
>  - Declare the compatibles correctly (Krzysztof Kozlowski)
> 
> v2:
>  - Adjust commit message (Frank Li)
>  - Only allow power-domains when compatible with imx8qm (Frank Li)
> ---
>  .../bindings/crypto/fsl,sec-v4.0.yaml         | 41 ++++++++++++++++++-
>  1 file changed, 40 insertions(+), 1 deletion(-)
> 

With the indentation fixed,

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Re: [PATCH v4 3/4] dt-bindings: crypto: fsl,sec-v4.0: Add power domains for iMX8QM and iMX8QXP
Posted by Rob Herring (Arm) 6 months, 2 weeks ago
On Thu, 05 Jun 2025 13:28:02 +0000, John Ernberg wrote:
> NXP SoCs like the iMX8QM, iMX8QXP or iMX8DXP use power domains for
> resource management.
> 
> Add compatible strings for these SoCs (QXP and DXP gets to share as their
> only difference is a core-count, Q=Quad core and D=Dual core), and allow
> power-domains for them only. Keep the old restriction for others.
> 
> Signed-off-by: John Ernberg <john.ernberg@actia.se>
> 
> ---
> 
> v4:
>  - Reword commit message (Frank Li)
>  - Add explicit imx8qxp compatible (Frank Li)
>  - Move the job-ring constraints back to the job-ring section under an
>    'allOf:' to avoid the warning from v2 (Rob Herring)
> 
> v3:
>  - Fix warnings discovered by Rob Herring's bot
>  - Declare the compatibles correctly (Krzysztof Kozlowski)
> 
> v2:
>  - Adjust commit message (Frank Li)
>  - Only allow power-domains when compatible with imx8qm (Frank Li)
> ---
>  .../bindings/crypto/fsl,sec-v4.0.yaml         | 41 ++++++++++++++++++-
>  1 file changed, 40 insertions(+), 1 deletion(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml:115:17: [warning] wrong indentation: expected 18 but found 16 (indentation)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250605132754.1771368-4-john.ernberg@actia.se

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v4 3/4] dt-bindings: crypto: fsl,sec-v4.0: Add power domains for iMX8QM and iMX8QXP
Posted by John Ernberg 6 months, 2 weeks ago
Hi,

On 6/5/25 3:28 PM, John Ernberg wrote:
> NXP SoCs like the iMX8QM, iMX8QXP or iMX8DXP use power domains for
> resource management.
> 
> Add compatible strings for these SoCs (QXP and DXP gets to share as their
> only difference is a core-count, Q=Quad core and D=Dual core), and allow
> power-domains for them only. Keep the old restriction for others.
> 
> Signed-off-by: John Ernberg <john.ernberg@actia.se>
> 
> ---
> 
> v4:
>   - Reword commit message (Frank Li)
>   - Add explicit imx8qxp compatible (Frank Li)
>   - Move the job-ring constraints back to the job-ring section under an
>     'allOf:' to avoid the warning from v2 (Rob Herring)
> 
> v3:
>   - Fix warnings discovered by Rob Herring's bot
>   - Declare the compatibles correctly (Krzysztof Kozlowski)
> 
> v2:
>   - Adjust commit message (Frank Li)
>   - Only allow power-domains when compatible with imx8qm (Frank Li)
> ---
>   .../bindings/crypto/fsl,sec-v4.0.yaml         | 41 ++++++++++++++++++-
>   1 file changed, 40 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml b/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
> index 75afa441e019..eab43e7a354c 100644
> --- a/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
> +++ b/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
> @@ -46,6 +46,8 @@ properties:
>         - items:
>             - enum:
>                 - fsl,imx6ul-caam
> +              - fsl,imx8qm-caam
> +              - fsl,imx8qxp-caam
>                 - fsl,sec-v5.0
>             - const: fsl,sec-v4.0
>         - const: fsl,sec-v4.0
> @@ -77,6 +79,9 @@ properties:
>     interrupts:
>       maxItems: 1
>   
> +  power-domains:
> +    maxItems: 1
> +
>     fsl,sec-era:
>       description: Defines the 'ERA' of the SEC device.
>       $ref: /schemas/types.yaml#/definitions/uint32
> @@ -106,7 +111,10 @@ patternProperties:
>                 - const: fsl,sec-v5.0-job-ring
>                 - const: fsl,sec-v4.0-job-ring
>             - items:
> -              - const: fsl,sec-v5.0-job-ring
> +              - enum:
> +                - fsl,imx8qm-job-ring
> +                - fsl,imx8qxp-job-ring
> +                - fsl,sec-v5.0-job-ring
>                 - const: fsl,sec-v4.0-job-ring
>             - const: fsl,sec-v4.0-job-ring
>   
> @@ -116,6 +124,9 @@ patternProperties:
>         interrupts:
>           maxItems: 1
>   
> +      power-domains:
> +        maxItems: 1
> +
>         fsl,liodn:
>           description:
>             Specifies the LIODN to be used in conjunction with the ppid-to-liodn
> @@ -125,6 +136,20 @@ patternProperties:
>           $ref: /schemas/types.yaml#/definitions/uint32-array
>           items:
>             - maximum: 0xfff
> +    allOf:
> +      - if:
> +          properties:
> +            compatible:
> +              contains:
> +                enum:
> +                  - fsl,imx8qm-job-ring
> +                  - fsl,imx8qxp-job-ring
> +        then:
> +          required:
> +            - power-domains
> +        else:
> +          properties:
> +            power-domains: false

To dodge the allOf here I had to make some changes to dt-schema 
nodes.yaml. Is the allOf OK or does the changes look like something that 
should be submitted formally?

Thanks! // John Ernberg

------------------>8------------------

 From 39e3c85e53ab570fdd5d5a93156a8a486ef20f0c Mon Sep 17 00:00:00 2001
From: John Ernberg <john.ernberg@actia.se>
Date: Wed, 4 Jun 2025 15:12:55 +0200
Subject: [PATCH] schemas: nodes: Allow if-then-else in patternProperties
  objects

Having local if-then-else statements under e.g. a patternProperties object
node causes a schema warning about an unexpected statement.

Allow this construct to reduce size of if-then-else blocks that would
otherwise need to occur at the top level, making them easier to read,
and more localized to what they are controlling.

Signed-off-by: John Ernberg <john.ernberg@actia.se>
---
  dtschema/meta-schemas/nodes.yaml | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/dtschema/meta-schemas/nodes.yaml 
b/dtschema/meta-schemas/nodes.yaml
index 0b2c8f7..e45cb45 100644
--- a/dtschema/meta-schemas/nodes.yaml
+++ b/dtschema/meta-schemas/nodes.yaml
@@ -27,6 +27,9 @@ propertyNames:
      - deprecated
      - required
      - not
+    - if
+    - else
+    - then
      - allOf
      - anyOf
      - oneOf


Re: [PATCH v4 3/4] dt-bindings: crypto: fsl,sec-v4.0: Add power domains for iMX8QM and iMX8QXP
Posted by Rob Herring 6 months, 2 weeks ago
On Thu, Jun 05, 2025 at 01:32:09PM +0000, John Ernberg wrote:
> Hi,
> 
> On 6/5/25 3:28 PM, John Ernberg wrote:
> > NXP SoCs like the iMX8QM, iMX8QXP or iMX8DXP use power domains for
> > resource management.
> > 
> > Add compatible strings for these SoCs (QXP and DXP gets to share as their
> > only difference is a core-count, Q=Quad core and D=Dual core), and allow
> > power-domains for them only. Keep the old restriction for others.
> > 
> > Signed-off-by: John Ernberg <john.ernberg@actia.se>
> > 
> > ---
> > 
> > v4:
> >   - Reword commit message (Frank Li)
> >   - Add explicit imx8qxp compatible (Frank Li)
> >   - Move the job-ring constraints back to the job-ring section under an
> >     'allOf:' to avoid the warning from v2 (Rob Herring)
> > 
> > v3:
> >   - Fix warnings discovered by Rob Herring's bot
> >   - Declare the compatibles correctly (Krzysztof Kozlowski)
> > 
> > v2:
> >   - Adjust commit message (Frank Li)
> >   - Only allow power-domains when compatible with imx8qm (Frank Li)
> > ---
> >   .../bindings/crypto/fsl,sec-v4.0.yaml         | 41 ++++++++++++++++++-
> >   1 file changed, 40 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml b/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
> > index 75afa441e019..eab43e7a354c 100644
> > --- a/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
> > +++ b/Documentation/devicetree/bindings/crypto/fsl,sec-v4.0.yaml
> > @@ -46,6 +46,8 @@ properties:
> >         - items:
> >             - enum:
> >                 - fsl,imx6ul-caam
> > +              - fsl,imx8qm-caam
> > +              - fsl,imx8qxp-caam
> >                 - fsl,sec-v5.0
> >             - const: fsl,sec-v4.0
> >         - const: fsl,sec-v4.0
> > @@ -77,6 +79,9 @@ properties:
> >     interrupts:
> >       maxItems: 1
> >   
> > +  power-domains:
> > +    maxItems: 1
> > +
> >     fsl,sec-era:
> >       description: Defines the 'ERA' of the SEC device.
> >       $ref: /schemas/types.yaml#/definitions/uint32
> > @@ -106,7 +111,10 @@ patternProperties:
> >                 - const: fsl,sec-v5.0-job-ring
> >                 - const: fsl,sec-v4.0-job-ring
> >             - items:
> > -              - const: fsl,sec-v5.0-job-ring
> > +              - enum:
> > +                - fsl,imx8qm-job-ring
> > +                - fsl,imx8qxp-job-ring
> > +                - fsl,sec-v5.0-job-ring
> >                 - const: fsl,sec-v4.0-job-ring
> >             - const: fsl,sec-v4.0-job-ring
> >   
> > @@ -116,6 +124,9 @@ patternProperties:
> >         interrupts:
> >           maxItems: 1
> >   
> > +      power-domains:
> > +        maxItems: 1
> > +
> >         fsl,liodn:
> >           description:
> >             Specifies the LIODN to be used in conjunction with the ppid-to-liodn
> > @@ -125,6 +136,20 @@ patternProperties:
> >           $ref: /schemas/types.yaml#/definitions/uint32-array
> >           items:
> >             - maximum: 0xfff
> > +    allOf:
> > +      - if:
> > +          properties:
> > +            compatible:
> > +              contains:
> > +                enum:
> > +                  - fsl,imx8qm-job-ring
> > +                  - fsl,imx8qxp-job-ring
> > +        then:
> > +          required:
> > +            - power-domains
> > +        else:
> > +          properties:
> > +            power-domains: false
> 
> To dodge the allOf here I had to make some changes to dt-schema 
> nodes.yaml. Is the allOf OK or does the changes look like something that 
> should be submitted formally?

It's okay, but please send the change below either to devicetree-spec 
list or as a GH PR.

Rob

> 
> Thanks! // John Ernberg
> 
> ------------------>8------------------
> 
>  From 39e3c85e53ab570fdd5d5a93156a8a486ef20f0c Mon Sep 17 00:00:00 2001
> From: John Ernberg <john.ernberg@actia.se>
> Date: Wed, 4 Jun 2025 15:12:55 +0200
> Subject: [PATCH] schemas: nodes: Allow if-then-else in patternProperties
>   objects
> 
> Having local if-then-else statements under e.g. a patternProperties object
> node causes a schema warning about an unexpected statement.
> 
> Allow this construct to reduce size of if-then-else blocks that would
> otherwise need to occur at the top level, making them easier to read,
> and more localized to what they are controlling.
> 
> Signed-off-by: John Ernberg <john.ernberg@actia.se>
> ---
>   dtschema/meta-schemas/nodes.yaml | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/dtschema/meta-schemas/nodes.yaml 
> b/dtschema/meta-schemas/nodes.yaml
> index 0b2c8f7..e45cb45 100644
> --- a/dtschema/meta-schemas/nodes.yaml
> +++ b/dtschema/meta-schemas/nodes.yaml
> @@ -27,6 +27,9 @@ propertyNames:
>       - deprecated
>       - required
>       - not
> +    - if
> +    - else
> +    - then
>       - allOf
>       - anyOf
>       - oneOf
> 
>