aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/mm/cache.c')
-rw-r--r--arch/sh/mm/cache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index e8810f7fc7ea..fc372a1d3132 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -271,6 +271,8 @@ static void __init emit_cache_params(void)
271 271
272void __init cpu_cache_init(void) 272void __init cpu_cache_init(void)
273{ 273{
274 unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE);
275
274 compute_alias(&boot_cpu_data.icache); 276 compute_alias(&boot_cpu_data.icache);
275 compute_alias(&boot_cpu_data.dcache); 277 compute_alias(&boot_cpu_data.dcache);
276 compute_alias(&boot_cpu_data.scache); 278 compute_alias(&boot_cpu_data.scache);
@@ -279,6 +281,13 @@ void __init cpu_cache_init(void)
279 __flush_purge_region = noop__flush_region; 281 __flush_purge_region = noop__flush_region;
280 __flush_invalidate_region = noop__flush_region; 282 __flush_invalidate_region = noop__flush_region;
281 283
284 /*
285 * No flushing is necessary in the disabled cache case so we can
286 * just keep the noop functions in local_flush_..() and __flush_..()
287 */
288 if (unlikely(cache_disabled))
289 goto skip;
290
282 if (boot_cpu_data.family == CPU_FAMILY_SH2) { 291 if (boot_cpu_data.family == CPU_FAMILY_SH2) {
283 extern void __weak sh2_cache_init(void); 292 extern void __weak sh2_cache_init(void);
284 293
@@ -318,5 +327,6 @@ void __init cpu_cache_init(void)
318 sh5_cache_init(); 327 sh5_cache_init();
319 } 328 }
320 329
330skip:
321 emit_cache_params(); 331 emit_cache_params();
322} 332}