iommu/arm-smmu: Implement DOMAIN_ATTR_PGTBL_INFO
The DOMAIN_ATTR_PGTBL_INFO attribute will be useful in implementing DMA
APIs that can leverage the fast page table mapping routines. Implement
it.
CRs-Fixed: 997751
Change-Id: Id3acec0089b126e7d6ad44d8d322bf473614f716
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index e4f9ba8..e95744f 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2572,6 +2572,17 @@
*((int *)data) = smmu_domain->secure_vmid;
ret = 0;
break;
+ case DOMAIN_ATTR_PGTBL_INFO: {
+ struct iommu_pgtbl_info *info = data;
+
+ if (!(smmu_domain->attributes & (1 << DOMAIN_ATTR_FAST))) {
+ ret = -ENODEV;
+ break;
+ }
+ info->pmds = smmu_domain->pgtbl_cfg.av8l_fast_cfg.pmds;
+ ret = 0;
+ break;
+ }
default:
return -ENODEV;
}