Skip to contentSkip to conversation

iommu/arm-smmu: Support Tegra234 SMMU

PATCH Applied Thierry Reding 2 participants 8 messages Apr 29, 2022 – May 6, 2022

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

v3 cover iommu/arm-smmu: Support Tegra234 SMMU

From: Thierry Reding <[email protected]>

Hi Joerg,

this is essentially a resend of v2 with a Acked-by:s from Robin and Will added. These have been on the list for quite a while now, but apparently there was a misunderstanding, so neither you nor Will picked this up.

Since Will acked these, I think it's probably best for you to pick these up directly. If not, let me know and I'll work with Will to merge via the ARM SMMU tree.

Thanks,
Thierry

Thierry Reding (3):
dt-bindings: arm-smmu: Document nvidia,memory-controller property
dt-bindings: arm-smmu: Add compatible for Tegra234 SOC iommu/arm-smmu: Support Tegra234 SMMU

 .../devicetree/bindings/iommu/arm,smmu.yaml   | 23 +++++++++++++++++--
 drivers/iommu/arm/arm-smmu/arm-smmu-impl.c    |  3 ++-
 2 files changed, 23 insertions(+), 3 deletions(-)
Signature · 6 lines
2.35.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
#1 lore raw

PATCH v3 1/3 dt-bindings: arm-smmu: Document nvidia, memory-controller property

From: Thierry Reding <[email protected]>

On NVIDIA SoC's the ARM SMMU needs to interact with the memory controller in order to map memory clients to the corresponding stream IDs. Document how the nvidia,memory-controller property can be used to achieve this.

Note that this is a backwards-incompatible change that is, however, necessary to ensure correctness. Without the new property, most of the devices would still work but it is not guaranteed that all will.

---
Changes in v2:
- clarify why the new nvidia,memory-controller property is required

 .../devicetree/bindings/iommu/arm,smmu.yaml     | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +17 -0
index da5381c8ee11..44606ad5aa39 100644
@@ -157,6 +157,17 @@ properties:
   power-domains:
     maxItems: 1
 
+  nvidia,memory-controller:
+    description: |
+      A phandle to the memory controller on NVIDIA Tegra186 and later SoCs.
+      The memory controller needs to be programmed with a mapping of memory
+      client IDs to ARM SMMU stream IDs.
+
+      If this property is absent, the mapping programmed by early firmware
+      will be used and it is not guaranteed that IOMMU translations will be
+      enabled for any given device.
+    $ref: /schemas/types.yaml#/definitions/phandle
+
 required:
   - compatible
   - reg
@@ -179,6 +190,12 @@ allOf:
         reg:
           minItems: 1
           maxItems: 2
+
+      # The reference to the memory controller is required to ensure that the
+      # memory client to stream ID mapping can be done synchronously with the
+      # IOMMU attachment.
+      required:
+        - nvidia,memory-controller
     else:
       properties:
         reg:
Signature · 6 lines
2.35.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
#2 lore raw

PATCH v3 2/3 dt-bindings: arm-smmu: Add compatible for Tegra234 SOC

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

The NVIDIA Tegra234 SoC comes with one single-instance ARM SMMU used by isochronous memory clients and two dual-instance ARM SMMUs used by non- isochronous memory clients.

---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +4 -2
index 44606ad5aa39..590cc8dc8323 100644
@@ -62,8 +62,9 @@ properties:
           for improved performance.
         items:
           - enum:
-              - nvidia,tegra194-smmu
               - nvidia,tegra186-smmu
+              - nvidia,tegra194-smmu
+              - nvidia,tegra234-smmu
           - const: nvidia,smmu-500
       - items:
           - const: arm,mmu-500
@@ -183,8 +184,9 @@ allOf:
         compatible:
           contains:
             enum:
-              - nvidia,tegra194-smmu
               - nvidia,tegra186-smmu
+              - nvidia,tegra194-smmu
+              - nvidia,tegra234-smmu
     then:
       properties:
         reg:
Signature · 1 line
2.35.1
#3 lore raw

PATCH v3 3/3 iommu/arm-smmu: Support Tegra234 SMMU

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Allow the NVIDIA-specific ARM SMMU implementation to bind to the SMMU instances found on Tegra234.

---
 drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/arm/arm-smmu/arm-smmu-impl.c +2 -1
index 2c25cce38060..658f3cc83278 100644
@@ -211,7 +211,8 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)
 	if (of_property_read_bool(np, "calxeda,smmu-secure-config-access"))
 		smmu->impl = &calxeda_impl;
 
