diff options
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/dma-contiguous.h | 15 | ||||
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 18 | ||||
-rw-r--r-- | arch/arm/include/asm/mach/map.h | 4 |
3 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/include/asm/dma-contiguous.h b/arch/arm/include/asm/dma-contiguous.h new file mode 100644 index 0000000..e072bb2 --- /dev/null +++ b/arch/arm/include/asm/dma-contiguous.h @@ -0,0 +1,15 @@ +#ifndef ASMARM_DMA_CONTIGUOUS_H +#define ASMARM_DMA_CONTIGUOUS_H + +#ifdef __KERNEL__ +#ifdef CONFIG_DMA_CMA + +#include <linux/types.h> +#include <asm-generic/dma-contiguous.h> + +void dma_contiguous_early_fixup(phys_addr_t base, unsigned long size); + +#endif +#endif + +#endif diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 4fff837..9ce57c9 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -9,6 +9,9 @@ #include <asm-generic/dma-coherent.h> #include <asm/memory.h> +#ifdef CONFIG_DMA_CMA +#include <linux/dma-contiguous.h> +#endif #ifdef __arch_page_to_dma #error Please update to __arch_pfn_to_dma @@ -172,6 +175,21 @@ static inline void dma_free_noncoherent(struct device *dev, size_t size, { } +#ifdef CONFIG_DMA_CMA +static inline int dma_prepare_alloc_coherent(struct device *dev, size_t size) +{ + int count = PAGE_ALIGN(size) >> PAGE_SHIFT; + int align = get_order(PAGE_ALIGN(size)); + + return dma_prepare_alloc_from_contiguous(dev, count, align); +} +#else +static inline int dma_prepare_alloc_coherent(struct device *dev, size_t size) +{ + return 0; +} +#endif + /** * dma_alloc_coherent - allocate consistent memory for DMA * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h index d2fedb5..4bcef63 100644 --- a/arch/arm/include/asm/mach/map.h +++ b/arch/arm/include/asm/mach/map.h @@ -29,6 +29,10 @@ struct map_desc { #define MT_MEMORY_NONCACHED 11 #define MT_MEMORY_DTCM 12 #define MT_MEMORY_ITCM 13 +#ifdef CONFIG_DMA_CMA +#define MT_MEMORY_SO 14 +#define MT_MEMORY_DMA_READY 15 +#endif #ifdef CONFIG_MMU extern void iotable_init(struct map_desc *, int); |