diff options
Diffstat (limited to 'arch/arm/plat-omap/iovmm.c')
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index ea7eab98a736..51ef43e8def6 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c | |||
@@ -279,7 +279,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, | |||
279 | start = da; | 279 | start = da; |
280 | alignment = PAGE_SIZE; | 280 | alignment = PAGE_SIZE; |
281 | 281 | ||
282 | if (flags & IOVMF_DA_ANON) { | 282 | if (~flags & IOVMF_DA_FIXED) { |
283 | /* Don't map address 0 */ | 283 | /* Don't map address 0 */ |
284 | start = obj->da_start ? obj->da_start : alignment; | 284 | start = obj->da_start ? obj->da_start : alignment; |
285 | 285 | ||
@@ -304,7 +304,7 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, | |||
304 | if (tmp->da_start > start && (tmp->da_start - start) >= bytes) | 304 | if (tmp->da_start > start && (tmp->da_start - start) >= bytes) |
305 | goto found; | 305 | goto found; |
306 | 306 | ||
307 | if (tmp->da_end >= start && flags & IOVMF_DA_ANON) | 307 | if (tmp->da_end >= start && ~flags & IOVMF_DA_FIXED) |
308 | start = roundup(tmp->da_end + 1, alignment); | 308 | start = roundup(tmp->da_end + 1, alignment); |
309 | 309 | ||
310 | prev_end = tmp->da_end; | 310 | prev_end = tmp->da_end; |
@@ -651,7 +651,6 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, | |||
651 | flags &= IOVMF_HW_MASK; | 651 | flags &= IOVMF_HW_MASK; |
652 | flags |= IOVMF_DISCONT; | 652 | flags |= IOVMF_DISCONT; |
653 | flags |= IOVMF_MMIO; | 653 | flags |= IOVMF_MMIO; |
654 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
655 | 654 | ||
656 | da = __iommu_vmap(obj, da, sgt, va, bytes, flags); | 655 | da = __iommu_vmap(obj, da, sgt, va, bytes, flags); |
657 | if (IS_ERR_VALUE(da)) | 656 | if (IS_ERR_VALUE(da)) |
@@ -691,7 +690,7 @@ EXPORT_SYMBOL_GPL(iommu_vunmap); | |||
691 | * @flags: iovma and page property | 690 | * @flags: iovma and page property |
692 | * | 691 | * |
693 | * Allocate @bytes linearly and creates 1-n-1 mapping and returns | 692 | * Allocate @bytes linearly and creates 1-n-1 mapping and returns |
694 | * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set. | 693 | * @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set. |
695 | */ | 694 | */ |
696 | u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | 695 | u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) |
697 | { | 696 | { |
@@ -710,7 +709,6 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | |||
710 | flags &= IOVMF_HW_MASK; | 709 | flags &= IOVMF_HW_MASK; |
711 | flags |= IOVMF_DISCONT; | 710 | flags |= IOVMF_DISCONT; |
712 | flags |= IOVMF_ALLOC; | 711 | flags |= IOVMF_ALLOC; |
713 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
714 | 712 | ||
715 | sgt = sgtable_alloc(bytes, flags, da, 0); | 713 | sgt = sgtable_alloc(bytes, flags, da, 0); |
716 | if (IS_ERR(sgt)) { | 714 | if (IS_ERR(sgt)) { |
@@ -781,7 +779,7 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va, | |||
781 | * @flags: iovma and page property | 779 | * @flags: iovma and page property |
782 | * | 780 | * |
783 | * Creates 1-1-1 mapping and returns @da again, which can be | 781 | * Creates 1-1-1 mapping and returns @da again, which can be |
784 | * adjusted if 'IOVMF_DA_ANON' is set. | 782 | * adjusted if 'IOVMF_DA_FIXED' is not set. |
785 | */ | 783 | */ |
786 | u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, | 784 | u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, |
787 | u32 flags) | 785 | u32 flags) |
@@ -800,7 +798,6 @@ u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, | |||
800 | flags &= IOVMF_HW_MASK; | 798 | flags &= IOVMF_HW_MASK; |
801 | flags |= IOVMF_LINEAR; | 799 | flags |= IOVMF_LINEAR; |
802 | flags |= IOVMF_MMIO; | 800 | flags |= IOVMF_MMIO; |
803 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
804 | 801 | ||
805 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); | 802 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); |
806 | if (IS_ERR_VALUE(da)) | 803 | if (IS_ERR_VALUE(da)) |
@@ -839,7 +836,7 @@ EXPORT_SYMBOL_GPL(iommu_kunmap); | |||
839 | * @flags: iovma and page property | 836 | * @flags: iovma and page property |
840 | * | 837 | * |
841 | * Allocate @bytes linearly and creates 1-1-1 mapping and returns | 838 | * Allocate @bytes linearly and creates 1-1-1 mapping and returns |
842 | * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set. | 839 | * @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set. |
843 | */ | 840 | */ |
844 | u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | 841 | u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) |
845 | { | 842 | { |
@@ -859,7 +856,6 @@ u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | |||
859 | flags &= IOVMF_HW_MASK; | 856 | flags &= IOVMF_HW_MASK; |
860 | flags |= IOVMF_LINEAR; | 857 | flags |= IOVMF_LINEAR; |
861 | flags |= IOVMF_ALLOC; | 858 | flags |= IOVMF_ALLOC; |
862 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
863 | 859 | ||
864 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); | 860 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); |
865 | if (IS_ERR_VALUE(da)) | 861 | if (IS_ERR_VALUE(da)) |