diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2014-10-09 18:26:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:25:52 -0400 |
commit | 513510ddba9650fc7da456eefeb0ead7632324f6 (patch) | |
tree | 8e21369797216203ba554d99d031403c5b8d95cb /include/asm-generic | |
parent | 9efb3a421d55d30b65fb0dbee05108d15c6c55f7 (diff) |
common: dma-mapping: introduce common remapping functions
For architectures without coherent DMA, memory for DMA may need to be
remapped with coherent attributes. Factor out the the remapping code from
arm and put it in a common location to reduce code duplication.
As part of this, the arm APIs are now migrated away from
ioremap_page_range to the common APIs which use map_vm_area for remapping.
This should be an equivalent change and using map_vm_area is more correct
as ioremap_page_range is intended to bring in io addresses into the cpu
space and not regular kernel managed memory.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Riley <davidriley@chromium.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: Ritesh Harjain <ritesh.harjani@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Laura Abbott <lauraa@codeaurora.org>
Cc: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/dma-mapping-common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index de8bf89940f8..a9fd248f5d48 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h | |||
@@ -179,6 +179,15 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
179 | extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, | 179 | extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, |
180 | void *cpu_addr, dma_addr_t dma_addr, size_t size); | 180 | void *cpu_addr, dma_addr_t dma_addr, size_t size); |
181 | 181 | ||
182 | void *dma_common_contiguous_remap(struct page *page, size_t size, | ||
183 | unsigned long vm_flags, | ||
184 | pgprot_t prot, const void *caller); | ||
185 | |||
186 | void *dma_common_pages_remap(struct page **pages, size_t size, | ||
187 | unsigned long vm_flags, pgprot_t prot, | ||
188 | const void *caller); | ||
189 | void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags); | ||
190 | |||
182 | /** | 191 | /** |
183 | * dma_mmap_attrs - map a coherent DMA allocation into user space | 192 | * dma_mmap_attrs - map a coherent DMA allocation into user space |
184 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices | 193 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices |