Loading arch/arm/include/asm/cacheflush.h +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ extern void __cpuc_flush_dcache_area(void *, size_t); * is visible to DMA, or data written by DMA to system memory is * visible to the CPU. */ extern void __dma_map_area(const void *addr, size_t size, int dir); extern void __dma_unmap_area(const void *addr, size_t size, int dir); extern void dmac_inv_range(const void *, const void *); extern void dmac_clean_range(const void *, const void *); extern void dmac_flush_range(const void *, const void *); Loading arch/arm/include/asm/dma-iommu.h +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ #include <linux/dma-debug.h> #include <linux/kmemcheck.h> #include <linux/kref.h> #include <linux/dma-mapping-fast.h> struct dma_iommu_mapping { /* iommu specific data */ Loading @@ -22,6 +23,8 @@ struct dma_iommu_mapping { spinlock_t lock; struct kref kref; struct dma_fast_smmu_mapping *fast; }; #ifdef CONFIG_ARM_DMA_USE_IOMMU Loading arch/arm/include/asm/glue-cache.h +5 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,11 @@ static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { } #define dmac_flush_range __glue(_CACHE,_dma_flush_range) #define dmac_inv_range __glue(_CACHE, _dma_inv_range) #define dmac_clean_range __glue(_CACHE, _dma_clean_range) #define dmac_map_area __glue(_CACHE, _dma_map_area) #define dmac_unmap_area __glue(_CACHE, _dma_unmap_area) #define __dma_map_area dmac_map_area #define __dma_unmap_area dmac_unmap_area #endif #endif arch/arm/mm/dma-mapping.c +10 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <linux/sizes.h> #include <linux/cma.h> #include <linux/msm_dma_iommu_mapping.h> #include <linux/dma-mapping-fast.h> #include <asm/memory.h> #include <asm/highmem.h> Loading Loading @@ -2331,6 +2332,11 @@ int arm_iommu_attach_device(struct device *dev, { int err; int s1_bypass = 0; int is_fast = 0; iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) return fast_smmu_attach_device(dev, mapping); err = __arm_iommu_attach_device(dev, mapping); if (err) Loading @@ -2347,6 +2353,7 @@ EXPORT_SYMBOL_GPL(arm_iommu_attach_device); static void __arm_iommu_detach_device(struct device *dev) { struct dma_iommu_mapping *mapping; int is_fast; mapping = to_dma_iommu_mapping(dev); if (!mapping) { Loading @@ -2356,6 +2363,9 @@ static void __arm_iommu_detach_device(struct device *dev) if (msm_dma_unmap_all_for_dev(dev)) dev_warn(dev, "IOMMU detach with outstanding mappings\n"); iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) return fast_smmu_detach_device(dev, mapping); iommu_detach_device(mapping->domain, dev); kref_put(&mapping->kref, release_iommu_mapping); Loading arch/arm/mm/dma.h +0 −3 Original line number Diff line number Diff line Loading @@ -4,9 +4,6 @@ #include <asm/glue-cache.h> #ifndef MULTI_CACHE #define dmac_map_area __glue(_CACHE,_dma_map_area) #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) /* * These are private to the dma-mapping API. Do not use directly. * Their sole purpose is to ensure that data held in the cache Loading Loading
arch/arm/include/asm/cacheflush.h +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ extern void __cpuc_flush_dcache_area(void *, size_t); * is visible to DMA, or data written by DMA to system memory is * visible to the CPU. */ extern void __dma_map_area(const void *addr, size_t size, int dir); extern void __dma_unmap_area(const void *addr, size_t size, int dir); extern void dmac_inv_range(const void *, const void *); extern void dmac_clean_range(const void *, const void *); extern void dmac_flush_range(const void *, const void *); Loading
arch/arm/include/asm/dma-iommu.h +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ #include <linux/dma-debug.h> #include <linux/kmemcheck.h> #include <linux/kref.h> #include <linux/dma-mapping-fast.h> struct dma_iommu_mapping { /* iommu specific data */ Loading @@ -22,6 +23,8 @@ struct dma_iommu_mapping { spinlock_t lock; struct kref kref; struct dma_fast_smmu_mapping *fast; }; #ifdef CONFIG_ARM_DMA_USE_IOMMU Loading
arch/arm/include/asm/glue-cache.h +5 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,11 @@ static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { } #define dmac_flush_range __glue(_CACHE,_dma_flush_range) #define dmac_inv_range __glue(_CACHE, _dma_inv_range) #define dmac_clean_range __glue(_CACHE, _dma_clean_range) #define dmac_map_area __glue(_CACHE, _dma_map_area) #define dmac_unmap_area __glue(_CACHE, _dma_unmap_area) #define __dma_map_area dmac_map_area #define __dma_unmap_area dmac_unmap_area #endif #endif
arch/arm/mm/dma-mapping.c +10 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <linux/sizes.h> #include <linux/cma.h> #include <linux/msm_dma_iommu_mapping.h> #include <linux/dma-mapping-fast.h> #include <asm/memory.h> #include <asm/highmem.h> Loading Loading @@ -2331,6 +2332,11 @@ int arm_iommu_attach_device(struct device *dev, { int err; int s1_bypass = 0; int is_fast = 0; iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) return fast_smmu_attach_device(dev, mapping); err = __arm_iommu_attach_device(dev, mapping); if (err) Loading @@ -2347,6 +2353,7 @@ EXPORT_SYMBOL_GPL(arm_iommu_attach_device); static void __arm_iommu_detach_device(struct device *dev) { struct dma_iommu_mapping *mapping; int is_fast; mapping = to_dma_iommu_mapping(dev); if (!mapping) { Loading @@ -2356,6 +2363,9 @@ static void __arm_iommu_detach_device(struct device *dev) if (msm_dma_unmap_all_for_dev(dev)) dev_warn(dev, "IOMMU detach with outstanding mappings\n"); iommu_domain_get_attr(mapping->domain, DOMAIN_ATTR_FAST, &is_fast); if (is_fast) return fast_smmu_detach_device(dev, mapping); iommu_detach_device(mapping->domain, dev); kref_put(&mapping->kref, release_iommu_mapping); Loading
arch/arm/mm/dma.h +0 −3 Original line number Diff line number Diff line Loading @@ -4,9 +4,6 @@ #include <asm/glue-cache.h> #ifndef MULTI_CACHE #define dmac_map_area __glue(_CACHE,_dma_map_area) #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) /* * These are private to the dma-mapping API. Do not use directly. * Their sole purpose is to ensure that data held in the cache Loading