aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include/asm/m53xxacr.h
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2010-11-10 00:22:19 -0500
committerGreg Ungerer <gerg@uclinux.org>2011-01-05 00:19:20 -0500
commit07ffee59a756e3d16295fa1e0a4849c7a2273a13 (patch)
tree07161a81e704f140d1cccd424d9f99df5490908b /arch/m68k/include/asm/m53xxacr.h
parent4a5bae416562a8224707a1ff30e83ddab1474fb3 (diff)
m68knommu: create optimal separate instruction and data cache for ColdFire
Create separate functions to deal with instruction and data cache flushing. This way we can optimize them for the vairous cache types and arrangements used across the ColdFire family. For example the unified caches in the version 3 cores means we don't need to flush the instruction cache. For the version 2 cores that do not do data cacheing (or where we choose instruction cache only) we don't need to do any data flushing. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/include/asm/m53xxacr.h')
-rw-r--r--arch/m68k/include/asm/m53xxacr.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/m68k/include/asm/m53xxacr.h b/arch/m68k/include/asm/m53xxacr.h
index d8b8dd68368f..cd952b0a8bd3 100644
--- a/arch/m68k/include/asm/m53xxacr.h
+++ b/arch/m68k/include/asm/m53xxacr.h
@@ -49,12 +49,29 @@
49#define ACR_WPROTECT 0x00000004 /* Write protect region */ 49#define ACR_WPROTECT 0x00000004 /* Write protect region */
50 50
51/* 51/*
52 * Define the cache type and arrangement (needed for pushes).
53 */
54#if defined(CONFIG_M5307)
55#define CACHE_SIZE 0x2000 /* 8k of unified cache */
56#define ICACHE_SIZE CACHE_SIZE
57#define DCACHE_SIZE CACHE_SIZE
58#elif defined(CONFIG_M532x)
59#define CACHE_SIZE 0x4000 /* 32k of unified cache */
60#define ICACHE_SIZE CACHE_SIZE
61#define DCACHE_SIZE CACHE_SIZE
62#endif
63
64#define CACHE_LINE_SIZE 16 /* 16 byte line size */
65#define CACHE_WAYS 4 /* 4 ways - set associative */
66
67/*
52 * Set the cache controller settings we will use. This default in the 68 * Set the cache controller settings we will use. This default in the
53 * CACR is cache inhibited, we use the ACR register to set cacheing 69 * CACR is cache inhibited, we use the ACR register to set cacheing
54 * enabled on the regions we want (eg RAM). 70 * enabled on the regions we want (eg RAM).
55 */ 71 */
56#if defined(CONFIG_CACHE_COPYBACK) 72#if defined(CONFIG_CACHE_COPYBACK)
57#define CACHE_TYPE ACR_CM_CB 73#define CACHE_TYPE ACR_CM_CB
74#define CACHE_PUSH
58#else 75#else
59#define CACHE_TYPE ACR_CM_WT 76#define CACHE_TYPE ACR_CM_WT
60#endif 77#endif
@@ -65,7 +82,15 @@
65#define CACHE_MODE (CACR_EC + CACR_ESB + CACR_DCM_PRE + CACR_EUSP) 82#define CACHE_MODE (CACR_EC + CACR_ESB + CACR_DCM_PRE + CACR_EUSP)
66#endif 83#endif
67 84
68#define CACHE_INIT CACR_CINVA 85/*
86 * Unified cache means we will never need to flush for coherency of
87 * instruction fetch. We will need to flush to maintain memory/DMA
88 * coherency though in all cases. And for copyback caches we will need
89 * to push cached data as well.
90 */
91#define CACHE_INIT CACR_CINVA
92#define CACHE_INVALIDATE CACR_CINVA
93#define CACHE_INVALIDATED CACR_CINVA
69 94
70#define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \ 95#define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \
71 (0x000f0000) + \ 96 (0x000f0000) + \