[PATCH 5/5] [Nios2]: Fix dma mapping end address

franck.jullien at gmail.com franck.jullien at gmail.com
Sun May 15 15:34:32 EDT 2011


From: Franck JULLIEN <franck.jullien at gmail.com>

The flush_dcache_range function takes an absolute end address
so we have to add start address to the second parameter.

Signed-off-by: Franck JULLIEN <franck.jullien at gmail.com>
---
 arch/nios2/include/asm/dma-mapping.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h
index 49ebf79..5b70f4c 100644
--- a/arch/nios2/include/asm/dma-mapping.h
+++ b/arch/nios2/include/asm/dma-mapping.h
@@ -15,7 +15,7 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
 	void *addr = malloc(len + DCACHE_LINE_SIZE);
 	if (!addr)
 		return 0;
-	flush_dcache_range((unsigned long)addr, len + DCACHE_LINE_SIZE);
+	flush_dcache_range((unsigned long)addr,(unsigned long)addr + len + DCACHE_LINE_SIZE);
 	*handle = ((unsigned long)addr +
 		   (DCACHE_LINE_SIZE - 1)) &
 		~(DCACHE_LINE_SIZE - 1) & ~(IO_REGION_BASE);
-- 
1.7.0.4




More information about the barebox mailing list