diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-07-31 04:07:28 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-09-20 22:57:46 -0400 |
commit | e7bd34a15b85655f24d1b45edbe3bdfebf9d027e (patch) | |
tree | 051647273266582fe95dcc5cf008534c264be5ae /arch/sh/kernel/cpu/init.c | |
parent | ac919986d7dfc5d1d9f5585521307f222a8ebeaf (diff) |
sh: Support explicit L1 cache disabling.
This reworks the cache mode configuration in Kconfig, and allows for
explicit selection of write-back/write-through/off configurations.
All of the cache flushing routines are optimized away for the off
case.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/init.c')
-rw-r--r-- | arch/sh/kernel/cpu/init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index 9172e97dc26a..fdc245b7b043 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
@@ -143,12 +143,15 @@ static void __init cache_init(void) | |||
143 | flags &= ~CCR_CACHE_EMODE; | 143 | flags &= ~CCR_CACHE_EMODE; |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | #ifdef CONFIG_SH_WRITETHROUGH | 146 | #if defined(CONFIG_CACHE_WRITETHROUGH) |
147 | /* Turn on Write-through caching */ | 147 | /* Write-through */ |
148 | flags |= CCR_CACHE_WT; | 148 | flags |= CCR_CACHE_WT; |
149 | #else | 149 | #elif defined(CONFIG_CACHE_WRITEBACK) |
150 | /* .. or default to Write-back */ | 150 | /* Write-back */ |
151 | flags |= CCR_CACHE_CB; | 151 | flags |= CCR_CACHE_CB; |
152 | #else | ||
153 | /* Off */ | ||
154 | flags &= ~CCR_CACHE_ENABLE; | ||
152 | #endif | 155 | #endif |
153 | 156 | ||
154 | ctrl_outl(flags, CCR); | 157 | ctrl_outl(flags, CCR); |