Skip to content

Commit a58e1a2

Browse files
committed
sh: Convert SH-2A to new cacheflush interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 109b44a commit a58e1a2

3 files changed

Lines changed: 19 additions & 34 deletions

File tree

‎arch/sh/include/cpu-sh2a/cpu/cacheflush.h‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎arch/sh/mm/cache-sh2a.c‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <asm/cacheflush.h>
1616
#include <asm/io.h>
1717

18-
void __flush_wback_region(void *start, int size)
18+
static void sh2a__flush_wback_region(void *start, int size)
1919
{
2020
unsigned long v;
2121
unsigned long begin, end;
@@ -44,7 +44,7 @@ void __flush_wback_region(void *start, int size)
4444
local_irq_restore(flags);
4545
}
4646

47-
void __flush_purge_region(void *start, int size)
47+
static void sh2a__flush_purge_region(void *start, int size)
4848
{
4949
unsigned long v;
5050
unsigned long begin, end;
@@ -65,7 +65,7 @@ void __flush_purge_region(void *start, int size)
6565
local_irq_restore(flags);
6666
}
6767

68-
void __flush_invalidate_region(void *start, int size)
68+
static void sh2a__flush_invalidate_region(void *start, int size)
6969
{
7070
unsigned long v;
7171
unsigned long begin, end;
@@ -97,7 +97,7 @@ void __flush_invalidate_region(void *start, int size)
9797
}
9898

9999
/* WBack O-Cache and flush I-Cache */
100-
void flush_icache_range(unsigned long start, unsigned long end)
100+
static void sh2a_flush_icache_range(unsigned long start, unsigned long end)
101101
{
102102
unsigned long v;
103103
unsigned long flags;
@@ -127,3 +127,12 @@ void flush_icache_range(unsigned long start, unsigned long end)
127127
back_to_cached();
128128
local_irq_restore(flags);
129129
}
130+
131+
void __init sh2a_cache_init(void)
132+
{
133+
flush_icache_range = sh2a_flush_icache_range;
134+
135+
__flush_wback_region = sh2a__flush_wback_region;
136+
__flush_purge_region = sh2a__flush_purge_region;
137+
__flush_invalidate_region = sh2a__flush_invalidate_region;
138+
}

‎arch/sh/mm/cache.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ void __init cpu_cache_init(void)
250250
sh2_cache_init();
251251
}
252252

253+
if (boot_cpu_data.family == CPU_FAMILY_SH2A) {
254+
extern void __weak sh2a_cache_init(void);
255+
256+
sh2a_cache_init();
257+
}
258+
253259
if ((boot_cpu_data.family == CPU_FAMILY_SH4) ||
254260
(boot_cpu_data.family == CPU_FAMILY_SH4A) ||
255261
(boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {

0 commit comments

Comments
 (0)