diff options
Diffstat (limited to 'arch/sh/kernel/cpu/init.c')
-rw-r--r-- | arch/sh/kernel/cpu/init.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index ad85421099cd..e932ebef4738 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * CPU init code | 4 | * CPU init code |
5 | * | 5 | * |
6 | * Copyright (C) 2002 - 2007 Paul Mundt | 6 | * Copyright (C) 2002 - 2009 Paul Mundt |
7 | * Copyright (C) 2003 Richard Curnow | 7 | * Copyright (C) 2003 Richard Curnow |
8 | * | 8 | * |
9 | * This file is subject to the terms and conditions of the GNU General Public | 9 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -62,6 +62,37 @@ static void __init speculative_execution_init(void) | |||
62 | #define speculative_execution_init() do { } while (0) | 62 | #define speculative_execution_init() do { } while (0) |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | #ifdef CONFIG_CPU_SH4A | ||
66 | #define EXPMASK 0xff2f0004 | ||
67 | #define EXPMASK_RTEDS (1 << 0) | ||
68 | #define EXPMASK_BRDSSLP (1 << 1) | ||
69 | #define EXPMASK_MMCAW (1 << 4) | ||
70 | |||
71 | static void __init expmask_init(void) | ||
72 | { | ||
73 | unsigned long expmask = __raw_readl(EXPMASK); | ||
74 | |||
75 | /* | ||
76 | * Future proofing. | ||
77 | * | ||
78 | * Disable support for slottable sleep instruction | ||
79 | * and non-nop instructions in the rte delay slot. | ||
80 | */ | ||
81 | expmask &= ~(EXPMASK_RTEDS | EXPMASK_BRDSSLP); | ||
82 | |||
83 | /* | ||
84 | * Enable associative writes to the memory-mapped cache array | ||
85 | * until the cache flush ops have been rewritten. | ||
86 | */ | ||
87 | expmask |= EXPMASK_MMCAW; | ||
88 | |||
89 | __raw_writel(expmask, EXPMASK); | ||
90 | ctrl_barrier(); | ||
91 | } | ||
92 | #else | ||
93 | #define expmask_init() do { } while (0) | ||
94 | #endif | ||
95 | |||
65 | /* 2nd-level cache init */ | 96 | /* 2nd-level cache init */ |
66 | void __uses_jump_to_uncached __attribute__ ((weak)) l2_cache_init(void) | 97 | void __uses_jump_to_uncached __attribute__ ((weak)) l2_cache_init(void) |
67 | { | 98 | { |
@@ -268,11 +299,9 @@ asmlinkage void __init sh_cpu_init(void) | |||
268 | cache_init(); | 299 | cache_init(); |
269 | 300 | ||
270 | if (raw_smp_processor_id() == 0) { | 301 | if (raw_smp_processor_id() == 0) { |
271 | #ifdef CONFIG_MMU | ||
272 | shm_align_mask = max_t(unsigned long, | 302 | shm_align_mask = max_t(unsigned long, |
273 | current_cpu_data.dcache.way_size - 1, | 303 | current_cpu_data.dcache.way_size - 1, |
274 | PAGE_SIZE - 1); | 304 | PAGE_SIZE - 1); |
275 | #endif | ||
276 | 305 | ||
277 | /* Boot CPU sets the cache shape */ | 306 | /* Boot CPU sets the cache shape */ |
278 | detect_cache_shape(); | 307 | detect_cache_shape(); |
@@ -321,4 +350,5 @@ asmlinkage void __init sh_cpu_init(void) | |||
321 | #endif | 350 | #endif |
322 | 351 | ||
323 | speculative_execution_init(); | 352 | speculative_execution_init(); |
353 | expmask_init(); | ||
324 | } | 354 | } |