Commit fb948251 authored by Robin Murphy's avatar Robin Murphy Committed by Joerg Roedel

iommu/io-pgtable-arm: Support IOMMU_MMIO flag

Teach the LPAE format to create Device mappings when asked.
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Tested-by: default avatarEric Auger <eric.auger@linaro.org>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 31e6850e
...@@ -355,7 +355,10 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, ...@@ -355,7 +355,10 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
if (!(prot & IOMMU_WRITE) && (prot & IOMMU_READ)) if (!(prot & IOMMU_WRITE) && (prot & IOMMU_READ))
pte |= ARM_LPAE_PTE_AP_RDONLY; pte |= ARM_LPAE_PTE_AP_RDONLY;
if (prot & IOMMU_CACHE) if (prot & IOMMU_MMIO)
pte |= (ARM_LPAE_MAIR_ATTR_IDX_DEV
<< ARM_LPAE_PTE_ATTRINDX_SHIFT);
else if (prot & IOMMU_CACHE)
pte |= (ARM_LPAE_MAIR_ATTR_IDX_CACHE pte |= (ARM_LPAE_MAIR_ATTR_IDX_CACHE
<< ARM_LPAE_PTE_ATTRINDX_SHIFT); << ARM_LPAE_PTE_ATTRINDX_SHIFT);
} else { } else {
...@@ -364,7 +367,9 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, ...@@ -364,7 +367,9 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
pte |= ARM_LPAE_PTE_HAP_READ; pte |= ARM_LPAE_PTE_HAP_READ;
if (prot & IOMMU_WRITE) if (prot & IOMMU_WRITE)
pte |= ARM_LPAE_PTE_HAP_WRITE; pte |= ARM_LPAE_PTE_HAP_WRITE;
if (prot & IOMMU_CACHE) if (prot & IOMMU_MMIO)
pte |= ARM_LPAE_PTE_MEMATTR_DEV;
else if (prot & IOMMU_CACHE)
pte |= ARM_LPAE_PTE_MEMATTR_OIWB; pte |= ARM_LPAE_PTE_MEMATTR_OIWB;
else else
pte |= ARM_LPAE_PTE_MEMATTR_NC; pte |= ARM_LPAE_PTE_MEMATTR_NC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment