From b60f187fecee5d9dceb89773e15f976fe21d893a Mon Sep 17 00:00:00 2001 From: Greg Ungerer <gerg@uclinux.org> Date: Tue, 26 Jun 2012 21:02:54 +1000 Subject: m68k: use simpler dma_alloc_coherent() for ColdFire CPUs On all ColdFire platforms (whether MMU enabled or not) we want to use the simple page based dma_alloc_coherent. We don't want the virtual mapping version that is used on classic m68k setups. So modify the conditionals to use the existing simpler dma_alloc_coherent on all ColdFire and non-MMU builds. Signed-off-by: Greg Ungerer <gerg@uclinux.org> --- arch/m68k/kernel/dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/m68k/kernel/dma.c') diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index f6daf6e15d2..27b5821f971 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c @@ -16,7 +16,7 @@ #include <asm/pgalloc.h> -#ifdef CONFIG_MMU +#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE) void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t flag) @@ -96,7 +96,7 @@ void dma_free_coherent(struct device *dev, size_t size, free_pages((unsigned long)vaddr, get_order(size)); } -#endif /* CONFIG_MMU */ +#endif /* CONFIG_MMU && !CONFIG_COLDFIRE */ EXPORT_SYMBOL(dma_alloc_coherent); EXPORT_SYMBOL(dma_free_coherent); -- cgit v1.2.3-70-g09d2 From d2661c621525956dfdd1e66e1e4fd94b7e4b6ed5 Mon Sep 17 00:00:00 2001 From: Greg Ungerer <gerg@uclinux.org> Date: Tue, 10 Jul 2012 13:50:58 +1000 Subject: m68k: add support for DMA_BIDIRECTIONAL in dma support functions The dma cache support functions do not currently support the direction flag DMA_BIDIRECTIONAL. If a driver passes this direction to dma_map_single or friends you will get console output like this: dma_sync_single_for_device: unsupported dir 0 For example when using the Intel e100 ethernet driver on a ColdFire platform with PCI bus. You will get a stream of these messages coming out. Modify the dma cache support code adding support for DMA_BIDIRECTIONAL. It is actioned by doing a cache push operation. Signed-off-by: Greg Ungerer <gerg@uclinux.org> --- arch/m68k/kernel/dma.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/m68k/kernel/dma.c') diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index 27b5821f971..e546a5534dd 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c @@ -105,6 +105,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) { switch (dir) { + case DMA_BIDIRECTIONAL: case DMA_TO_DEVICE: cache_push(handle, size); break; -- cgit v1.2.3-70-g09d2