OSDN Git Service

sparc/leon: Make mmu_inval_dma_area flush dcache for LEONs without snooping enabled.
authorKristoffer Glembo <kristoffer@gaisler.com>
Tue, 18 Jan 2011 04:10:27 +0000 (04:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Mar 2011 01:18:58 +0000 (18:18 -0700)
Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/ioport.c

index b817481..815003b 100644 (file)
 #include <asm/io-unit.h>
 #include <asm/leon.h>
 
-#ifdef CONFIG_SPARC_LEON
-#define mmu_inval_dma_area(p, l) leon_flush_dcache_all()
-#else
+#ifndef CONFIG_SPARC_LEON
 #define mmu_inval_dma_area(p, l)       /* Anton pulled it out for 2.4.0-xx */
+#else
+static inline void mmu_inval_dma_area(unsigned long va, unsigned long len)
+{
+       if (!sparc_leon3_snooping_enabled())
+               leon_flush_dcache_all();
+}
 #endif
 
 static struct resource *_sparc_find_resource(struct resource *r,