diff options
| -rw-r--r-- | arch/m68k/include/asm/cacheflush_no.h | 28 | ||||
| -rw-r--r-- | arch/m68k/include/asm/m54xxacr.h | 31 |
2 files changed, 36 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 | ||
| 30 | static inline void __flush_cache_all(void) | 34 | static 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 */ |
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 */ |
