aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/cache-sh2a.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/mm/cache-sh2a.c')
-rw-r--r--arch/sh/mm/cache-sh2a.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c
index 24d86a794065..975899d83564 100644
--- a/arch/sh/mm/cache-sh2a.c
+++ b/arch/sh/mm/cache-sh2a.c
@@ -15,7 +15,7 @@
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/io.h> 16#include <asm/io.h>
17 17
18void __flush_wback_region(void *start, int size) 18static void sh2a__flush_wback_region(void *start, int size)
19{ 19{
20 unsigned long v; 20 unsigned long v;
21 unsigned long begin, end; 21 unsigned long begin, end;
@@ -44,7 +44,7 @@ void __flush_wback_region(void *start, int size)
44 local_irq_restore(flags); 44 local_irq_restore(flags);
45} 45}
46 46
47void __flush_purge_region(void *start, int size) 47static void sh2a__flush_purge_region(void *start, int size)
48{ 48{
49 unsigned long v; 49 unsigned long v;
50 unsigned long begin, end; 50 unsigned long begin, end;
@@ -65,7 +65,7 @@ void __flush_purge_region(void *start, int size)
65 local_irq_restore(flags); 65 local_irq_restore(flags);
66} 66}
67 67
68void __flush_invalidate_region(void *start, int size) 68static void sh2a__flush_invalidate_region(void *start, int size)
69{ 69{
70 unsigned long v; 70 unsigned long v;
71 unsigned long begin, end; 71 unsigned long begin, end;
@@ -97,13 +97,15 @@ void __flush_invalidate_region(void *start, int size)
97} 97}
98 98
99/* WBack O-Cache and flush I-Cache */ 99/* WBack O-Cache and flush I-Cache */
100void flush_icache_range(unsigned long start, unsigned long end) 100static void sh2a_flush_icache_range(void *args)
101{ 101{
102 struct flusher_data *data = args;
103 unsigned long start, end;
102 unsigned long v; 104 unsigned long v;
103 unsigned long flags; 105 unsigned long flags;
104 106
105 start = start & ~(L1_CACHE_BYTES-1); 107 start = data->addr1 & ~(L1_CACHE_BYTES-1);
106 end = (end + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); 108 end = (data->addr2 + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1);
107 109
108 local_irq_save(flags); 110 local_irq_save(flags);
109 jump_to_uncached(); 111 jump_to_uncached();
@@ -127,3 +129,12 @@ void flush_icache_range(unsigned long start, unsigned long end)
127 back_to_cached(); 129 back_to_cached();
128 local_irq_restore(flags); 130 local_irq_restore(flags);
129} 131}
132
133void __init sh2a_cache_init(void)
134{
135 local_flush_icache_range = sh2a_flush_icache_range;
136
137 __flush_wback_region = sh2a__flush_wback_region;
138 __flush_purge_region = sh2a__flush_purge_region;
139 __flush_invalidate_region = sh2a__flush_invalidate_region;
140}