aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/init.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-09-21 05:32:32 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-09-21 05:32:32 -0400
commitaba1030a7e529ec9fe47a8cfc06d12a39180fa71 (patch)
treea28de7f7b89610246fddf488f042b58c66101b95 /arch/sh/kernel/cpu/init.c
parentf18d533e3cd476aedf41fe1e6e9dc3e0a2446bba (diff)
sh: Bring SMP support back from the dead.
There was a very preliminary bunch of SMP code scattered around for the SH7604 microcontrollers from way back when, and it has mostly suffered bitrot since then. With the tree already having been slowly getting prepped for SMP, this plugs in most of the remaining platform-independent bits. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/init.c')
-rw-r--r--arch/sh/kernel/cpu/init.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index fdc245b7b043..c217c4bf0085 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -22,6 +22,7 @@
22#include <asm/cache.h> 22#include <asm/cache.h>
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/ubc.h> 24#include <asm/ubc.h>
25#include <asm/smp.h>
25 26
26/* 27/*
27 * Generic wrapper for command line arguments to disable on-chip 28 * Generic wrapper for command line arguments to disable on-chip
@@ -216,8 +217,11 @@ static void __init dsp_init(void)
216 * Each processor family is still responsible for doing its own probing 217 * Each processor family is still responsible for doing its own probing
217 * and cache configuration in detect_cpu_and_cache_system(). 218 * and cache configuration in detect_cpu_and_cache_system().
218 */ 219 */
219asmlinkage void __init sh_cpu_init(void) 220
221asmlinkage void __cpuinit sh_cpu_init(void)
220{ 222{
223 current_thread_info()->cpu = hard_smp_processor_id();
224
221 /* First, probe the CPU */ 225 /* First, probe the CPU */
222 detect_cpu_and_cache_system(); 226 detect_cpu_and_cache_system();
223 227
@@ -227,9 +231,10 @@ asmlinkage void __init sh_cpu_init(void)
227 /* Init the cache */ 231 /* Init the cache */
228 cache_init(); 232 cache_init();
229 233
230 shm_align_mask = max_t(unsigned long, 234 if (raw_smp_processor_id() == 0)
231 current_cpu_data.dcache.way_size - 1, 235 shm_align_mask = max_t(unsigned long,
232 PAGE_SIZE - 1); 236 current_cpu_data.dcache.way_size - 1,
237 PAGE_SIZE - 1);
233 238
234 /* Disable the FPU */ 239 /* Disable the FPU */
235 if (fpu_disabled) { 240 if (fpu_disabled) {
@@ -268,6 +273,7 @@ asmlinkage void __init sh_cpu_init(void)
268 * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB. So .. 273 * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB. So ..
269 * we wake it up and hope that all is well. 274 * we wake it up and hope that all is well.
270 */ 275 */
271 ubc_wakeup(); 276 if (raw_smp_processor_id() == 0)
277 ubc_wakeup();
272 speculative_execution_init(); 278 speculative_execution_init();
273} 279}