summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-05-26 04:43:29 +0000
committerDavid S. Miller <davem@davemloft.net>2012-05-27 23:52:54 -0700
commit95835335a3c187f418e86b453e1716cb5aad17be (patch)
treed1280fb831f602182454c30d379d99f489ab8913
parent87e677c4122e732dd1f7142ba7b2d4823576a199 (diff)
downloadop-kernel-dev-95835335a3c187f418e86b453e1716cb5aad17be.zip
op-kernel-dev-95835335a3c187f418e86b453e1716cb5aad17be.tar.gz
sparc32: support leon + sun in dma_make_coherent()
No need for two implementations - we check the cpu model. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com>
-rw-r--r--arch/sparc/kernel/ioport.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 8bc4db0..f00945b 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -55,17 +55,13 @@ const struct sparc32_dma_ops *sparc32_dma_ops;
/* This function must make sure that caches and memory are coherent after DMA
* On LEON systems without cache snooping it flushes the entire D-CACHE.
*/
-#ifndef CONFIG_SPARC_LEON
static inline void dma_make_coherent(unsigned long pa, unsigned long len)
{
+ if (sparc_cpu_model == sparc_leon) {
+ if (!sparc_leon3_snooping_enabled())
+ leon_flush_dcache_all();
+ }
}
-#else
-static inline void dma_make_coherent(unsigned long pa, unsigned long len)
-{
- if (!sparc_leon3_snooping_enabled())
- leon_flush_dcache_all();
-}
-#endif
static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys,
OpenPOWER on IntegriCloud