diff mbox series

[v3] dt-bindings: iommu: renesas,ipmmu-vmsa: Update for R-Car Gen4

Message ID 20230209133440.2643228-1-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series [v3] dt-bindings: iommu: renesas,ipmmu-vmsa: Update for R-Car Gen4 | expand

Commit Message

Yoshihiro Shimoda Feb. 9, 2023, 1:34 p.m. UTC
Since R-Car Gen4 doens't have the main IPMMU IMSSTR register, update
the renesas,ipmmu-main property which sets maxItems as 1.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
Changes from v2:
https://lore.kernel.org/all/20230127140446.1728102-1-yoshihiro.shimoda.uh@renesas.com/
 - Set maxItems to renesas,ipmmu-main if R-Car Gen4.

Changes from v1:
https://lore.kernel.org/all/20230123012940.1250879-1-yoshihiro.shimoda.uh@renesas.com/
 - Change number of argument for R-Car Gen4 instead of "module id".
   On the discussion, using 'minItems' is a solution. But, it causes
   "too short" errors on dtbs_check. So, using "oneOf" instead.

 .../bindings/iommu/renesas,ipmmu-vmsa.yaml    | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

Comments

Rob Herring Feb. 9, 2023, 2:46 p.m. UTC | #1
On Thu, 09 Feb 2023 22:34:40 +0900, Yoshihiro Shimoda wrote:
> Since R-Car Gen4 doens't have the main IPMMU IMSSTR register, update
> the renesas,ipmmu-main property which sets maxItems as 1.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> Changes from v2:
> https://lore.kernel.org/all/20230127140446.1728102-1-yoshihiro.shimoda.uh@renesas.com/
>  - Set maxItems to renesas,ipmmu-main if R-Car Gen4.
> 
> Changes from v1:
> https://lore.kernel.org/all/20230123012940.1250879-1-yoshihiro.shimoda.uh@renesas.com/
>  - Change number of argument for R-Car Gen4 instead of "module id".
>    On the discussion, using 'minItems' is a solution. But, it causes
>    "too short" errors on dtbs_check. So, using "oneOf" instead.
> 
>  .../bindings/iommu/renesas,ipmmu-vmsa.yaml    | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 

Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230209133440.2643228-1-yoshihiro.shimoda.uh@renesas.com


iommu@ee480000: renesas,ipmmu-main: [[40], [10]] is too long
	arch/arm64/boot/dts/renesas/r8a779f0-spider.dtb

