aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-08-14 23:35:15 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-14 23:35:15 -0400
commit109b44a82a7a8ae32d7fb257480f92f2d96f0daf (patch)
tree70994c97dd46dc566c7d44862a262e2c0f24eb94 /arch/sh/mm
parent37443ef3f0406e855e169c87ae3f4ffb4b6ff635 (diff)
sh: Convert SH-2 to new cacheflush interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r--arch/sh/mm/cache-sh2.c13
-rw-r--r--arch/sh/mm/cache.c6
2 files changed, 16 insertions, 3 deletions
diff --git a/arch/sh/mm/cache-sh2.c b/arch/sh/mm/cache-sh2.c
index c4e80d2b764b..699a71f46327 100644
--- a/arch/sh/mm/cache-sh2.c
+++ b/arch/sh/mm/cache-sh2.c
@@ -16,7 +16,7 @@
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/io.h> 17#include <asm/io.h>
18 18
19void __flush_wback_region(void *start, int size) 19static void sh2__flush_wback_region(void *start, int size)
20{ 20{
21 unsigned long v; 21 unsigned long v;
22 unsigned long begin, end; 22 unsigned long begin, end;
@@ -37,7 +37,7 @@ void __flush_wback_region(void *start, int size)
37 } 37 }
38} 38}
39 39
40void __flush_purge_region(void *start, int size) 40static void sh2__flush_purge_region(void *start, int size)
41{ 41{
42 unsigned long v; 42 unsigned long v;
43 unsigned long begin, end; 43 unsigned long begin, end;
@@ -51,7 +51,7 @@ void __flush_purge_region(void *start, int size)
51 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 51 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
52} 52}
53 53
54void __flush_invalidate_region(void *start, int size) 54static void sh2__flush_invalidate_region(void *start, int size)
55{ 55{
56#ifdef CONFIG_CACHE_WRITEBACK 56#ifdef CONFIG_CACHE_WRITEBACK
57 /* 57 /*
@@ -82,3 +82,10 @@ void __flush_invalidate_region(void *start, int size)
82 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 82 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
83#endif 83#endif
84} 84}
85
86void __init sh2_cache_init(void)
87{
88 __flush_wback_region = sh2__flush_wback_region;
89 __flush_purge_region = sh2__flush_purge_region;
90 __flush_invalidate_region = sh2__flush_invalidate_region;
91}
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index da5bc6ac1b28..5ac299d6604e 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -244,6 +244,12 @@ void __init cpu_cache_init(void)
244 __flush_purge_region = noop__flush_region; 244 __flush_purge_region = noop__flush_region;
245 __flush_invalidate_region = noop__flush_region; 245 __flush_invalidate_region = noop__flush_region;
246 246
247 if (boot_cpu_data.family == CPU_FAMILY_SH2) {
248 extern void __weak sh2_cache_init(void);
249
250 sh2_cache_init();
251 }
252
247 if ((boot_cpu_data.family == CPU_FAMILY_SH4) || 253 if ((boot_cpu_data.family == CPU_FAMILY_SH4) ||
248 (boot_cpu_data.family == CPU_FAMILY_SH4A) || 254 (boot_cpu_data.family == CPU_FAMILY_SH4A) ||
249 (boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) { 255 (boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {