summaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/cache.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-10-16 15:14:50 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-10-16 15:14:50 +0900
commitabeaf33a4101764291ec79cf286e08c0966eb26e (patch)
treebb3f8ae60d1ff0d99a907bcc223886f9d71fafea /arch/sh/mm/cache.c
parent731ba3301de41d2ffae9dd3e0f85f7361d8ad8f4 (diff)
parent52a94909f00e0ffceeac202e517a126d57c1c523 (diff)
Merge branch 'sh/stable-updates'
Conflicts: arch/sh/mm/cache-sh4.c
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 e8810f7fc7e..fc372a1d313 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -271,6 +271,8 @@ static void __init emit_cache_params(void)
void __init cpu_cache_init(void)
{
+ unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE);
+
compute_alias(&boot_cpu_data.icache);
compute_alias(&boot_cpu_data.dcache);
compute_alias(&boot_cpu_data.scache);
@@ -279,6 +281,13 @@ void __init cpu_cache_init(void)
__flush_purge_region = noop__flush_region;
__flush_invalidate_region = noop__flush_region;
+ /*
+ * No flushing is necessary in the disabled cache case so we can
+ * just keep the noop functions in local_flush_..() and __flush_..()
+ */
+ if (unlikely(cache_disabled))
+ goto skip;
+
if (boot_cpu_data.family == CPU_FAMILY_SH2) {
extern void __weak sh2_cache_init(void);
@@ -318,5 +327,6 @@ void __init cpu_cache_init(void)
sh5_cache_init();
}
+skip:
emit_cache_params();
}