diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-09 08:32:21 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-09 08:32:21 +0100 |
commit | 4680b375b9dd32e6558ae2ee8a15b27819c70e73 (patch) | |
tree | 945cd90ff3557de600e6e208596c7ef846fb603e /arch/arm/include | |
parent | 5544581e98d09c7c9008f9cac8cd25dbb6a14d6e (diff) | |
parent | 0e06a77f5b93d4479ff1b88bc32003ceaa37d152 (diff) | |
download | barebox-4680b375b9dd32e6558ae2ee8a15b27819c70e73.tar.gz barebox-4680b375b9dd32e6558ae2ee8a15b27819c70e73.tar.xz |
Merge branch 'for-next/streaming-dma'
Conflicts:
drivers/mci/dw_mmc.c
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/dma.h | 35 | ||||
-rw-r--r-- | arch/arm/include/asm/io.h | 15 | ||||
-rw-r--r-- | arch/arm/include/asm/mmu.h | 45 |
3 files changed, 49 insertions, 46 deletions
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h index cb9cd1b4ea..d9bce3d70e 100644 --- a/arch/arm/include/asm/dma.h +++ b/arch/arm/include/asm/dma.h @@ -5,4 +5,37 @@ * */ -#include <asm/mmu.h> +#include <common.h> + +#define dma_alloc dma_alloc +static inline void *dma_alloc(size_t size) +{ + return xmemalign(64, ALIGN(size, 64)); +} + +#ifndef CONFIG_MMU +static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle) +{ + void *ret = xmemalign(4096, size); + if (dma_handle) + *dma_handle = (dma_addr_t)ret; + + return ret; +} + +static inline void dma_free_coherent(void *mem, dma_addr_t dma_handle, + size_t size) +{ + free(mem); +} + +static inline void dma_sync_single_for_cpu(unsigned long address, size_t size, + enum dma_data_direction dir) +{ +} + +static inline void dma_sync_single_for_device(unsigned long address, size_t size, + enum dma_data_direction dir) +{ +} +#endif diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 850a99c6d9..eebf0938b0 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -69,4 +69,19 @@ extern void memset_io(volatile void __iomem *, int, size_t); #define setbits_8(addr, set) setbits(8, addr, set) #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set) +#ifdef CONFIG_MMU +void *phys_to_virt(unsigned long phys); +unsigned long virt_to_phys(volatile void *virt); +#else +static inline void *phys_to_virt(unsigned long phys) +{ + return (void *)phys; +} + +static inline unsigned long virt_to_phys(volatile void *mem) +{ + return (unsigned long)mem; +} +#endif + #endif /* __ASM_ARM_IO_H */ diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index c6e425f02d..97bb0dbeb6 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h @@ -26,58 +26,13 @@ static inline void setup_dma_coherent(unsigned long offset) { } -#define dma_alloc dma_alloc -static inline void *dma_alloc(size_t size) -{ - return xmemalign(64, ALIGN(size, 64)); -} - #ifdef CONFIG_MMU -void *dma_alloc_coherent(size_t size); -void dma_free_coherent(void *mem, size_t size); - -void dma_clean_range(unsigned long, unsigned long); -void dma_flush_range(unsigned long, unsigned long); -void dma_inv_range(unsigned long, unsigned long); -unsigned long virt_to_phys(volatile void *virt); -void *phys_to_virt(unsigned long phys); void remap_range(void *_start, size_t size, uint32_t flags); void *map_io_sections(unsigned long physaddr, void *start, size_t size); uint32_t mmu_get_pte_cached_flags(void); uint32_t mmu_get_pte_uncached_flags(void); #else -static inline void *dma_alloc_coherent(size_t size) -{ - return xmemalign(4096, size); -} - -static inline void dma_free_coherent(void *mem, size_t size) -{ - free(mem); -} - -static inline void *phys_to_virt(unsigned long phys) -{ - return (void *)phys; -} - -static inline unsigned long virt_to_phys(volatile void *mem) -{ - return (unsigned long)mem; -} - -static inline void dma_clean_range(unsigned long s, unsigned long e) -{ -} - -static inline void dma_flush_range(unsigned long s, unsigned long e) -{ -} - -static inline void dma_inv_range(unsigned long s, unsigned long e) -{ -} static inline void remap_range(void *_start, size_t size, uint32_t flags) { |