Skip to contentSkip to conversation

dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234

PATCH In review Vishwaroop A 3 participants 3 messages May 6, 2025 – May 14, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: spi: nvidia,tegra210-quad: Add IOMMU property for Tegra234

The Tegra210 Quad SPI controller uses internal DMA engines to efficiently transfer data between system memory and the SPI bus. On Tegra234 platform, DMA transactions must be properly mapped and protected through IOMMU to ensure system security and functional correctness. Tegra241 uses external DMA and doesn't require IOMMU.

Add the iommus property to the device tree binding, making it required only for Tegra234 platform while explicitly disallowing it for other platforms including Tegra241.

---
 .../bindings/spi/nvidia,tegra210-quad.yaml    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml +22 -0
index 48e97e240265..ac79cb19c81a 100644
@@ -12,6 +12,25 @@ maintainers:
 
 allOf:
   - $ref: spi-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra234-qspi
+    then:
+      required:
+        - iommus
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra210-qspi
+            - nvidia,tegra186-qspi
+            - nvidia,tegra194-qspi
+            - nvidia,tegra241-qspi
+    then:
+      properties:
+        iommus: false
 
 properties:
   compatible:
@@ -47,6 +66,9 @@ properties:
       - const: rx
       - const: tx
 
+  iommus:
+    maxItems: 1
+
 patternProperties:
   "@[0-9a-f]+$":
     type: object
Signature · 1 line
2.17.1
#1 lore raw
Quoted 11 lines · Vishwaroop A

The Tegra210 Quad SPI controller uses internal DMA engines to efficiently transfer data between system memory and the SPI bus. On Tegra234 platform, DMA transactions must be properly mapped and protected through IOMMU to ensure system security and functional correctness. Tegra241 uses external DMA and doesn't require IOMMU.

Add the iommus property to the device tree binding, making it required only for Tegra234 platform while explicitly disallowing it for other platforms including Tegra241.

That's another v2? I reviewed one. Some of my comments are still valid. Can you slow down with new versions and spend some time to read the feedback you receive?

Best regards,
Krzysztof

maintainer
#2 lore raw
In reply to Vishwaroop A
Quoted 20 lines · Vishwaroop A

The Tegra210 Quad SPI controller uses internal DMA engines to efficiently transfer data between system memory and the SPI bus. On Tegra234 platform, DMA transactions must be properly mapped and protected through IOMMU to ensure system security and functional correctness. Tegra241 uses external DMA and doesn't require IOMMU.

Add the iommus property to the device tree binding, making it required only for Tegra234 platform while explicitly disallowing it for other platforms including Tegra241.

---
 .../bindings/spi/nvidia,tegra210-quad.yaml    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml +0 -0
index 48e97e240265..ac79cb19c81a 100644

Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml maintainers: · line 17

Quoted 6 lines
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml +3 -0
@@ -12,6 +12,25 @@ maintainers:
 
 allOf:
   - $ref: spi-controller.yaml#
+  - if:
+      properties:
+        compatible:

Use 'contains' here so if this is ever a fallback, it works for that case.

Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml maintainers: · line 30

Quoted 13 lines
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml +13 -0
+          enum:
+            - nvidia,tegra234-qspi
+    then:
+      required:
+        - iommus
+  - if:
+      properties:
+        compatible:
+          enum:
+            - nvidia,tegra210-qspi
+            - nvidia,tegra186-qspi
+            - nvidia,tegra194-qspi
+            - nvidia,tegra241-qspi

Shouldn't this just be an 'else'? I suppose sometimes an IOMMU might not be enabled, but that's policy. Either the h/w has an IOMMU or it doesn't.

Quoted 19 lines
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml +6 -0
+    then:
+      properties:
+        iommus: false
 
 properties:
   compatible:
@@ -47,6 +66,9 @@ properties:
       - const: rx
       - const: tx
 
+  iommus:
+    maxItems: 1
+
 patternProperties:
   "@[0-9a-f]+$":
     type: object
Signature · 1 line
2.17.1