-	if (of_device_is_compatible(np, "nvidia,tegra194-smmu") ||
+	if (of_device_is_compatible(np, "nvidia,tegra234-smmu") ||
+	    of_device_is_compatible(np, "nvidia,tegra194-smmu") ||
 	    of_device_is_compatible(np, "nvidia,tegra186-smmu"))
 		return nvidia_smmu_impl_init(smmu);
 
Signature · 6 lines
2.35.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
#4 lore raw
In reply to Thierry Reding
Quoted 15 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Hi Joerg,

this is essentially a resend of v2 with a Acked-by:s from Robin and Will added. These have been on the list for quite a while now, but apparently there was a misunderstanding, so neither you nor Will picked this up.

Since Will acked these, I think it's probably best for you to pick these up directly. If not, let me know and I'll work with Will to merge via the ARM SMMU tree.

Thanks,
Thierry

Quoted 8 lines

Thierry Reding (3):
dt-bindings: arm-smmu: Document nvidia,memory-controller property
dt-bindings: arm-smmu: Add compatible for Tegra234 SOC iommu/arm-smmu: Support Tegra234 SMMU

 .../devicetree/bindings/iommu/arm,smmu.yaml   | 23 +++++++++++++++++--
 drivers/iommu/arm/arm-smmu/arm-smmu-impl.c    |  3 ++-
 2 files changed, 23 insertions(+), 3 deletions(-)

Joerg,

anything left to do on this from your perspective, or can this go into v5.19?

Thanks,
Thierry

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#5 lore raw
Quoted 21 lines · Thierry Reding
Quoted 20 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Hi Joerg,

this is essentially a resend of v2 with a Acked-by:s from Robin and Will added. These have been on the list for quite a while now, but apparently there was a misunderstanding, so neither you nor Will picked this up.

Since Will acked these, I think it's probably best for you to pick these up directly. If not, let me know and I'll work with Will to merge via the ARM SMMU tree.

Thanks,
Thierry

Thierry Reding (3):
dt-bindings: arm-smmu: Document nvidia,memory-controller property
dt-bindings: arm-smmu: Add compatible for Tegra234 SOC iommu/arm-smmu: Support Tegra234 SMMU

Quoted 8 lines
Quoted 3 lines
 .../devicetree/bindings/iommu/arm,smmu.yaml   | 23 +++++++++++++++++--
 drivers/iommu/arm/arm-smmu/arm-smmu-impl.c    |  3 ++-
 2 files changed, 23 insertions(+), 3 deletions(-)

Joerg,

anything left to do on this from your perspective, or can this go into v5.19?

I'll pick them up in the Arm SMMU queue, as there are some other SMMU patches kicking around and we may as well keep them all together.

Will

#6 lore raw
Quoted 26 lines · Will Deacon
Quoted 25 lines · Thierry Reding
Quoted 23 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Hi Joerg,

this is essentially a resend of v2 with a Acked-by:s from Robin and Will added. These have been on the list for quite a while now, but apparently there was a misunderstanding, so neither you nor Will picked this up.

Since Will acked these, I think it's probably best for you to pick these up directly. If not, let me know and I'll work with Will to merge via the ARM SMMU tree.

Thanks,
Thierry

Thierry Reding (3):
dt-bindings: arm-smmu: Document nvidia,memory-controller property
dt-bindings: arm-smmu: Add compatible for Tegra234 SOC iommu/arm-smmu: Support Tegra234 SMMU

 .../devicetree/bindings/iommu/arm,smmu.yaml   | 23 +++++++++++++++++--
 drivers/iommu/arm/arm-smmu/arm-smmu-impl.c    |  3 ++-
 2 files changed, 23 insertions(+), 3 deletions(-)
Quoted 7 lines
Quoted 4 lines

Joerg,

anything left to do on this from your perspective, or can this go into v5.19?

I'll pick them up in the Arm SMMU queue, as there are some other SMMU patches kicking around and we may as well keep them all together.

Sounds good, thanks!

Thierry

maintainer Applied
#7 lore raw
In reply to Thierry Reding
Quoted 9 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Hi Joerg,

this is essentially a resend of v2 with a Acked-by:s from Robin and Will added. These have been on the list for quite a while now, but apparently there was a misunderstanding, so neither you nor Will picked this up.

[...]

Applied to will (for-joerg/arm-smmu/updates), thanks!

[1/3] dt-bindings: arm-smmu: Document nvidia,memory-controller property

      https://git.kernel.org/will/c/c02bda09f91a
[2/3] dt-bindings: arm-smmu: Add compatible for Tegra234 SOC
      https://git.kernel.org/will/c/95d5aeabda00
[3/3] iommu/arm-smmu: Support Tegra234 SMMU
      https://git.kernel.org/will/c/5ca216155b5e

Cheers,

Signature · 9 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu