summaryrefslogtreecommitdiff
path: root/arch/blackfin/mach-bf561/hotplug.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-08-05 17:04:01 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-08-05 17:04:01 -0300
commit57f0f512b273f60d52568b8c6b77e17f5636edc0 (patch)
tree5e910f0e82173f4ef4f51111366a3f1299037a7b /arch/blackfin/mach-bf561/hotplug.c
Initial import
Diffstat (limited to 'arch/blackfin/mach-bf561/hotplug.c')
-rw-r--r--arch/blackfin/mach-bf561/hotplug.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf561/hotplug.c b/arch/blackfin/mach-bf561/hotplug.c
new file mode 100644
index 000000000..0123117b8
--- /dev/null
+++ b/arch/blackfin/mach-bf561/hotplug.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2007-2009 Analog Devices Inc.
+ * Graff Yang <graf.yang@analog.com>
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <linux/smp.h>
+#include <asm/blackfin.h>
+#include <asm/cacheflush.h>
+#include <mach/pll.h>
+
+int hotplug_coreb;
+
+void platform_cpu_die(void)
+{
+ unsigned long iwr;
+
+ hotplug_coreb = 1;
+
+ /*
+ * When CoreB wakes up, the code in _coreb_trampoline_start cannot
+ * turn off the data cache. This causes the CoreB failed to boot.
+ * As a workaround, we invalidate all the data cache before sleep.
+ */
+ blackfin_invalidate_entire_dcache();
+
+ /* disable core timer */
+ bfin_write_TCNTL(0);
+
+ /* clear ipi interrupt IRQ_SUPPLE_0 of CoreB */
+ bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + 1)));
+ SSYNC();
+
+ /* set CoreB wakeup by ipi0, iwr will be discarded */
+ bfin_iwr_set_sup0(&iwr, &iwr, &iwr);
+ SSYNC();
+
+ coreb_die();
+}