diff options
Diffstat (limited to 'arch/m68k/include/asm/m54xxacr.h')
-rw-r--r-- | arch/m68k/include/asm/m54xxacr.h | 31 |
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 | |||
45 | static 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 */ |