diff mbox series

[v4,01/20] dt-bindings: iommu: mediatek: Increase max interrupt number

Message ID 20220729063208.16799-2-tinghan.shen@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Add driver nodes for MT8195 SoC | expand

Commit Message

Tinghan Shen July 29, 2022, 6:31 a.m. UTC
mt8195 infra iommu uses 5 interrupts.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/iommu/mediatek,iommu.yaml         | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

AngeloGioacchino Del Regno July 29, 2022, 8:06 a.m. UTC | #1
Il 29/07/22 08:31, Tinghan Shen ha scritto:
> mt8195 infra iommu uses 5 interrupts.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Yong Wu (吴勇) Aug. 1, 2022, 12:04 p.m. UTC | #2
On Fri, 2022-07-29 at 14:31 +0800, Tinghan Shen wrote:
> mt8195 infra iommu uses 5 interrupts.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/iommu/mediatek,iommu.yaml         | 18
> +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git
> a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> index fee0241b50988..5afe2a0045330 100644
> --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> @@ -91,7 +91,8 @@ properties:
>      maxItems: 1
>  
>    interrupts:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 5
>  
>    clocks:
>      items:
> @@ -191,9 +192,24 @@ allOf:
>                const: mediatek,mt8195-iommu-infra
>  
>      then:
> +      properties:
> +        interrupts:
> +          maxItems: 1
> +
>        required:
>          - mediatek,larbs
>  
> +    else:
> +      properties:
> +        interrupts:
> +          description: The IOMMU has 5 banks. Each bank has its own
> interrupt.
> +          items:
> +            - description: The interrupt for IOMMU bank0
> +            - description: The interrupt for IOMMU bank1
> +            - description: The interrupt for IOMMU bank2
> +            - description: The interrupt for IOMMU bank3
> +            - description: The interrupt for IOMMU bank4
> +

Thanks for improving this.

Before the meaning for this segment is that it require "mediatek,larbs"
if it is NOT infra iommu. Here we add a new block for infra iommu.
then we'd better to remove the "not". this should be more readable.
Something like below:

if:
   /* Remove the not here. */
   properties:
     compatible:
       contains:
         const: mediatek,mt8195-iommu-infra
then:
  xxx
else:
  xx


>  additionalProperties: false
>  
>  examples:
Tinghan Shen Aug. 4, 2022, 2:06 a.m. UTC | #3
On Mon, 2022-08-01 at 20:04 +0800, Yong Wu wrote:
> On Fri, 2022-07-29 at 14:31 +0800, Tinghan Shen wrote:
> > mt8195 infra iommu uses 5 interrupts.
> > 
> > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  .../bindings/iommu/mediatek,iommu.yaml         | 18
> > +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> > b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> > index fee0241b50988..5afe2a0045330 100644
> > --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> > +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
> > @@ -91,7 +91,8 @@ properties:
> >      maxItems: 1
> >  
> >    interrupts:
> > -    maxItems: 1
> > +    minItems: 1
> > +    maxItems: 5
> >  
> >    clocks:
> >      items:
> > @@ -191,9 +192,24 @@ allOf:
> >                const: mediatek,mt8195-iommu-infra
> >  
> >      then:
> > +      properties:
> > +        interrupts:
> > +          maxItems: 1
> > +
> >        required:
> >          - mediatek,larbs
> >  
> > +    else:
> > +      properties:
> > +        interrupts:
> > +          description: The IOMMU has 5 banks. Each bank has its own
> > interrupt.
> > +          items:
> > +            - description: The interrupt for IOMMU bank0
> > +            - description: The interrupt for IOMMU bank1
> > +            - description: The interrupt for IOMMU bank2
> > +            - description: The interrupt for IOMMU bank3
> > +            - description: The interrupt for IOMMU bank4
> > +
> 
> Thanks for improving this.
> 
> Before the meaning for this segment is that it require "mediatek,larbs"
> if it is NOT infra iommu. Here we add a new block for infra iommu.
> then we'd better to remove the "not". this should be more readable.
> Something like below:
> 
> if:
>    /* Remove the not here. */
>    properties:
>      compatible:
>        contains:
>          const: mediatek,mt8195-iommu-infra
> then:
>   xxx
> else:
>   xx
> 

Ok, I'll update in the next version.


Thanks,
TingHan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
index fee0241b50988..5afe2a0045330 100644
--- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
+++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
@@ -91,7 +91,8 @@  properties:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    maxItems: 5
 
   clocks:
     items:
@@ -191,9 +192,24 @@  allOf:
               const: mediatek,mt8195-iommu-infra
 
     then:
+      properties:
+        interrupts:
+          maxItems: 1
+
       required:
         - mediatek,larbs
 
+    else:
+      properties:
+        interrupts:
+          description: The IOMMU has 5 banks. Each bank has its own interrupt.
+          items:
+            - description: The interrupt for IOMMU bank0
+            - description: The interrupt for IOMMU bank1
+            - description: The interrupt for IOMMU bank2
+            - description: The interrupt for IOMMU bank3
+            - description: The interrupt for IOMMU bank4
+
 additionalProperties: false
 
 examples: