Skip to contentSkip to conversation

dt-bindings: iommu: Describe MT8195 infra IRQs

PATCH Superseded Rob Herring (Arm) 2 participants 3 messages Sep 21 – Sep 23

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: iommu: Describe MT8195 infra IRQs

The MT8195 infra IOMMU has one fault interrupt per IOMMU bank. Require the five bank interrupts, named bank0 through bank4, for this compatible. Keep other MediaTek IOMMUs limited to one unnamed interrupt.

Assisted-by LLM
---
 .../bindings/iommu/mediatek,iommu.yaml        | 30 ++++++++++++++++++-
 arch/arm64/boot/dts/mediatek/mt8195.dtsi      |  2 ++
 2 files changed, 31 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +29 -1
index 79c573c47b08..4dc5621c17e1 100644
@@ -100,7 +100,11 @@ properties:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    maxItems: 5
+
+  interrupt-names:
+    description: Names of IOMMU banks providing fault interrupts.
 
   clocks:
     items:
@@ -155,6 +159,30 @@ required:
   - '#iommu-cells'
 
 allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8195-iommu-infra
+    then:
+      properties:
+        interrupts:
+          minItems: 5
+        interrupt-names:
+          items:
+            - const: bank0
+            - const: bank1
+            - const: bank2
+            - const: bank3
+            - const: bank4
+      required:
+        - interrupt-names
+    else:
+      properties:
+        interrupts:
+          maxItems: 1
+        interrupt-names: false
+
   - if:
       properties:
         compatible:
arch/arm64/boot/dts/mediatek/mt8195.dtsi +2 -0
index 9aaf8b6edcb5..3e46ffaa44c6 100644
@@ -937,6 +937,8 @@ iommu_infra: infra-iommu@10315000 {
 				     <GIC_SPI 797 IRQ_TYPE_LEVEL_HIGH 0>,
 				     <GIC_SPI 798 IRQ_TYPE_LEVEL_HIGH 0>,
 				     <GIC_SPI 799 IRQ_TYPE_LEVEL_HIGH 0>;
+			interrupt-names = "bank0", "bank1", "bank2", "bank3",
+					  "bank4";
 			#iommu-cells = <1>;
 		};
 
Signature · 1 line
2.53.0
#1 lore raw
Quoted 4 lines · Rob Herring (Arm)

The MT8195 infra IOMMU has one fault interrupt per IOMMU bank. Require the five bank interrupts, named bank0 through bank4, for this compatible. Keep other MediaTek IOMMUs limited to one unnamed interrupt.

Why are you introducing interrupt-names, and why would that be a required property?

I disagree - interrupt names are not necessary here.

Cheers,
Angelo

Quoted 68 lines
Assisted-by LLM
---
  .../bindings/iommu/mediatek,iommu.yaml        | 30 ++++++++++++++++++-
  arch/arm64/boot/dts/mediatek/mt8195.dtsi      |  2 ++
  2 files changed, 31 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +29 -1
index 79c573c47b08..4dc5621c17e1 100644
@@ -100,7 +100,11 @@ properties:
      maxItems: 1
 
    interrupts:
-    maxItems: 1
+    minItems: 1
+    maxItems: 5
+
+  interrupt-names:
+    description: Names of IOMMU banks providing fault interrupts.
 
    clocks:
      items:
@@ -155,6 +159,30 @@ required:
    - '#iommu-cells'
 
  allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8195-iommu-infra
+    then:
+      properties:
+        interrupts:
+          minItems: 5
+        interrupt-names:
+          items:
+            - const: bank0
+            - const: bank1
+            - const: bank2
+            - const: bank3
+            - const: bank4
+      required:
+        - interrupt-names
+    else:
+      properties:
+        interrupts:
+          maxItems: 1
+        interrupt-names: false
+
    - if:
        properties:
          compatible:
arch/arm64/boot/dts/mediatek/mt8195.dtsi +2 -0
index 9aaf8b6edcb5..3e46ffaa44c6 100644
@@ -937,6 +937,8 @@ iommu_infra: infra-iommu@10315000 {
  				     <GIC_SPI 797 IRQ_TYPE_LEVEL_HIGH 0>,
  				     <GIC_SPI 798 IRQ_TYPE_LEVEL_HIGH 0>,
  				     <GIC_SPI 799 IRQ_TYPE_LEVEL_HIGH 0>;
+			interrupt-names = "bank0", "bank1", "bank2", "bank3",
+					  "bank4";
  			#iommu-cells = <1>;
  		};
 
author maintainer
#2 lore raw
Quoted 9 lines · AngeloGioacchino Del Regno
Quoted 4 lines · Rob Herring (Arm)

The MT8195 infra IOMMU has one fault interrupt per IOMMU bank. Require the five bank interrupts, named bank0 through bank4, for this compatible. Keep other MediaTek IOMMUs limited to one unnamed interrupt.

Why are you introducing interrupt-names, and why would that be a required property?

I disagree - interrupt names are not necessary here.

I agree. Not enough review of this one on my part.

Rob