Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Convert SH-2 to new cacheflush interface.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+16 -3
+10 -3
arch/sh/mm/cache-sh2.c
··· 16 16 #include <asm/cacheflush.h> 17 17 #include <asm/io.h> 18 18 19 - void __flush_wback_region(void *start, int size) 19 + static void sh2__flush_wback_region(void *start, int size) 20 20 { 21 21 unsigned long v; 22 22 unsigned long begin, end; ··· 37 37 } 38 38 } 39 39 40 - void __flush_purge_region(void *start, int size) 40 + static void sh2__flush_purge_region(void *start, int size) 41 41 { 42 42 unsigned long v; 43 43 unsigned long begin, end; ··· 51 51 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 52 52 } 53 53 54 - void __flush_invalidate_region(void *start, int size) 54 + static void sh2__flush_invalidate_region(void *start, int size) 55 55 { 56 56 #ifdef CONFIG_CACHE_WRITEBACK 57 57 /* ··· 81 81 ctrl_outl((v & CACHE_PHYSADDR_MASK), 82 82 CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 83 83 #endif 84 + } 85 + 86 + void __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; 84 91 }
+6
arch/sh/mm/cache.c
··· 244 244 __flush_purge_region = noop__flush_region; 245 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 253 if ((boot_cpu_data.family == CPU_FAMILY_SH4) || 248 254 (boot_cpu_data.family == CPU_FAMILY_SH4A) || 249 255 (boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {