aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2017-04-10 07:20:59 -0400
committerJoerg Roedel <jroedel@suse.de>2017-04-20 10:31:06 -0400
commit1d9029d440e40b276c0691caed1de10c42d96bef (patch)
tree33b6bdb0a549f369d0288fea4e250983f3d749c8
parent3f1866779cf8338e1c8bd32e5f6f5424795ef191 (diff)
ACPI/IORT: Add function to check SMMUs drivers presence
The IOMMU probe deferral implementation requires a mechanism to detect if drivers for SMMU components are built-in in the kernel to detect whether IOMMU configuration for a given device should be deferred (ie SMMU drivers present but still not probed) or not (drivers not present). Add a simple function to IORT to detect if SMMU drivers for SMMU components managed by IORT are built-in in the kernel. Tested-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Cc: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/acpi/arm64/iort.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 4a5bb967250b..3dd9ec372dae 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -523,6 +523,19 @@ static int arm_smmu_iort_xlate(struct device *dev, u32 streamid,
523 return ret; 523 return ret;
524} 524}
525 525
526static inline bool iort_iommu_driver_enabled(u8 type)
527{
528 switch (type) {
529 case ACPI_IORT_NODE_SMMU_V3:
530 return IS_BUILTIN(CONFIG_ARM_SMMU_V3);
531 case ACPI_IORT_NODE_SMMU:
532 return IS_BUILTIN(CONFIG_ARM_SMMU);
533 default:
534 pr_warn("IORT node type %u does not describe an SMMU\n", type);
535 return false;
536 }
537}
538
526static const struct iommu_ops *iort_iommu_xlate(struct device *dev, 539static const struct iommu_ops *iort_iommu_xlate(struct device *dev,
527 struct acpi_iort_node *node, 540 struct acpi_iort_node *node,
528 u32 streamid) 541 u32 streamid)