diff options
author | Michal Marek <mmarek@suse.cz> | 2010-08-04 07:59:13 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-08-04 07:59:13 -0400 |
commit | 772320e84588dcbe1600ffb83e5f328f2209ac2a (patch) | |
tree | a7de21b79340aeaa17c58126f6b801b82c77b53a /arch/blackfin/mach-bf561/smp.c | |
parent | 1ce53adf13a54375d2a5c7cdbe341b2558389615 (diff) | |
parent | 9fe6206f400646a2322096b56c59891d530e8d51 (diff) |
Merge commit 'v2.6.35' into kbuild/kbuild
Conflicts:
arch/powerpc/Makefile
Diffstat (limited to 'arch/blackfin/mach-bf561/smp.c')
-rw-r--r-- | arch/blackfin/mach-bf561/smp.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c index 0192532e96a2..3b9a4bf7dacc 100644 --- a/arch/blackfin/mach-bf561/smp.c +++ b/arch/blackfin/mach-bf561/smp.c | |||
@@ -11,11 +11,10 @@ | |||
11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
12 | #include <asm/smp.h> | 12 | #include <asm/smp.h> |
13 | #include <asm/dma.h> | 13 | #include <asm/dma.h> |
14 | #include <asm/time.h> | ||
14 | 15 | ||
15 | static DEFINE_SPINLOCK(boot_lock); | 16 | static DEFINE_SPINLOCK(boot_lock); |
16 | 17 | ||
17 | static cpumask_t cpu_callin_map; | ||
18 | |||
19 | /* | 18 | /* |
20 | * platform_init_cpus() - Tell the world about how many cores we | 19 | * platform_init_cpus() - Tell the world about how many cores we |
21 | * have. This is called while setting up the architecture support | 20 | * have. This is called while setting up the architecture support |
@@ -66,13 +65,15 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
66 | bfin_write_SICB_IAR5(bfin_read_SICA_IAR5()); | 65 | bfin_write_SICB_IAR5(bfin_read_SICA_IAR5()); |
67 | bfin_write_SICB_IAR6(bfin_read_SICA_IAR6()); | 66 | bfin_write_SICB_IAR6(bfin_read_SICA_IAR6()); |
68 | bfin_write_SICB_IAR7(bfin_read_SICA_IAR7()); | 67 | bfin_write_SICB_IAR7(bfin_read_SICA_IAR7()); |
68 | bfin_write_SICB_IWR0(IWR_DISABLE_ALL); | ||
69 | bfin_write_SICB_IWR1(IWR_DISABLE_ALL); | ||
69 | SSYNC(); | 70 | SSYNC(); |
70 | 71 | ||
71 | /* Store CPU-private information to the cpu_data array. */ | 72 | /* Store CPU-private information to the cpu_data array. */ |
72 | bfin_setup_cpudata(cpu); | 73 | bfin_setup_cpudata(cpu); |
73 | 74 | ||
74 | /* We are done with local CPU inits, unblock the boot CPU. */ | 75 | /* We are done with local CPU inits, unblock the boot CPU. */ |
75 | cpu_set(cpu, cpu_callin_map); | 76 | set_cpu_online(cpu, true); |
76 | spin_lock(&boot_lock); | 77 | spin_lock(&boot_lock); |
77 | spin_unlock(&boot_lock); | 78 | spin_unlock(&boot_lock); |
78 | } | 79 | } |
@@ -81,28 +82,28 @@ int __cpuinit platform_boot_secondary(unsigned int cpu, struct task_struct *idle | |||
81 | { | 82 | { |
82 | unsigned long timeout; | 83 | unsigned long timeout; |
83 | 84 | ||
84 | /* CoreB already running?! */ | ||
85 | BUG_ON((bfin_read_SICA_SYSCR() & COREB_SRAM_INIT) == 0); | ||
86 | |||
87 | printk(KERN_INFO "Booting Core B.\n"); | 85 | printk(KERN_INFO "Booting Core B.\n"); |
88 | 86 | ||
89 | spin_lock(&boot_lock); | 87 | spin_lock(&boot_lock); |
90 | 88 | ||
91 | /* Kick CoreB, which should start execution from CORE_SRAM_BASE. */ | 89 | if ((bfin_read_SICA_SYSCR() & COREB_SRAM_INIT) == 0) { |
92 | SSYNC(); | 90 | /* CoreB already running, sending ipi to wakeup it */ |
93 | bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() & ~COREB_SRAM_INIT); | 91 | platform_send_ipi_cpu(cpu, IRQ_SUPPLE_0); |
94 | SSYNC(); | 92 | } else { |
93 | /* Kick CoreB, which should start execution from CORE_SRAM_BASE. */ | ||
94 | bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() & ~COREB_SRAM_INIT); | ||
95 | SSYNC(); | ||
96 | } | ||
95 | 97 | ||
96 | timeout = jiffies + 1 * HZ; | 98 | timeout = jiffies + 1 * HZ; |
97 | while (time_before(jiffies, timeout)) { | 99 | while (time_before(jiffies, timeout)) { |
98 | if (cpu_isset(cpu, cpu_callin_map)) | 100 | if (cpu_online(cpu)) |
99 | break; | 101 | break; |
100 | udelay(100); | 102 | udelay(100); |
101 | barrier(); | 103 | barrier(); |
102 | } | 104 | } |
103 | 105 | ||
104 | if (cpu_isset(cpu, cpu_callin_map)) { | 106 | if (cpu_online(cpu)) { |
105 | cpu_set(cpu, cpu_online_map); | ||
106 | /* release the lock and let coreb run */ | 107 | /* release the lock and let coreb run */ |
107 | spin_unlock(&boot_lock); | 108 | spin_unlock(&boot_lock); |
108 | return 0; | 109 | return 0; |
@@ -147,3 +148,20 @@ void platform_clear_ipi(unsigned int cpu) | |||
147 | bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + cpu))); | 148 | bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + cpu))); |
148 | SSYNC(); | 149 | SSYNC(); |
149 | } | 150 | } |
151 | |||
152 | /* | ||
153 | * Setup core B's local core timer. | ||
154 | * In SMP, core timer is used for clock event device. | ||
155 | */ | ||
156 | void __cpuinit bfin_local_timer_setup(void) | ||
157 | { | ||
158 | #if defined(CONFIG_TICKSOURCE_CORETMR) | ||
159 | bfin_coretmr_init(); | ||
160 | bfin_coretmr_clockevent_init(); | ||
161 | get_irq_chip(IRQ_CORETMR)->unmask(IRQ_CORETMR); | ||
162 | #else | ||
163 | /* Power down the core timer, just to play safe. */ | ||
164 | bfin_write_TCNTL(0); | ||
165 | #endif | ||
166 | |||
167 | } | ||