Commit 7ad71b61 authored by Marc Zyngier's avatar Marc Zyngier Committed by Arnd Bergmann

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: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent a62580e5
...@@ -9,3 +9,6 @@ static inline void highbank_lluart_map_io(void) {} ...@@ -9,3 +9,6 @@ static inline void highbank_lluart_map_io(void) {}
#endif #endif
extern void highbank_smc1(int fn, int arg); extern void highbank_smc1(int fn, int arg);
extern void highbank_cpu_die(unsigned int cpu);
extern struct smp_operations highbank_smp_ops;
...@@ -162,6 +162,7 @@ static const char *highbank_match[] __initconst = { ...@@ -162,6 +162,7 @@ static const char *highbank_match[] __initconst = {
}; };
DT_MACHINE_START(HIGHBANK, "Highbank") DT_MACHINE_START(HIGHBANK, "Highbank")
.smp = smp_ops(highbank_smp_ops),
.map_io = highbank_map_io, .map_io = highbank_map_io,
.init_irq = highbank_init_irq, .init_irq = highbank_init_irq,
.timer = &highbank_timer, .timer = &highbank_timer,
......
...@@ -24,16 +24,11 @@ ...@@ -24,16 +24,11 @@
extern void secondary_startup(void); extern void secondary_startup(void);
int platform_cpu_kill(unsigned int cpu)
{
return 1;
}
/* /*
* platform-specific code to shutdown a CPU * platform-specific code to shutdown a CPU
* *
*/ */
void platform_cpu_die(unsigned int cpu) void __ref highbank_cpu_die(unsigned int cpu)
{ {
flush_cache_all(); flush_cache_all();
...@@ -45,12 +40,3 @@ void platform_cpu_die(unsigned int cpu) ...@@ -45,12 +40,3 @@ void platform_cpu_die(unsigned int cpu)
/* We should never return from idle */ /* We should never return from idle */
panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu); panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
} }
int platform_cpu_disable(unsigned int cpu)
{
/*
* CPU0 should not be shut down via hotplug. cpu_idle can WFI
* or a proper shutdown or hibernate should be used.
*/
return cpu == 0 ? -EPERM : 0;
}
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
extern void secondary_startup(void); extern void secondary_startup(void);
void __cpuinit platform_secondary_init(unsigned int cpu) static void __cpuinit highbank_secondary_init(unsigned int cpu)
{ {
gic_secondary_init(0); gic_secondary_init(0);
} }
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
{ {
gic_raise_softirq(cpumask_of(cpu), 0); gic_raise_softirq(cpumask_of(cpu), 0);
return 0; return 0;
...@@ -40,7 +40,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -40,7 +40,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Initialise the CPU possible map early - this describes the CPUs * Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system. * which may be present or become present in the system.
*/ */
void __init smp_init_cpus(void) static void __init highbank_smp_init_cpus(void)
{ {
unsigned int i, ncores; unsigned int i, ncores;
...@@ -61,7 +61,7 @@ void __init smp_init_cpus(void) ...@@ -61,7 +61,7 @@ void __init smp_init_cpus(void)
set_smp_cross_call(gic_raise_softirq); set_smp_cross_call(gic_raise_softirq);
} }
void __init platform_smp_prepare_cpus(unsigned int max_cpus) static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
{ {
int i; int i;
...@@ -76,3 +76,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus) ...@@ -76,3 +76,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
for (i = 1; i < max_cpus; i++) for (i = 1; i < max_cpus; i++)
highbank_set_cpu_jump(i, secondary_startup); highbank_set_cpu_jump(i, secondary_startup);
} }
struct smp_operations highbank_smp_ops __initdata = {
.smp_init_cpus = highbank_smp_init_cpus,
.smp_prepare_cpus = highbank_smp_prepare_cpus,
.smp_secondary_init = highbank_secondary_init,
.smp_boot_secondary = highbank_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU
.cpu_die = highbank_cpu_die,
#endif
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment