aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf561
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2010-01-28 05:46:55 -0500
committerMike Frysinger <vapier@gentoo.org>2011-03-18 04:01:03 -0400
commit6f546bc3ac9eedbf770bf3bcbc45ce2ea32c94ad (patch)
tree7089509d165a19156c3be21950f96160fb1f06a1 /arch/blackfin/mach-bf561
parent820b127dae869cbbd2133f066e8b8f32a90d46e5 (diff)
Blackfin: SMP: implement cpu_freq support
Re-use some of the existing cpu hotplugging code in the process. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf561')
-rw-r--r--arch/blackfin/mach-bf561/hotplug.c21
-rw-r--r--arch/blackfin/mach-bf561/secondary.S26
2 files changed, 18 insertions, 29 deletions
diff --git a/arch/blackfin/mach-bf561/hotplug.c b/arch/blackfin/mach-bf561/hotplug.c
index 4cd3b28cd046..42fc085629c7 100644
--- a/arch/blackfin/mach-bf561/hotplug.c
+++ b/arch/blackfin/mach-bf561/hotplug.c
@@ -5,30 +5,27 @@
5 * Licensed under the GPL-2 or later. 5 * Licensed under the GPL-2 or later.
6 */ 6 */
7 7
8#include <linux/smp.h>
8#include <asm/blackfin.h> 9#include <asm/blackfin.h>
9#include <asm/irq.h> 10#include <mach/pll.h>
10#include <asm/smp.h>
11
12#define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
13 11
14int hotplug_coreb; 12int hotplug_coreb;
15 13
16void platform_cpu_die(void) 14void platform_cpu_die(void)
17{ 15{
18 unsigned long iwr[2] = {0, 0}; 16 unsigned long iwr;
19 unsigned long bank = SIC_SYSIRQ(IRQ_SUPPLE_0) / 32;
20 unsigned long bit = 1 << (SIC_SYSIRQ(IRQ_SUPPLE_0) % 32);
21
22 hotplug_coreb = 1; 17 hotplug_coreb = 1;
23 18
24 iwr[bank] = bit;
25
26 /* disable core timer */ 19 /* disable core timer */
27 bfin_write_TCNTL(0); 20 bfin_write_TCNTL(0);
28 21
29 /* clear ipi interrupt IRQ_SUPPLE_0 */ 22 /* clear ipi interrupt IRQ_SUPPLE_0 of CoreB */
30 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1))); 23 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
31 SSYNC(); 24 SSYNC();
32 25
33 coreb_sleep(iwr[0], iwr[1], 0); 26 /* set CoreB wakeup by ipi0, iwr will be discarded */
27 bfin_iwr_set_sup0(&iwr, &iwr, &iwr);
28 SSYNC();
29
30 coreb_die();
34} 31}
diff --git a/arch/blackfin/mach-bf561/secondary.S b/arch/blackfin/mach-bf561/secondary.S
index ef9acf21eb8e..148e50764555 100644
--- a/arch/blackfin/mach-bf561/secondary.S
+++ b/arch/blackfin/mach-bf561/secondary.S
@@ -162,39 +162,31 @@ ENTRY(_coreb_trampoline_start)
162ENDPROC(_coreb_trampoline_start) 162ENDPROC(_coreb_trampoline_start)
163ENTRY(_coreb_trampoline_end) 163ENTRY(_coreb_trampoline_end)
164 164
165#ifdef CONFIG_HOTPLUG_CPU
165.section ".text" 166.section ".text"
166ENTRY(_set_sicb_iwr) 167ENTRY(_coreb_die)
167 P0.H = hi(SICB_IWR0);
168 P0.L = lo(SICB_IWR0);
169 P1.H = hi(SICB_IWR1);
170 P1.L = lo(SICB_IWR1);
171 [P0] = R0;
172 [P1] = R1;
173 SSYNC;
174 RTS;
175ENDPROC(_set_sicb_iwr)
176
177ENTRY(_coreb_sleep)
178 sp.l = lo(INITIAL_STACK); 168 sp.l = lo(INITIAL_STACK);
179 sp.h = hi(INITIAL_STACK); 169 sp.h = hi(INITIAL_STACK);
180 fp = sp; 170 fp = sp;
181 usp = sp; 171 usp = sp;
182 172
183 call _set_sicb_iwr;
184
185 CLI R2; 173 CLI R2;
186 SSYNC; 174 SSYNC;
187 IDLE; 175 IDLE;
188 STI R2; 176 STI R2;
189 177
190 R0 = IWR_DISABLE_ALL; 178 R0 = IWR_DISABLE_ALL;
191 R1 = IWR_DISABLE_ALL; 179 P0.H = hi(SYSMMR_BASE);
192 call _set_sicb_iwr; 180 P0.L = lo(SYSMMR_BASE);
181 [P0 + (SICB_IWR0 - SYSMMR_BASE)] = R0;
182 [P0 + (SICB_IWR1 - SYSMMR_BASE)] = R0;
183 SSYNC;
193 184
194 p0.h = hi(COREB_L1_CODE_START); 185 p0.h = hi(COREB_L1_CODE_START);
195 p0.l = lo(COREB_L1_CODE_START); 186 p0.l = lo(COREB_L1_CODE_START);
196 jump (p0); 187 jump (p0);
197ENDPROC(_coreb_sleep) 188ENDPROC(_coreb_die)
189#endif
198 190
199__INIT 191__INIT
200ENTRY(_coreb_start) 192ENTRY(_coreb_start)