summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Mhetre <amhetre@nvidia.com>2026-01-13 08:49:33 +0300
committerWill Deacon <will@kernel.org>2026-01-22 18:12:08 +0300
commitea69dc4e207b09fb9adb6dab1901739d64853090 (patch)
tree3980de9a507160b107b87d38e1c1d0273b6fe678
parenteb20758f86723bb94d30747fca7b65ed2e6846b8 (diff)
downloadlinux-ea69dc4e207b09fb9adb6dab1901739d64853090.tar.xz
iommu/arm-smmu-v3: Add device-tree support for CMDQV driver
Add device tree support to the CMDQV driver to enable usage on Tegra264 SoCs. The implementation parses the nvidia,cmdqv phandle from the SMMU device tree node to associate each SMMU with its corresponding CMDQV instance based on compatible string. Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Ashish Mhetre <amhetre@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 322abd6be8dc..504d7880ce5a 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -4533,6 +4533,35 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
return 0;
}
+#ifdef CONFIG_TEGRA241_CMDQV
+static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
+ struct arm_smmu_device *smmu)
+{
+ struct platform_device *pdev;
+ struct device_node *np;
+
+ np = of_parse_phandle(smmu_node, "nvidia,cmdqv", 0);
+ if (!np)
+ return;
+
+ /* Tegra241 CMDQV driver is responsible for put_device() */
+ pdev = of_find_device_by_node(np);
+ of_node_put(np);
+ if (!pdev)
+ return;
+
+ smmu->impl_dev = &pdev->dev;
+ smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV;
+ dev_dbg(smmu->dev, "found companion CMDQV device: %s\n",
+ dev_name(smmu->impl_dev));
+}
+#else
+static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
+ struct arm_smmu_device *smmu)
+{
+}
+#endif
+
#ifdef CONFIG_ACPI
#ifdef CONFIG_TEGRA241_CMDQV
static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node,
@@ -4638,6 +4667,9 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev,
if (of_dma_is_coherent(dev->of_node))
smmu->features |= ARM_SMMU_FEAT_COHERENCY;
+ if (of_device_is_compatible(dev->of_node, "nvidia,tegra264-smmu"))
+ tegra_cmdqv_dt_probe(dev->of_node, smmu);
+
return ret;
}