aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorJeff Ohlstein <johlstei@codeaurora.org>2010-12-02 15:11:27 -0500
committerDavid Brown <davidb@codeaurora.org>2011-01-07 18:54:44 -0500
commit9f1890a5de2a5fcf4fd9ffa3115047eed834349c (patch)
tree8f7f7931a22399409057824f1f912fd6f8a86112 /arch/arm
parent94790ec25fdd51dc4126cc176f2e104f80f87fcb (diff)
msm: hotplug: support cpu hotplug on msm
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org> Signed-off-by: David Brown <davidb@codeaurora.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-msm/Makefile2
-rw-r--r--arch/arm/mach-msm/hotplug.c91
2 files changed, 93 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 5765ef1e60fc..c673e5fdabf9 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -20,6 +20,8 @@ obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
20obj-$(CONFIG_MSM_SMD) += last_radio_log.o 20obj-$(CONFIG_MSM_SMD) += last_radio_log.o
21obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o 21obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
22 22
23obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
24
23obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o 25obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
24obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o 26obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
25obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o 27obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
new file mode 100644
index 000000000000..5a31f70dfb8e
--- /dev/null
+++ b/arch/arm/mach-msm/hotplug.c
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2002 ARM Ltd.
3 * All Rights Reserved
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#include <linux/kernel.h>
10#include <linux/errno.h>
11#include <linux/smp.h>
12
13#include <asm/cacheflush.h>
14
15extern volatile int pen_release;
16
17static inline void cpu_enter_lowpower(void)
18{
19 /* Just flush the cache. Changing the coherency is not yet
20 * available on msm. */
21 flush_cache_all();
22}
23
24static inline void cpu_leave_lowpower(void)
25{
26}
27
28static inline void platform_do_lowpower(unsigned int cpu)
29{
30 /* Just enter wfi for now. TODO: Properly shut off the cpu. */
31 for (;;) {
32 /*
33 * here's the WFI
34 */
35 asm("wfi"
36 :
37 :
38 : "memory", "cc");
39
40 if (pen_release == cpu) {
41 /*
42 * OK, proper wakeup, we're done
43 */
44 break;
45 }
46
47 /*
48 * getting here, means that we have come out of WFI without
49 * having been woken up - this shouldn't happen
50 *
51 * The trouble is, letting people know about this is not really
52 * possible, since we are currently running incoherently, and
53 * therefore cannot safely call printk() or anything else
54 */
55 pr_debug("CPU%u: spurious wakeup call\n", cpu);
56 }
57}
58
59int platform_cpu_kill(unsigned int cpu)
60{
61 return 1;
62}
63
64/*
65 * platform-specific code to shutdown a CPU
66 *
67 * Called with IRQs disabled
68 */
69void platform_cpu_die(unsigned int cpu)
70{
71 /*
72 * we're ready for shutdown now, so do it
73 */
74 cpu_enter_lowpower();
75 platform_do_lowpower(cpu);
76
77 /*
78 * bring this CPU back into the world of cache
79 * coherency, and then restore interrupts
80 */
81 cpu_leave_lowpower();
82}
83
84int platform_cpu_disable(unsigned int cpu)
85{
86 /*
87 * we don't allow CPU 0 to be shutdown (it is still too special
88 * e.g. clock tick interrupts)
89 */
90 return cpu == 0 ? -EPERM : 0;
91}