瀏覽代碼

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>
Sam Ravnborg 13 年之前
父節點
當前提交
95835335a3
共有 1 個文件被更改,包括 4 次插入8 次删除
  1. 4 8
      arch/sparc/kernel/ioport.c

+ 4 - 8
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
 /* 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.
  * 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)
 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_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
 static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys,
 static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys,