diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2011-09-08 08:15:22 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-09-13 09:34:50 -0400 |
commit | 3695adc2fdaf3ad1881e0dd3e3422e5e141abd7d (patch) | |
tree | b8bef89c2d2f7527a78b2241e7729c6858927012 /arch/arm/mach-vexpress | |
parent | abcee5fb0dfbb248d883a2f6bdb4820abe3ac524 (diff) |
ARM: SoC: convert VExpress/RealView to SMP operations
Convert both Realview and VExpress to use struct smp_operations to
provide their SMP and CPU hotplug operation.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-vexpress')
-rw-r--r-- | arch/arm/mach-vexpress/core.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/hotplug.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/platsmp.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/v2m.c | 4 |
4 files changed, 23 insertions, 19 deletions
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h index a3a4980770bd..f134cd4a85f1 100644 --- a/arch/arm/mach-vexpress/core.h +++ b/arch/arm/mach-vexpress/core.h | |||
@@ -5,3 +5,7 @@ | |||
5 | #define V2T_PERIPH 0xf8200000 | 5 | #define V2T_PERIPH 0xf8200000 |
6 | 6 | ||
7 | void vexpress_dt_smp_map_io(void); | 7 | void vexpress_dt_smp_map_io(void); |
8 | |||
9 | extern struct smp_operations vexpress_smp_ops; | ||
10 | |||
11 | extern void vexpress_cpu_die(unsigned int cpu); | ||
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c index c504a72b94d6..734423a39e7c 100644 --- a/arch/arm/mach-vexpress/hotplug.c +++ b/arch/arm/mach-vexpress/hotplug.c | |||
@@ -84,17 +84,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) | |||
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | int platform_cpu_kill(unsigned int cpu) | ||
88 | { | ||
89 | return 1; | ||
90 | } | ||
91 | |||
92 | /* | 87 | /* |
93 | * platform-specific code to shutdown a CPU | 88 | * platform-specific code to shutdown a CPU |
94 | * | 89 | * |
95 | * Called with IRQs disabled | 90 | * Called with IRQs disabled |
96 | */ | 91 | */ |
97 | void platform_cpu_die(unsigned int cpu) | 92 | void __ref vexpress_cpu_die(unsigned int cpu) |
98 | { | 93 | { |
99 | int spurious = 0; | 94 | int spurious = 0; |
100 | 95 | ||
@@ -113,12 +108,3 @@ void platform_cpu_die(unsigned int cpu) | |||
113 | if (spurious) | 108 | if (spurious) |
114 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | 109 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); |
115 | } | 110 | } |
116 | |||
117 | int platform_cpu_disable(unsigned int cpu) | ||
118 | { | ||
119 | /* | ||
120 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
121 | * e.g. clock tick interrupts) | ||
122 | */ | ||
123 | return cpu == 0 ? -EPERM : 0; | ||
124 | } | ||
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index 14ba1128ae8d..7db27c8c05cc 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c | |||
@@ -20,9 +20,9 @@ | |||
20 | 20 | ||
21 | #include <mach/motherboard.h> | 21 | #include <mach/motherboard.h> |
22 | 22 | ||
23 | #include "core.h" | 23 | #include <plat/platsmp.h> |
24 | 24 | ||
25 | extern void versatile_secondary_startup(void); | 25 | #include "core.h" |
26 | 26 | ||
27 | #if defined(CONFIG_OF) | 27 | #if defined(CONFIG_OF) |
28 | 28 | ||
@@ -167,7 +167,7 @@ void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus) | |||
167 | * Initialise the CPU possible map early - this describes the CPUs | 167 | * Initialise the CPU possible map early - this describes the CPUs |
168 | * which may be present or become present in the system. | 168 | * which may be present or become present in the system. |
169 | */ | 169 | */ |
170 | void __init smp_init_cpus(void) | 170 | static void __init vexpress_smp_init_cpus(void) |
171 | { | 171 | { |
172 | if (ct_desc) | 172 | if (ct_desc) |
173 | ct_desc->init_cpu_map(); | 173 | ct_desc->init_cpu_map(); |
@@ -176,7 +176,7 @@ void __init smp_init_cpus(void) | |||
176 | 176 | ||
177 | } | 177 | } |
178 | 178 | ||
179 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) | 179 | static void __init vexpress_smp_prepare_cpus(unsigned int max_cpus) |
180 | { | 180 | { |
181 | /* | 181 | /* |
182 | * Initialise the present map, which describes the set of CPUs | 182 | * Initialise the present map, which describes the set of CPUs |
@@ -195,3 +195,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus) | |||
195 | */ | 195 | */ |
196 | v2m_flags_set(virt_to_phys(versatile_secondary_startup)); | 196 | v2m_flags_set(virt_to_phys(versatile_secondary_startup)); |
197 | } | 197 | } |
198 | |||
199 | struct smp_operations __initdata vexpress_smp_ops = { | ||
200 | .smp_init_cpus = vexpress_smp_init_cpus, | ||
201 | .smp_prepare_cpus = vexpress_smp_prepare_cpus, | ||
202 | .smp_secondary_init = versatile_secondary_init, | ||
203 | .smp_boot_secondary = versatile_boot_secondary, | ||
204 | #ifdef CONFIG_HOTPLUG_CPU | ||
205 | .cpu_die = vexpress_cpu_die, | ||
206 | #endif | ||
207 | }; | ||
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 37608f22ee31..722ef339c5f2 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/amba/bus.h> | 5 | #include <linux/amba/bus.h> |
6 | #include <linux/amba/mmci.h> | 6 | #include <linux/amba/mmci.h> |
7 | #include <linux/io.h> | 7 | #include <linux/io.h> |
8 | #include <linux/smp.h> | ||
8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
9 | #include <linux/of_address.h> | 10 | #include <linux/of_address.h> |
10 | #include <linux/of_fdt.h> | 11 | #include <linux/of_fdt.h> |
@@ -38,6 +39,7 @@ | |||
38 | #include <mach/motherboard.h> | 39 | #include <mach/motherboard.h> |
39 | 40 | ||
40 | #include <plat/sched_clock.h> | 41 | #include <plat/sched_clock.h> |
42 | #include <plat/platsmp.h> | ||
41 | 43 | ||
42 | #include "core.h" | 44 | #include "core.h" |
43 | 45 | ||
@@ -530,6 +532,7 @@ static void __init v2m_init(void) | |||
530 | 532 | ||
531 | MACHINE_START(VEXPRESS, "ARM-Versatile Express") | 533 | MACHINE_START(VEXPRESS, "ARM-Versatile Express") |
532 | .atag_offset = 0x100, | 534 | .atag_offset = 0x100, |
535 | .smp = smp_ops(vexpress_smp_ops), | ||
533 | .map_io = v2m_map_io, | 536 | .map_io = v2m_map_io, |
534 | .init_early = v2m_init_early, | 537 | .init_early = v2m_init_early, |
535 | .init_irq = v2m_init_irq, | 538 | .init_irq = v2m_init_irq, |
@@ -663,6 +666,7 @@ const static char *v2m_dt_match[] __initconst = { | |||
663 | 666 | ||
664 | DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") | 667 | DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") |
665 | .dt_compat = v2m_dt_match, | 668 | .dt_compat = v2m_dt_match, |
669 | .smp = smp_ops(vexpress_smp_ops), | ||
666 | .map_io = v2m_dt_map_io, | 670 | .map_io = v2m_dt_map_io, |
667 | .init_early = v2m_dt_init_early, | 671 | .init_early = v2m_dt_init_early, |
668 | .init_irq = v2m_dt_init_irq, | 672 | .init_irq = v2m_dt_init_irq, |