iommu: io-pgtable-arm: add support for IOMMU_DEVICE
Clients might want to map device memory into their SMMU. Add support for these device mappings through the IOMMU_DEVICE flag. Change-Id: I756720181aa0d531f4c56453ef832f81b36ffccd Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
parent
97088977b0
commit
3e7d85603a
1 changed files with 7 additions and 0 deletions
|
@ -284,6 +284,10 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
|
|||
if (prot & IOMMU_CACHE)
|
||||
pte |= (ARM_LPAE_MAIR_ATTR_IDX_CACHE
|
||||
<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
|
||||
|
||||
if (prot & IOMMU_DEVICE)
|
||||
pte |= (ARM_LPAE_MAIR_ATTR_IDX_DEV <<
|
||||
ARM_LPAE_PTE_ATTRINDX_SHIFT);
|
||||
} else {
|
||||
pte = ARM_LPAE_PTE_HAP_FAULT;
|
||||
if (prot & IOMMU_READ)
|
||||
|
@ -294,6 +298,9 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
|
|||
pte |= ARM_LPAE_PTE_MEMATTR_OIWB;
|
||||
else
|
||||
pte |= ARM_LPAE_PTE_MEMATTR_NC;
|
||||
|
||||
if (prot & IOMMU_DEVICE)
|
||||
pte |= ARM_LPAE_PTE_MEMATTR_DEV;
|
||||
}
|
||||
|
||||
if (prot & IOMMU_NOEXEC)
|
||||
|
|
Loading…
Add table
Reference in a new issue