OSDN Git Service

iommu: introduce TTBR0, CONTEXTIDR, and PROCID domain attributes
authorJeremy Gebben <jgebben@codeaurora.org>
Fri, 10 Jul 2015 22:43:22 +0000 (16:43 -0600)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:13:35 +0000 (11:13 -0700)
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 <jgebben@codeaurora.org>
include/linux/iommu.h

index 520cc5b..74e7bee 100644 (file)
@@ -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,
 };