From c3c7ce2a6db6a3c62de65d6d0b940253fcda48ff Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Wed, 12 Nov 2014 15:11:33 -0800 Subject: [PATCH] iommu/arm-smmu: implement DOMAIN_ATTR_PT_BASE_ADDR using ttbr[0] Some clients need to get the base address of the page table for a given IOMMU domain. This functionality is provided by the DOMAIN_ATTR_PT_BASE_ADDR domain attribute. Implement it in the ARM SMMU driver by returning ttbr[0] from the page table config. Change-Id: Ie9b0241c7c7df18b25761bae79c1be1a283ff3a4 Signed-off-by: Mitchel Humpherys --- drivers/iommu/arm-smmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index baddfa084fdd..754a18ec6b8f 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1684,6 +1684,10 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain, *((int *)data) = !!(smmu_domain->attributes & (1 << DOMAIN_ATTR_COHERENT_HTW_DISABLE)); return 0; + case DOMAIN_ATTR_PT_BASE_ADDR: + *((phys_addr_t *)data) = + smmu_domain->pgtbl_cfg.arm_lpae_s1_cfg.ttbr[0]; + return 0; default: return -ENODEV; }