aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include/asm/cacheflush_no.h
diff options
context:
space:
mode:
authorPhilippe De Muyter <phdm@macqel.be>2010-10-27 08:57:48 -0400
committerGreg Ungerer <gerg@uclinux.org>2011-01-05 00:19:17 -0500
commitb3d75b09bf8998fd302ba339eebbc768a110741b (patch)
treec3273077768dcab76056c4e971f92dff5b5e72ae /arch/m68k/include/asm/cacheflush_no.h
parent5291fa98565a2f4d27ec59380e8497eba2af948d (diff)
m68knommu: Move __flush_cache_all definition for m54xx in m54xxacr.h
__flush_cache_all for m54xx is intrinsically related to the bit definitions in m54xxacr.h. Move it there from cacheflush_no.h, for easier maintenance. Signed-off-by: Philippe De Muyter <phdm@macqel.be> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/include/asm/cacheflush_no.h')
-rw-r--r--arch/m68k/include/asm/cacheflush_no.h28
1 files changed, 5 insertions, 23 deletions
diff --git a/arch/m68k/include/asm/cacheflush_no.h b/arch/m68k/include/asm/cacheflush_no.h
index 7085bd51668b..8fda331f8a83 100644
--- a/arch/m68k/include/asm/cacheflush_no.h
+++ b/arch/m68k/include/asm/cacheflush_no.h
@@ -5,6 +5,9 @@
5 * (C) Copyright 2000-2004, Greg Ungerer <gerg@snapgear.com> 5 * (C) Copyright 2000-2004, Greg Ungerer <gerg@snapgear.com>
6 */ 6 */
7#include <linux/mm.h> 7#include <linux/mm.h>
8#if defined(CONFIG_M5407) || defined(CONFIG_M548x)
9#include <asm/m54xxacr.h>
10#endif
8 11
9#define flush_cache_all() __flush_cache_all() 12#define flush_cache_all() __flush_cache_all()
10#define flush_cache_mm(mm) do { } while (0) 13#define flush_cache_mm(mm) do { } while (0)
@@ -27,31 +30,9 @@
27#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 30#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
28 memcpy(dst, src, len) 31 memcpy(dst, src, len)
29 32
33#ifndef __flush_cache_all
30static inline void __flush_cache_all(void) 34static inline void __flush_cache_all(void)
31{ 35{
32#if defined(CONFIG_M5407) || defined(CONFIG_M548x)
33 /*
34 * Use cpushl to push and invalidate all cache lines.
35 * Gas doesn't seem to know how to generate the ColdFire
36 * cpushl instruction... Oh well, bit stuff it for now.
37 */
38 __asm__ __volatile__ (
39 "nop\n\t"
40 "clrl %%d0\n\t"
41 "1:\n\t"
42 "movel %%d0,%%a0\n\t"
43 "2:\n\t"
44 ".word 0xf468\n\t"
45 "addl #0x10,%%a0\n\t"
46 "cmpl #0x00000800,%%a0\n\t"
47 "blt 2b\n\t"
48 "addql #1,%%d0\n\t"
49 "cmpil #4,%%d0\n\t"
50 "bne 1b\n\t"
51 "movel #0xb6088500,%%d0\n\t"
52 "movec %%d0,%%CACR\n\t"
53 : : : "d0", "a0" );
54#endif /* CONFIG_M5407 */
55#if defined(CONFIG_M523x) || defined(CONFIG_M527x) 36#if defined(CONFIG_M523x) || defined(CONFIG_M527x)
56 __asm__ __volatile__ ( 37 __asm__ __volatile__ (
57 "movel #0x81400100, %%d0\n\t" 38 "movel #0x81400100, %%d0\n\t"
@@ -88,5 +69,6 @@ static inline void __flush_cache_all(void)
88 : : : "d0" ); 69 : : : "d0" );
89#endif /* CONFIG_M532x */ 70#endif /* CONFIG_M532x */
90} 71}
72#endif /* __flush_cache_all */
91 73
92#endif /* _M68KNOMMU_CACHEFLUSH_H */ 74#endif /* _M68KNOMMU_CACHEFLUSH_H */