aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-highbank
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-09-05 10:36:18 -0400
committerArnd Bergmann <arnd@arndb.de>2012-09-14 05:14:59 -0400
commit7ad71b61e744e7c565eec9e7aa734b0c42d93b16 (patch)
tree9698f530932cac6db43006c11b06eda02b3a03c8 /arch/arm/mach-highbank
parenta62580e58065dc00430b16ced6e7a00837b8323f (diff)
ARM: SoC: convert highbank to SMP operations
Convert the highbank platform to use struct smp_operations to provide its SMP and CPU hotplug operations. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-highbank')
-rw-r--r--arch/arm/mach-highbank/core.h3
-rw-r--r--arch/arm/mach-highbank/highbank.c1
-rw-r--r--arch/arm/mach-highbank/hotplug.c16
-rw-r--r--arch/arm/mach-highbank/platsmp.c18
4 files changed, 19 insertions, 19 deletions
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
index 141ed5171826..598ee7882b03 100644
--- a/arch/arm/mach-highbank/core.h
+++ b/arch/arm/mach-highbank/core.h
@@ -9,3 +9,6 @@ static inline void highbank_lluart_map_io(void) {}
9#endif 9#endif
10 10
11extern void highbank_smc1(int fn, int arg); 11extern void highbank_smc1(int fn, int arg);
12extern void highbank_cpu_die(unsigned int cpu);
13
14extern struct smp_operations highbank_smp_ops;
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index d75b0a78d88a..709bd72204b9 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -162,6 +162,7 @@ static const char *highbank_match[] __initconst = {
162}; 162};
163 163
164DT_MACHINE_START(HIGHBANK, "Highbank") 164DT_MACHINE_START(HIGHBANK, "Highbank")
165 .smp = smp_ops(highbank_smp_ops),
165 .map_io = highbank_map_io, 166 .map_io = highbank_map_io,
166 .init_irq = highbank_init_irq, 167 .init_irq = highbank_init_irq,
167 .timer = &highbank_timer, 168 .timer = &highbank_timer,
diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c
index 977cebbea580..2c1b8c3c8e45 100644
--- a/arch/arm/mach-highbank/hotplug.c
+++ b/arch/arm/mach-highbank/hotplug.c
@@ -24,16 +24,11 @@
24 24
25extern void secondary_startup(void); 25extern void secondary_startup(void);
26 26
27int platform_cpu_kill(unsigned int cpu)
28{
29 return 1;
30}
31
32/* 27/*
33 * platform-specific code to shutdown a CPU 28 * platform-specific code to shutdown a CPU
34 * 29 *
35 */ 30 */
36void platform_cpu_die(unsigned int cpu) 31void __ref highbank_cpu_die(unsigned int cpu)
37{ 32{
38 flush_cache_all(); 33 flush_cache_all();
39 34
@@ -45,12 +40,3 @@ void platform_cpu_die(unsigned int cpu)
45 /* We should never return from idle */ 40 /* We should never return from idle */
46 panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu); 41 panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
47} 42}
48
49int platform_cpu_disable(unsigned int cpu)
50{
51 /*
52 * CPU0 should not be shut down via hotplug. cpu_idle can WFI
53 * or a proper shutdown or hibernate should be used.
54 */
55 return cpu == 0 ? -EPERM : 0;
56}
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
index d01364c72b45..fa9560ec6e70 100644
--- a/arch/arm/mach-highbank/platsmp.c
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -25,12 +25,12 @@
25 25
26extern void secondary_startup(void); 26extern void secondary_startup(void);
27 27
28void __cpuinit platform_secondary_init(unsigned int cpu) 28static void __cpuinit highbank_secondary_init(unsigned int cpu)
29{ 29{
30 gic_secondary_init(0); 30 gic_secondary_init(0);
31} 31}
32 32
33int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 33static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
34{ 34{
35 gic_raise_softirq(cpumask_of(cpu), 0); 35 gic_raise_softirq(cpumask_of(cpu), 0);
36 return 0; 36 return 0;
@@ -40,7 +40,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
40 * Initialise the CPU possible map early - this describes the CPUs 40 * Initialise the CPU possible map early - this describes the CPUs
41 * which may be present or become present in the system. 41 * which may be present or become present in the system.
42 */ 42 */
43void __init smp_init_cpus(void) 43static void __init highbank_smp_init_cpus(void)
44{ 44{
45 unsigned int i, ncores; 45 unsigned int i, ncores;
46 46
@@ -61,7 +61,7 @@ void __init smp_init_cpus(void)
61 set_smp_cross_call(gic_raise_softirq); 61 set_smp_cross_call(gic_raise_softirq);
62} 62}
63 63
64void __init platform_smp_prepare_cpus(unsigned int max_cpus) 64static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
65{ 65{
66 int i; 66 int i;
67 67
@@ -76,3 +76,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
76 for (i = 1; i < max_cpus; i++) 76 for (i = 1; i < max_cpus; i++)
77 highbank_set_cpu_jump(i, secondary_startup); 77 highbank_set_cpu_jump(i, secondary_startup);
78} 78}
79
80struct smp_operations highbank_smp_ops __initdata = {
81 .smp_init_cpus = highbank_smp_init_cpus,
82 .smp_prepare_cpus = highbank_smp_prepare_cpus,
83 .smp_secondary_init = highbank_secondary_init,
84 .smp_boot_secondary = highbank_boot_secondary,
85#ifdef CONFIG_HOTPLUG_CPU
86 .cpu_die = highbank_cpu_die,
87#endif
88};