aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2011-09-08 08:15:22 -0400
committerArnd Bergmann <arnd@arndb.de>2012-09-14 05:14:57 -0400
commit44ea349f5b7e0b4865de9ca6b4437c746eede40c (patch)
treefc6b41a24bc610dc7afedc3117fd84a6f3b6b2fa /arch/arm/mach-msm
parent06853ae475e1386d6d11d139ba7bf2c97b3d1768 (diff)
ARM: SoC: convert MSM to SMP operations
Convert MSM SMP platforms to use struct smp_operations to provide their SMP and CPU hotplug operations. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Cc: David Brown <davidb@codeaurora.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-msm')
-rw-r--r--arch/arm/mach-msm/board-msm8960.c3
-rw-r--r--arch/arm/mach-msm/board-msm8x60.c7
-rw-r--r--arch/arm/mach-msm/core.h2
-rw-r--r--arch/arm/mach-msm/hotplug.c18
-rw-r--r--arch/arm/mach-msm/platsmp.c19
5 files changed, 30 insertions, 19 deletions
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index 65f4a1daa2e5..a1569681df7d 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -30,6 +30,7 @@
30#include <mach/board.h> 30#include <mach/board.h>
31#include <mach/msm_iomap.h> 31#include <mach/msm_iomap.h>
32 32
33#include "core.h"
33#include "devices.h" 34#include "devices.h"
34 35
35static void __init msm8960_fixup(struct tag *tag, char **cmdline, 36static void __init msm8960_fixup(struct tag *tag, char **cmdline,
@@ -99,6 +100,7 @@ static void __init msm8960_init_late(void)
99} 100}
100 101
101MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") 102MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
103 .smp = smp_ops(msm_smp_ops),
102 .fixup = msm8960_fixup, 104 .fixup = msm8960_fixup,
103 .reserve = msm8960_reserve, 105 .reserve = msm8960_reserve,
104 .map_io = msm8960_map_io, 106 .map_io = msm8960_map_io,
@@ -110,6 +112,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
110MACHINE_END 112MACHINE_END
111 113
112MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") 114MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
115 .smp = smp_ops(msm_smp_ops),
113 .fixup = msm8960_fixup, 116 .fixup = msm8960_fixup,
114 .reserve = msm8960_reserve, 117 .reserve = msm8960_reserve,
115 .map_io = msm8960_map_io, 118 .map_io = msm8960_map_io,
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index e37a724cd1eb..dc2abd341dab 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -29,6 +29,8 @@
29#include <mach/board.h> 29#include <mach/board.h>
30#include <mach/msm_iomap.h> 30#include <mach/msm_iomap.h>
31 31
32#include "core.h"
33
32static void __init msm8x60_fixup(struct tag *tag, char **cmdline, 34static void __init msm8x60_fixup(struct tag *tag, char **cmdline,
33 struct meminfo *mi) 35 struct meminfo *mi)
34{ 36{
@@ -110,6 +112,7 @@ static const char *msm8x60_fluid_match[] __initdata = {
110#endif /* CONFIG_OF */ 112#endif /* CONFIG_OF */
111 113
112MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3") 114MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
115 .smp = smp_ops(msm_smp_ops),
113 .fixup = msm8x60_fixup, 116 .fixup = msm8x60_fixup,
114 .reserve = msm8x60_reserve, 117 .reserve = msm8x60_reserve,
115 .map_io = msm8x60_map_io, 118 .map_io = msm8x60_map_io,
@@ -121,6 +124,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
121MACHINE_END 124MACHINE_END
122 125
123MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF") 126MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
127 .smp = smp_ops(msm_smp_ops),
124 .fixup = msm8x60_fixup, 128 .fixup = msm8x60_fixup,
125 .reserve = msm8x60_reserve, 129 .reserve = msm8x60_reserve,
126 .map_io = msm8x60_map_io, 130 .map_io = msm8x60_map_io,
@@ -132,6 +136,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
132MACHINE_END 136MACHINE_END
133 137
134MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR") 138MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
139 .smp = smp_ops(msm_smp_ops),
135 .fixup = msm8x60_fixup, 140 .fixup = msm8x60_fixup,
136 .reserve = msm8x60_reserve, 141 .reserve = msm8x60_reserve,
137 .map_io = msm8x60_map_io, 142 .map_io = msm8x60_map_io,
@@ -143,6 +148,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
143MACHINE_END 148MACHINE_END
144 149
145MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA") 150MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
151 .smp = smp_ops(msm_smp_ops),
146 .fixup = msm8x60_fixup, 152 .fixup = msm8x60_fixup,
147 .reserve = msm8x60_reserve, 153 .reserve = msm8x60_reserve,
148 .map_io = msm8x60_map_io, 154 .map_io = msm8x60_map_io,
@@ -156,6 +162,7 @@ MACHINE_END
156#ifdef CONFIG_OF 162#ifdef CONFIG_OF
157/* TODO: General device tree support for all MSM. */ 163/* TODO: General device tree support for all MSM. */
158DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") 164DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
165 .smp = smp_ops(msm_smp_ops),
159 .map_io = msm8x60_map_io, 166 .map_io = msm8x60_map_io,
160 .init_irq = msm8x60_init_irq, 167 .init_irq = msm8x60_init_irq,
161 .init_machine = msm8x60_dt_init, 168 .init_machine = msm8x60_dt_init,
diff --git a/arch/arm/mach-msm/core.h b/arch/arm/mach-msm/core.h
new file mode 100644
index 000000000000..a9bab53dddf4
--- /dev/null
+++ b/arch/arm/mach-msm/core.h
@@ -0,0 +1,2 @@
1extern struct smp_operations msm_smp_ops;
2extern void msm_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
index a446fc14221f..fedaa25b2935 100644
--- a/arch/arm/mach-msm/hotplug.c
+++ b/arch/arm/mach-msm/hotplug.c
@@ -13,6 +13,8 @@
13#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
14#include <asm/smp_plat.h> 14#include <asm/smp_plat.h>
15 15
16#include "core.h"
17
16extern volatile int pen_release; 18extern volatile int pen_release;
17 19
18static inline void cpu_enter_lowpower(void) 20static inline void cpu_enter_lowpower(void)
@@ -57,17 +59,12 @@ static inline void platform_do_lowpower(unsigned int cpu)
57 } 59 }
58} 60}
59 61
60int platform_cpu_kill(unsigned int cpu)
61{
62 return 1;
63}
64
65/* 62/*
66 * platform-specific code to shutdown a CPU 63 * platform-specific code to shutdown a CPU
67 * 64 *
68 * Called with IRQs disabled 65 * Called with IRQs disabled
69 */ 66 */
70void platform_cpu_die(unsigned int cpu) 67void __ref msm_cpu_die(unsigned int cpu)
71{ 68{
72 /* 69 /*
73 * we're ready for shutdown now, so do it 70 * we're ready for shutdown now, so do it
@@ -81,12 +78,3 @@ void platform_cpu_die(unsigned int cpu)
81 */ 78 */
82 cpu_leave_lowpower(); 79 cpu_leave_lowpower();
83} 80}
84
85int platform_cpu_disable(unsigned int cpu)
86{
87 /*
88 * we don't allow CPU 0 to be shutdown (it is still too special
89 * e.g. clock tick interrupts)
90 */
91 return cpu == 0 ? -EPERM : 0;
92}
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index e012dc8391cf..ba3c4b0d523d 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -25,6 +25,7 @@
25#include <mach/msm_iomap.h> 25#include <mach/msm_iomap.h>
26 26
27#include "scm-boot.h" 27#include "scm-boot.h"
28#include "core.h"
28 29
29#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0 30#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
30#define SCSS_CPU1CORE_RESET 0xD80 31#define SCSS_CPU1CORE_RESET 0xD80
@@ -48,7 +49,7 @@ static inline int get_core_count(void)
48 return ((read_cpuid_id() >> 4) & 3) + 1; 49 return ((read_cpuid_id() >> 4) & 3) + 1;
49} 50}
50 51
51void __cpuinit platform_secondary_init(unsigned int cpu) 52static void __cpuinit msm_secondary_init(unsigned int cpu)
52{ 53{
53 /* Configure edge-triggered PPIs */ 54 /* Configure edge-triggered PPIs */
54 writel(GIC_PPI_EDGE_MASK, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); 55 writel(GIC_PPI_EDGE_MASK, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
@@ -93,7 +94,7 @@ static __cpuinit void prepare_cold_cpu(unsigned int cpu)
93 "address\n"); 94 "address\n");
94} 95}
95 96
96int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 97static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
97{ 98{
98 unsigned long timeout; 99 unsigned long timeout;
99 static int cold_boot_done; 100 static int cold_boot_done;
@@ -153,7 +154,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
153 * does not support the ARM SCU, so just set the possible cpu mask to 154 * does not support the ARM SCU, so just set the possible cpu mask to
154 * NR_CPUS. 155 * NR_CPUS.
155 */ 156 */
156void __init smp_init_cpus(void) 157static void __init msm_smp_init_cpus(void)
157{ 158{
158 unsigned int i, ncores = get_core_count(); 159 unsigned int i, ncores = get_core_count();
159 160
@@ -169,6 +170,16 @@ void __init smp_init_cpus(void)
169 set_smp_cross_call(gic_raise_softirq); 170 set_smp_cross_call(gic_raise_softirq);
170} 171}
171 172
172void __init platform_smp_prepare_cpus(unsigned int max_cpus) 173static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
173{ 174{
174} 175}
176
177struct smp_operations msm_smp_ops __initdata = {
178 .smp_init_cpus = msm_smp_init_cpus,
179 .smp_prepare_cpus = msm_smp_prepare_cpus,
180 .smp_secondary_init = msm_secondary_init,
181 .smp_boot_secondary = msm_boot_secondary,
182#ifdef CONFIG_HOTPLUG_CPU
183 .cpu_die = msm_cpu_die,
184#endif
185};