aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-08-14 22:05:42 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-14 22:05:42 -0400
commitecba1060583635ab55092072441ff903b5e9a659 (patch)
treed84dc75eae0b1bb2a2751240783444e2e92ca695 /arch
parente82da214d2fe3dc2610df966100c4f36bc0fad91 (diff)
sh: Centralize the CPU cache initialization routines.
This provides a central point for CPU cache initialization routines. This replaces the antiquated p3_cache_init() method, which the vast majority of CPUs never cared about. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/include/asm/cacheflush.h3
-rw-r--r--arch/sh/include/cpu-common/cpu/cacheflush.h2
-rw-r--r--arch/sh/include/cpu-sh2a/cpu/cacheflush.h1
-rw-r--r--arch/sh/include/cpu-sh3/cpu/cacheflush.h2
-rw-r--r--arch/sh/include/cpu-sh4/cpu/cacheflush.h3
-rw-r--r--arch/sh/include/cpu-sh5/cpu/cacheflush.h1
-rw-r--r--arch/sh/mm/cache-sh4.c2
-rw-r--r--arch/sh/mm/cache-sh5.c2
-rw-r--r--arch/sh/mm/cache.c11
-rw-r--r--arch/sh/mm/init.c2
10 files changed, 16 insertions, 13 deletions
diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
index 9ec13fb909dd..e37654f7f545 100644
--- a/arch/sh/include/asm/cacheflush.h
+++ b/arch/sh/include/asm/cacheflush.h
@@ -12,7 +12,6 @@
12 * 12 *
13 * See arch/sh/kernel/cpu/init.c:cache_init(). 13 * See arch/sh/kernel/cpu/init.c:cache_init().
14 */ 14 */
15#define p3_cache_init() do { } while (0)
16#define flush_cache_all() do { } while (0) 15#define flush_cache_all() do { } while (0)
17#define flush_cache_mm(mm) do { } while (0) 16#define flush_cache_mm(mm) do { } while (0)
18#define flush_cache_dup_mm(mm) do { } while (0) 17#define flush_cache_dup_mm(mm) do { } while (0)
@@ -78,5 +77,7 @@ void kunmap_coherent(void);
78 77
79#define PG_dcache_dirty PG_arch_1 78#define PG_dcache_dirty PG_arch_1
80 79
80void cpu_cache_init(void);
81
81#endif /* __KERNEL__ */ 82#endif /* __KERNEL__ */
82#endif /* __ASM_SH_CACHEFLUSH_H */ 83#endif /* __ASM_SH_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-common/cpu/cacheflush.h b/arch/sh/include/cpu-common/cpu/cacheflush.h
index c3db00b73605..0c38278509cb 100644
--- a/arch/sh/include/cpu-common/cpu/cacheflush.h
+++ b/arch/sh/include/cpu-common/cpu/cacheflush.h
@@ -39,6 +39,4 @@
39#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) 39#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
40#define flush_cache_sigtramp(vaddr) do { } while (0) 40#define flush_cache_sigtramp(vaddr) do { } while (0)
41 41
42#define p3_cache_init() do { } while (0)
43
44#endif /* __ASM_CPU_SH2_CACHEFLUSH_H */ 42#endif /* __ASM_CPU_SH2_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-sh2a/cpu/cacheflush.h b/arch/sh/include/cpu-sh2a/cpu/cacheflush.h
index 3d3b9205d2ac..b9eaa19325e2 100644
--- a/arch/sh/include/cpu-sh2a/cpu/cacheflush.h
+++ b/arch/sh/include/cpu-sh2a/cpu/cacheflush.h
@@ -30,5 +30,4 @@ void flush_icache_range(unsigned long start, unsigned long end);
30#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) 30#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
31#define flush_cache_sigtramp(vaddr) do { } while (0) 31#define flush_cache_sigtramp(vaddr) do { } while (0)
32 32
33#define p3_cache_init() do { } while (0)
34#endif /* __ASM_CPU_SH2A_CACHEFLUSH_H */ 33#endif /* __ASM_CPU_SH2A_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/cacheflush.h b/arch/sh/include/cpu-sh3/cpu/cacheflush.h
index 3b5f3df4e1c8..cf656a093770 100644
--- a/arch/sh/include/cpu-sh3/cpu/cacheflush.h
+++ b/arch/sh/include/cpu-sh3/cpu/cacheflush.h
@@ -32,8 +32,6 @@ void flush_icache_page(struct vm_area_struct *vma, struct page *page);
32#define flush_cache_sigtramp(vaddr) do { } while (0) 32#define flush_cache_sigtramp(vaddr) do { } while (0)
33#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) 33#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
34 34
35#define p3_cache_init() do { } while (0)
36
37#else 35#else
38#include <cpu-common/cpu/cacheflush.h> 36#include <cpu-common/cpu/cacheflush.h>
39#endif 37#endif
diff --git a/arch/sh/include/cpu-sh4/cpu/cacheflush.h b/arch/sh/include/cpu-sh4/cpu/cacheflush.h
index 76764f0fb88a..a28c542f5179 100644
--- a/arch/sh/include/cpu-sh4/cpu/cacheflush.h
+++ b/arch/sh/include/cpu-sh4/cpu/cacheflush.h
@@ -35,7 +35,4 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
35 35
36#define flush_icache_page(vma,pg) do { } while (0) 36#define flush_icache_page(vma,pg) do { } while (0)
37 37
38/* Initialization of P3 area for copy_user_page */
39void p3_cache_init(void);
40
41#endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ 38#endif /* __ASM_CPU_SH4_CACHEFLUSH_H */
diff --git a/arch/sh/include/cpu-sh5/cpu/cacheflush.h b/arch/sh/include/cpu-sh5/cpu/cacheflush.h
index 5a11f0b7e66a..8350cc7ed1c5 100644
--- a/arch/sh/include/cpu-sh5/cpu/cacheflush.h
+++ b/arch/sh/include/cpu-sh5/cpu/cacheflush.h
@@ -25,7 +25,6 @@ extern void flush_icache_user_range(struct vm_area_struct *vma,
25#define flush_dcache_mmap_unlock(mapping) do { } while (0) 25#define flush_dcache_mmap_unlock(mapping) do { } while (0)
26 26
27#define flush_icache_page(vma, page) do { } while (0) 27#define flush_icache_page(vma, page) do { } while (0)
28void p3_cache_init(void);
29 28
30#endif /* __ASSEMBLY__ */ 29#endif /* __ASSEMBLY__ */
31 30
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index 92f87a460a81..df2eb87f1524 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -94,7 +94,7 @@ static void __init emit_cache_params(void)
94/* 94/*
95 * SH-4 has virtually indexed and physically tagged cache. 95 * SH-4 has virtually indexed and physically tagged cache.
96 */ 96 */
97void __init p3_cache_init(void) 97void __init sh4_cache_init(void)
98{ 98{
99 compute_alias(&boot_cpu_data.icache); 99 compute_alias(&boot_cpu_data.icache);
100 compute_alias(&boot_cpu_data.dcache); 100 compute_alias(&boot_cpu_data.dcache);
diff --git a/arch/sh/mm/cache-sh5.c b/arch/sh/mm/cache-sh5.c
index 28f3c8fb1b99..576cad04b11b 100644
--- a/arch/sh/mm/cache-sh5.c
+++ b/arch/sh/mm/cache-sh5.c
@@ -23,7 +23,7 @@
23/* Wired TLB entry for the D-cache */ 23/* Wired TLB entry for the D-cache */
24static unsigned long long dtlb_cache_slot; 24static unsigned long long dtlb_cache_slot;
25 25
26void __init p3_cache_init(void) 26void __init cpu_cache_init(void)
27{ 27{
28 /* Reserve a slot for dcache colouring in the DTLB */ 28 /* Reserve a slot for dcache colouring in the DTLB */
29 dtlb_cache_slot = sh64_get_wired_dtlb_entry(); 29 dtlb_cache_slot = sh64_get_wired_dtlb_entry();
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index f51d0a4eb3ba..659981ffae24 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -127,3 +127,14 @@ void __flush_anon_page(struct page *page, unsigned long vmaddr)
127 __flush_wback_region((void *)addr, PAGE_SIZE); 127 __flush_wback_region((void *)addr, PAGE_SIZE);
128 } 128 }
129} 129}
130
131void __init cpu_cache_init(void)
132{
133 if ((boot_cpu_data.family == CPU_FAMILY_SH4) ||
134 (boot_cpu_data.family == CPU_FAMILY_SH4A) ||
135 (boot_cpu_data.family == CPU_FAMILY_SH4AL_DSP)) {
136 extern void __weak sh4_cache_init(void);
137
138 sh4_cache_init();
139 }
140}
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index fe532aeaa16d..cf0e9c5146b1 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -230,7 +230,7 @@ void __init mem_init(void)
230 datasize >> 10, 230 datasize >> 10,
231 initsize >> 10); 231 initsize >> 10);
232 232
233 p3_cache_init(); 233 cpu_cache_init();
234 234
235 /* Initialize the vDSO */ 235 /* Initialize the vDSO */
236 vsyscall_init(); 236 vsyscall_init();