aboutsummaryrefslogtreecommitdiff
path: root/arch/blackfin/mach-bf561/hotplug.c
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2009-12-28 11:13:51 +0000
committerMike Frysinger <vapier@gentoo.org>2010-03-09 00:30:48 -0500
commit0b39db28b953945232719e7ff6fb802aa8a2be5f (patch)
treec35193b07e9413ed6b5436aa79e24b0f22627082 /arch/blackfin/mach-bf561/hotplug.c
parent0d152c27e336b5fd777da7dd3e814617e7305afd (diff)
Blackfin: SMP: add PM/CPU hotplug support
Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf561/hotplug.c')
-rw-r--r--arch/blackfin/mach-bf561/hotplug.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf561/hotplug.c b/arch/blackfin/mach-bf561/hotplug.c
new file mode 100644
index 00000000000..c95169b612d
--- /dev/null
+++ b/arch/blackfin/mach-bf561/hotplug.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2007-2009 Analog Devices Inc.
+ * Graff Yang <graf.yang@analog.com>
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <asm/blackfin.h>
+#include <asm/smp.h>
+#define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
+
+int hotplug_coreb;
+
+void platform_cpu_die(void)
+{
+ unsigned long iwr[2] = {0, 0};
+ unsigned long bank = SIC_SYSIRQ(IRQ_SUPPLE_0) / 32;
+ unsigned long bit = 1 << (SIC_SYSIRQ(IRQ_SUPPLE_0) % 32);
+
+ hotplug_coreb = 1;
+
+ iwr[bank] = bit;
+
+ /* disable core timer */
+ bfin_write_TCNTL(0);
+
+ /* clear ipi interrupt IRQ_SUPPLE_0 */
+ bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
+ SSYNC();
+
+ coreb_sleep(iwr[0], iwr[1], 0);
+}