diff options
-rw-r--r-- | arch/sh/mm/cache.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index 5e1091be9dc4..a2dc7f9ecc51 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
@@ -265,6 +265,8 @@ static void __init emit_cache_params(void) | |||
265 | 265 | ||
266 | void __init cpu_cache_init(void) | 266 | void __init cpu_cache_init(void) |
267 | { | 267 | { |
268 | unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE); | ||
269 | |||
268 | compute_alias(&boot_cpu_data.icache); | 270 | compute_alias(&boot_cpu_data.icache); |
269 | compute_alias(&boot_cpu_data.dcache); | 271 | compute_alias(&boot_cpu_data.dcache); |
270 | compute_alias(&boot_cpu_data.scache); | 272 | compute_alias(&boot_cpu_data.scache); |
@@ -273,6 +275,13 @@ void __init cpu_cache_init(void) | |||
273 | __flush_purge_region = noop__flush_region; | 275 | __flush_purge_region = noop__flush_region; |
274 | __flush_invalidate_region = noop__flush_region; | 276 | __flush_invalidate_region = noop__flush_region; |
275 | 277 | ||
278 | /* | ||
279 | * No flushing is necessary in the disabled cache case so we can | ||
280 | * just keep the noop functions in local_flush_..() and __flush_..() | ||
281 | */ | ||
282 | if (unlikely(cache_disabled)) | ||
283 | goto skip; | ||
284 | |||
276 | if (boot_cpu_data.family == CPU_FAMILY_SH2) { | 285 | if (boot_cpu_data.family == CPU_FAMILY_SH2) { |
277 | extern void __weak sh2_cache_init(void); | 286 | extern void __weak sh2_cache_init(void); |
278 | 287 | ||
@@ -312,5 +321,6 @@ void __init cpu_cache_init(void) | |||
312 | sh5_cache_init(); | 321 | sh5_cache_init(); |
313 | } | 322 | } |
314 | 323 | ||
324 | skip: | ||
315 | emit_cache_params(); | 325 | emit_cache_params(); |
316 | } | 326 | } |