diff options
author | Stuart Menefy <stuart.menefy@st.com> | 2007-11-30 03:06:36 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:59 -0500 |
commit | cbaa118ecfd99fc5ed7adbd9c34a30e1c05e3c93 (patch) | |
tree | e60db5c0f3573558c97f39cfab78732220a72e6d /arch/sh/kernel | |
parent | 325df7f20467da07901c4f2b006d3457bba0adec (diff) |
sh: Preparation for uncached jumps through PMB.
Presently most of the 29-bit physical parts do P1/P2 segmentation
with a 1:1 cached/uncached mapping, jumping between the two to
control the caching behaviour. This provides the basic infrastructure
to maintain this behaviour on 32-bit physical parts that don't map
P1/P2 at all, using a shiny new linker section and corresponding
fixmap entry.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/init.c | 6 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh3/probe.c | 6 | ||||
-rw-r--r-- | arch/sh/kernel/vmlinux_32.lds.S | 9 |
3 files changed, 15 insertions, 6 deletions
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index fd1688e6c61c..0f0c76a842e4 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
@@ -64,11 +64,11 @@ static void __init speculative_execution_init(void) | |||
64 | * Generic first-level cache init | 64 | * Generic first-level cache init |
65 | */ | 65 | */ |
66 | #ifdef CONFIG_SUPERH32 | 66 | #ifdef CONFIG_SUPERH32 |
67 | static void __init cache_init(void) | 67 | static void __uses_jump_to_uncached cache_init(void) |
68 | { | 68 | { |
69 | unsigned long ccr, flags; | 69 | unsigned long ccr, flags; |
70 | 70 | ||
71 | jump_to_P2(); | 71 | jump_to_uncached(); |
72 | ccr = ctrl_inl(CCR); | 72 | ccr = ctrl_inl(CCR); |
73 | 73 | ||
74 | /* | 74 | /* |
@@ -145,7 +145,7 @@ static void __init cache_init(void) | |||
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | ctrl_outl(flags, CCR); | 147 | ctrl_outl(flags, CCR); |
148 | back_to_P1(); | 148 | back_to_cached(); |
149 | } | 149 | } |
150 | #else | 150 | #else |
151 | #define cache_init() do { } while (0) | 151 | #define cache_init() do { } while (0) |
diff --git a/arch/sh/kernel/cpu/sh3/probe.c b/arch/sh/kernel/cpu/sh3/probe.c index bf579e061e09..22070e43e34d 100644 --- a/arch/sh/kernel/cpu/sh3/probe.c +++ b/arch/sh/kernel/cpu/sh3/probe.c | |||
@@ -16,11 +16,11 @@ | |||
16 | #include <asm/cache.h> | 16 | #include <asm/cache.h> |
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | 18 | ||
19 | int __init detect_cpu_and_cache_system(void) | 19 | int __uses_jump_to_uncached detect_cpu_and_cache_system(void) |
20 | { | 20 | { |
21 | unsigned long addr0, addr1, data0, data1, data2, data3; | 21 | unsigned long addr0, addr1, data0, data1, data2, data3; |
22 | 22 | ||
23 | jump_to_P2(); | 23 | jump_to_uncached(); |
24 | /* | 24 | /* |
25 | * Check if the entry shadows or not. | 25 | * Check if the entry shadows or not. |
26 | * When shadowed, it's 128-entry system. | 26 | * When shadowed, it's 128-entry system. |
@@ -48,7 +48,7 @@ int __init detect_cpu_and_cache_system(void) | |||
48 | ctrl_outl(data0&~SH_CACHE_VALID, addr0); | 48 | ctrl_outl(data0&~SH_CACHE_VALID, addr0); |
49 | ctrl_outl(data2&~SH_CACHE_VALID, addr1); | 49 | ctrl_outl(data2&~SH_CACHE_VALID, addr1); |
50 | 50 | ||
51 | back_to_P1(); | 51 | back_to_cached(); |
52 | 52 | ||
53 | boot_cpu_data.dcache.ways = 4; | 53 | boot_cpu_data.dcache.ways = 4; |
54 | boot_cpu_data.dcache.entry_shift = 4; | 54 | boot_cpu_data.dcache.entry_shift = 4; |
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S index 0956fb3681a3..50c69c18dced 100644 --- a/arch/sh/kernel/vmlinux_32.lds.S +++ b/arch/sh/kernel/vmlinux_32.lds.S | |||
@@ -43,6 +43,15 @@ SECTIONS | |||
43 | NOTES | 43 | NOTES |
44 | RO_DATA(PAGE_SIZE) | 44 | RO_DATA(PAGE_SIZE) |
45 | 45 | ||
46 | /* | ||
47 | * Code which must be executed uncached and the associated data | ||
48 | */ | ||
49 | . = ALIGN(PAGE_SIZE); | ||
50 | __uncached_start = .; | ||
51 | .uncached.text : { *(.uncached.text) } | ||
52 | .uncached.data : { *(.uncached.data) } | ||
53 | __uncached_end = .; | ||
54 | |||
46 | . = ALIGN(THREAD_SIZE); | 55 | . = ALIGN(THREAD_SIZE); |
47 | .data : { /* Data */ | 56 | .data : { /* Data */ |
48 | *(.data.init_task) | 57 | *(.data.init_task) |