From ee954ddc28a969830117ef69325729f36195248d Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Fri, 10 Jul 2015 16:43:22 -0600 Subject: [PATCH] iommu: introduce TTBR0, CONTEXTIDR, and PROCID domain attributes In the ARM SMMU architecture, pagetable programming is controlled by the TTBR0 and CONTEXTIDR registers. The layout of these registers varies depending on the pagetable format in use. In particular, the ASID (address space ID) field is found in CONTEXTIDR when using V7S format and in the top bits of TTBR0 for V7L and V8L. Some drivers need to program hardware to switch domains on the fly. These attributes allow the correct settings to be determined by querying the domain rather than directly reading registers and making assumptions about the pagetable format. The domain must be attached before TTBR0 and CONTEXTIDR may be queried. The PROCID attribute allows driver set a debug field in the CONTEXTIDR register. This attribute may only be set before attaching, but may be queried at any time. The SMMU hardware doesn't use the contents of this field, but debug can be simpler if each domain stores a unique value in it. Change-Id: I175aa78fee02c3e4e0071496d9cc2b8841ff9e3c Signed-off-by: Jeremy Gebben --- include/linux/iommu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 520cc5b4dae1..74e7bee7c08a 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -94,6 +94,9 @@ enum iommu_attr { DOMAIN_ATTR_SECURE_VMID, DOMAIN_ATTR_ATOMIC, DOMAIN_ATTR_CONTEXT_BANK, + DOMAIN_ATTR_TTBR0, + DOMAIN_ATTR_CONTEXTIDR, + DOMAIN_ATTR_PROCID, DOMAIN_ATTR_MAX, }; -- 2.11.0