]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
sh: Convert SH-2 to new cacheflush interface.
authorPaul Mundt <lethal@linux-sh.org>
Sat, 15 Aug 2009 03:35:15 +0000 (12:35 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Sat, 15 Aug 2009 03:35:15 +0000 (12:35 +0900)
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/mm/cache-sh2.c
arch/sh/mm/cache.c

index c4e80d2b764bee59086679e9f6af7111c3842e98..699a71f463279ca7e36ebe2f47b85eafa2dfead6 100644 (file)
@@ -16,7 +16,7 @@
 #include <asm/cacheflush.h>
 #include <asm/io.h>
 
-void __flush_wback_region(void *start, int size)
+static void sh2__flush_wback_region(void *start, int size)
 {
        unsigned long v;
        unsigned long begin, end;
@@ -37,7 +37,7 @@ void __flush_wback_region(void *start, int size)
        }
 }
 
-void __flush_purge_region(void *start, int size)
+static void sh2__flush_purge_region(void *start, int size)
 {
        unsigned long v;
        unsigned long begin, end;
@@ -51,7 +51,7 @@ void __flush_purge_region(void *start, int size)
                          CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
 }
 
-void __flush_invalidate_region(void *start, int size)
+static void sh2__flush_invalidate_region(void *start, int size)
 {
 #ifdef CONFIG_CACHE_WRITEBACK
        /*
@@ -82,3 +82,10 @@ void __flush_invalidate_region(void *start, int size)
                          CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
 #endif
 }
+
+void __init sh2_cache_init(void)
+{
+       __flush_wback_region            = sh2__flush_wback_region;
+       __flush_purge_region            = sh2__flush_purge_region;
+       __flush_invalidate_region       = sh2__flush_invalidate_region;
+}
index da5bc6ac1b282d60c99017e009493775708a4269..5ac299d6604ed16d93bf15f13db3d3a31776942e 100644 (file)
@@ -244,6 +244,12 @@ void __init cpu_cache_init(void)
        __flush_purge_region            = noop__flush_region;
        __flush_invalidate_region       = noop__flush_region;
 
+       if (boot_cpu_data.family == CPU_FAMILY_SH2) {
+               extern void __weak sh2_cache_init(void);
+
+               sh2_cache_init();
+       }
+
        if ((boot_cpu_data.family == CPU_FAMILY_SH4) ||
            (boot_cpu_data.family == CPU_FAMILY_SH4A) ||
            (boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {