Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / arch / blackfin / mach-bf561 / hotplug.c
1 /*
2  * Copyright 2007-2009 Analog Devices Inc.
3  *               Graff Yang <graf.yang@analog.com>
4  *
5  * Licensed under the GPL-2 or later.
6  */
7
8 #include <asm/blackfin.h>
9 #include <asm/irq.h>
10 #include <asm/smp.h>
11
12 #define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
13
14 int hotplug_coreb;
15
16 void platform_cpu_die(void)
17 {
18         unsigned long iwr[2] = {0, 0};
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;
23
24         iwr[bank] = bit;
25
26         /* disable core timer */
27         bfin_write_TCNTL(0);
28
29         /* clear ipi interrupt IRQ_SUPPLE_0 */
30         bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
31         SSYNC();
32
33         coreb_sleep(iwr[0], iwr[1], 0);
34 }