Skip to content

Commit ea69dc4

Browse files
ashishmhetre8willdeacon
authored andcommitted
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>
1 parent eb20758 commit ea69dc4

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4533,6 +4533,35 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
45334533
return 0;
45344534
}
45354535

4536+
#ifdef CONFIG_TEGRA241_CMDQV
4537+
static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
4538+
struct arm_smmu_device *smmu)
4539+
{
4540+
struct platform_device *pdev;
4541+
struct device_node *np;
4542+
4543+
np = of_parse_phandle(smmu_node, "nvidia,cmdqv", 0);
4544+
if (!np)
4545+
return;
4546+
4547+
/* Tegra241 CMDQV driver is responsible for put_device() */
4548+
pdev = of_find_device_by_node(np);
4549+
of_node_put(np);
4550+
if (!pdev)
4551+
return;
4552+
4553+
smmu->impl_dev = &pdev->dev;
4554+
smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV;
4555+
dev_dbg(smmu->dev, "found companion CMDQV device: %s\n",
4556+
dev_name(smmu->impl_dev));
4557+
}
4558+
#else
4559+
static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
4560+
struct arm_smmu_device *smmu)
4561+
{
4562+
}
4563+
#endif
4564+
45364565
#ifdef CONFIG_ACPI
45374566
#ifdef CONFIG_TEGRA241_CMDQV
45384567
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,
46384667
if (of_dma_is_coherent(dev->of_node))
46394668
smmu->features |= ARM_SMMU_FEAT_COHERENCY;
46404669

4670+
if (of_device_is_compatible(dev->of_node, "nvidia,tegra264-smmu"))
4671+
tegra_cmdqv_dt_probe(dev->of_node, smmu);
4672+
46414673
return ret;
46424674
}
46434675

0 commit comments

Comments
 (0)