aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include/asm/m54xxacr.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/m54xxacr.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/m54xxacr.h')
-rw-r--r--arch/m68k/include/asm/m54xxacr.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h
index 424d4a677e43..da713d22dd0f 100644
--- a/arch/m68k/include/asm/m54xxacr.h
+++ b/arch/m68k/include/asm/m54xxacr.h
@@ -40,4 +40,35 @@
40#define ACR_CM 0x00000060 /* Cache mode mask */ 40#define ACR_CM 0x00000060 /* Cache mode mask */
41#define ACR_WPROTECT 0x00000004 /* Write protect */ 41#define ACR_WPROTECT 0x00000004 /* Write protect */
42 42
43#ifndef __ASSEMBLY__
44
45static inline void __m54xx_flush_cache_all(void)
46{
47 /*
48 * Use cpushl to push and invalidate all cache lines.
49 * Gas doesn't seem to know how to generate the ColdFire
50 * cpushl instruction... Oh well, bit stuff it for now.
51 */
52 __asm__ __volatile__ (
53 "nop\n\t"
54 "clrl %%d0\n\t"
55 "1:\n\t"
56 "movel %%d0,%%a0\n\t"
57 "2:\n\t"
58 ".word 0xf468\n\t"
59 "addl #0x10,%%a0\n\t"
60 "cmpl #0x00000800,%%a0\n\t"
61 "blt 2b\n\t"
62 "addql #1,%%d0\n\t"
63 "cmpil #4,%%d0\n\t"
64 "bne 1b\n\t"
65 "movel #0xb6088500,%%d0\n\t"
66 "movec %%d0,%%CACR\n\t"
67 : : : "d0", "a0" );
68}
69
70#define __flush_cache_all() __m54xx_flush_cache_all()
71
72#endif /* __ASSEMBLY__ */
73
43#endif /* m54xxacr_h */ 74#endif /* m54xxacr_h */