iommu@ee480000: renesas,ipmmu-main: [[70], [10]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@ee4c0000: renesas,ipmmu-main: [[40], [19]] is too long
	arch/arm64/boot/dts/renesas/r8a779f0-spider.dtb

iommu@ee4c0000: renesas,ipmmu-main: [[70], [19]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eed00000: renesas,ipmmu-main: [[40], [0]] is too long
	arch/arm64/boot/dts/renesas/r8a779f0-spider.dtb

iommu@eed00000: renesas,ipmmu-main: [[70], [0]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eed40000: renesas,ipmmu-main: [[40], [2]] is too long
	arch/arm64/boot/dts/renesas/r8a779f0-spider.dtb

iommu@eed40000: renesas,ipmmu-main: [[70], [1]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eed80000: renesas,ipmmu-main: [[70], [3]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eedc0000: renesas,ipmmu-main: [[70], [12]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eee00000: renesas,ipmmu-main: [[70], [6]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eee80000: renesas,ipmmu-main: [[70], [14]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eeec0000: renesas,ipmmu-main: [[70], [15]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eef00000: renesas,ipmmu-main: [[70], [5]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb

iommu@eef40000: renesas,ipmmu-main: [[70], [11]] is too long
	arch/arm64/boot/dts/renesas/r8a779a0-falcon.dtb
Rob Herring Feb. 9, 2023, 2:58 p.m. UTC | #2
On Thu, Feb 9, 2023 at 7:34 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
>
> Since R-Car Gen4 doens't have the main IPMMU IMSSTR register, update
> the renesas,ipmmu-main property which sets maxItems as 1.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> Changes from v2:
> https://lore.kernel.org/all/20230127140446.1728102-1-yoshihiro.shimoda.uh@renesas.com/
>  - Set maxItems to renesas,ipmmu-main if R-Car Gen4.
>
> Changes from v1:
> https://lore.kernel.org/all/20230123012940.1250879-1-yoshihiro.shimoda.uh@renesas.com/
>  - Change number of argument for R-Car Gen4 instead of "module id".
>    On the discussion, using 'minItems' is a solution. But, it causes
>    "too short" errors on dtbs_check. So, using "oneOf" instead.
>
>  .../bindings/iommu/renesas,ipmmu-vmsa.yaml    | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml
> index 72308a4c14e7..cc81bce44f3f 100644
> --- a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml
> +++ b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml
> @@ -74,11 +74,10 @@ properties:
>    renesas,ipmmu-main:
>      $ref: /schemas/types.yaml#/definitions/phandle-array
>      items:
> -      - items:
> -          - description: phandle to main IPMMU
> -          - description: the interrupt bit number associated with the particular
> -              cache IPMMU device. The interrupt bit number needs to match the main
> -              IPMMU IMSSTR register. Only used by cache IPMMU instances.
> +      - description: phandle to main IPMMU
> +      - description: the interrupt bit number associated with the particular
> +          cache IPMMU device. The interrupt bit number needs to match the main
> +          IPMMU IMSSTR register. Only used by cache IPMMU instances.

This is wrong. phandle-array is really a matrix. What you need is:

items:
  - minItems: 1
    items:
      - description: ...
      - description: ...

>      description:
>        Reference to the main IPMMU phandle plus 1 cell. The cell is
>        the interrupt bit number associated with the particular cache IPMMU
> @@ -109,6 +108,16 @@ allOf:
>        required:
>          - power-domains
>
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: renesas,rcar-gen4-ipmmu-vmsa
> +    then:
> +      properties:
> +        renesas,ipmmu-main:
> +          maxItems: 1

With the above, this is then:

items:
  - maxItems: 1

Then an else with:

items:
  - minItems: 2
Geert Uytterhoeven Feb. 9, 2023, 5:01 p.m. UTC | #3
Hi Rob,

On Thu, Feb 9, 2023 at 3:54 PM Rob Herring <robh@kernel.org> wrote:
> On Thu, 09 Feb 2023 22:34:40 +0900, Yoshihiro Shimoda wrote:
> > Since R-Car Gen4 doens't have the main IPMMU IMSSTR register, update
> > the renesas,ipmmu-main property which sets maxItems as 1.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> > Changes from v2:
> > https://lore.kernel.org/all/20230127140446.1728102-1-yoshihiro.shimoda.uh@renesas.com/
> >  - Set maxItems to renesas,ipmmu-main if R-Car Gen4.
> >
> > Changes from v1:
> > https://lore.kernel.org/all/20230123012940.1250879-1-yoshihiro.shimoda.uh@renesas.com/
> >  - Change number of argument for R-Car Gen4 instead of "module id".
> >    On the discussion, using 'minItems' is a solution. But, it causes
> >    "too short" errors on dtbs_check. So, using "oneOf" instead.
> >
> >  .../bindings/iommu/renesas,ipmmu-vmsa.yaml    | 19 ++++++++++++++-----
> >  1 file changed, 14 insertions(+), 5 deletions(-)
> >
>
> Running 'make dtbs_check' with the schema in this patch gives the
> following warnings. Consider if they are expected or the schema is
> incorrect. These may not be new warnings.
>
> Note that it is not yet a requirement to have 0 warnings for dtbs_check.
> This will change in the future.
>
> Full log is available here: https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230209133440.2643228-1-yoshihiro.shimoda.uh@renesas.com
>
>
> iommu@ee480000: renesas,ipmmu-main: [[40], [10]] is too long
>         arch/arm64/boot/dts/renesas/r8a779f0-spider.dtb

This is expected, as we're changing the bindings to match the (updated)
documentation, but haven't updated the DTS yet.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml
index 72308a4c14e7..cc81bce44f3f 100644
--- a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml
+++ b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml
@@ -74,11 +74,10 @@  properties:
   renesas,ipmmu-main:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - items:
-          - description: phandle to main IPMMU
-          - description: the interrupt bit number associated with the particular
-              cache IPMMU device. The interrupt bit number needs to match the main
-              IPMMU IMSSTR register. Only used by cache IPMMU instances.
+      - description: phandle to main IPMMU
+      - description: the interrupt bit number associated with the particular
+          cache IPMMU device. The interrupt bit number needs to match the main
+          IPMMU IMSSTR register. Only used by cache IPMMU instances.
     description:
       Reference to the main IPMMU phandle plus 1 cell. The cell is
       the interrupt bit number associated with the particular cache IPMMU
@@ -109,6 +108,16 @@  allOf:
       required:
         - power-domains
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,rcar-gen4-ipmmu-vmsa
+    then:
+      properties:
+        renesas,ipmmu-main:
+          maxItems: 1
+
 examples:
   - |
     #include <dt-bindings/clock/r8a7791-cpg-mssr.h>