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:57 -0400 |
commit | 06915321e7935d2eb778f0a7f333b2603c1404df (patch) | |
tree | edcab1162a19d1163c00134f2d2c163e71a566ba | |
parent | 3695adc2fdaf3ad1881e0dd3e3422e5e141abd7d (diff) |
ARM: SoC: convert OMAP4 to SMP operations
Convert OMAP4 to use struct smp_operations to provide its SMP
and CPU hotplug operations.
Tested on both Panda and IGEPv2 (MULTI_OMAP kernel)
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap-hotplug.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap-smp.c | 18 |
6 files changed, 24 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index ad8a7d94afcd..0e63d80ff9c7 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -909,6 +909,7 @@ static void __init omap_4430sdp_init(void) | |||
909 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") | 909 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") |
910 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ | 910 | /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ |
911 | .atag_offset = 0x100, | 911 | .atag_offset = 0x100, |
912 | .smp = smp_ops(omap4_smp_ops), | ||
912 | .reserve = omap_reserve, | 913 | .reserve = omap_reserve, |
913 | .map_io = omap4_map_io, | 914 | .map_io = omap4_map_io, |
914 | .init_early = omap4430_init_early, | 915 | .init_early = omap4430_init_early, |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 6f93a20536ea..82dcf00dad22 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -127,6 +127,7 @@ static const char *omap4_boards_compat[] __initdata = { | |||
127 | 127 | ||
128 | DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") | 128 | DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") |
129 | .reserve = omap_reserve, | 129 | .reserve = omap_reserve, |
130 | .smp = smp_ops(omap4_smp_ops), | ||
130 | .map_io = omap4_map_io, | 131 | .map_io = omap4_map_io, |
131 | .init_early = omap4430_init_early, | 132 | .init_early = omap4430_init_early, |
132 | .init_irq = omap_gic_of_init, | 133 | .init_irq = omap_gic_of_init, |
@@ -147,6 +148,7 @@ static const char *omap5_boards_compat[] __initdata = { | |||
147 | 148 | ||
148 | DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") | 149 | DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") |
149 | .reserve = omap_reserve, | 150 | .reserve = omap_reserve, |
151 | .smp = smp_ops(omap4_smp_ops), | ||
150 | .map_io = omap5_map_io, | 152 | .map_io = omap5_map_io, |
151 | .init_early = omap5_init_early, | 153 | .init_early = omap5_init_early, |
152 | .init_irq = omap_gic_of_init, | 154 | .init_irq = omap_gic_of_init, |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 70f6d1d25463..abbf239f137a 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -518,6 +518,7 @@ static void __init omap4_panda_init(void) | |||
518 | MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") | 518 | MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") |
519 | /* Maintainer: David Anders - Texas Instruments Inc */ | 519 | /* Maintainer: David Anders - Texas Instruments Inc */ |
520 | .atag_offset = 0x100, | 520 | .atag_offset = 0x100, |
521 | .smp = smp_ops(omap4_smp_ops), | ||
521 | .reserve = omap_reserve, | 522 | .reserve = omap_reserve, |
522 | .map_io = omap4_map_io, | 523 | .map_io = omap4_map_io, |
523 | .init_early = omap4430_init_early, | 524 | .init_early = omap4430_init_early, |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 1f65b1871c23..229610687315 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -278,6 +278,11 @@ extern void omap_secondary_startup(void); | |||
278 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); | 278 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); |
279 | extern void omap_auxcoreboot_addr(u32 cpu_addr); | 279 | extern void omap_auxcoreboot_addr(u32 cpu_addr); |
280 | extern u32 omap_read_auxcoreboot0(void); | 280 | extern u32 omap_read_auxcoreboot0(void); |
281 | |||
282 | extern void omap4_cpu_die(unsigned int cpu); | ||
283 | |||
284 | extern struct smp_operations omap4_smp_ops; | ||
285 | |||
281 | extern void omap5_secondary_startup(void); | 286 | extern void omap5_secondary_startup(void); |
282 | #endif | 287 | #endif |
283 | 288 | ||
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c index 414083b427df..2de71a34b691 100644 --- a/arch/arm/mach-omap2/omap-hotplug.c +++ b/arch/arm/mach-omap2/omap-hotplug.c | |||
@@ -26,16 +26,11 @@ | |||
26 | 26 | ||
27 | #include "powerdomain.h" | 27 | #include "powerdomain.h" |
28 | 28 | ||
29 | int platform_cpu_kill(unsigned int cpu) | ||
30 | { | ||
31 | return 1; | ||
32 | } | ||
33 | |||
34 | /* | 29 | /* |
35 | * platform-specific code to shutdown a CPU | 30 | * platform-specific code to shutdown a CPU |
36 | * Called with IRQs disabled | 31 | * Called with IRQs disabled |
37 | */ | 32 | */ |
38 | void __ref platform_cpu_die(unsigned int cpu) | 33 | void __ref omap4_cpu_die(unsigned int cpu) |
39 | { | 34 | { |
40 | unsigned int boot_cpu = 0; | 35 | unsigned int boot_cpu = 0; |
41 | void __iomem *base = omap_get_wakeupgen_base(); | 36 | void __iomem *base = omap_get_wakeupgen_base(); |
@@ -75,12 +70,3 @@ void __ref platform_cpu_die(unsigned int cpu) | |||
75 | pr_debug("CPU%u: spurious wakeup call\n", cpu); | 70 | pr_debug("CPU%u: spurious wakeup call\n", cpu); |
76 | } | 71 | } |
77 | } | 72 | } |
78 | |||
79 | int platform_cpu_disable(unsigned int cpu) | ||
80 | { | ||
81 | /* | ||
82 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
83 | * e.g. clock tick interrupts) | ||
84 | */ | ||
85 | return cpu == 0 ? -EPERM : 0; | ||
86 | } | ||
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 9a35adf91232..046fa0d6969f 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -49,7 +49,7 @@ void __iomem *omap4_get_scu_base(void) | |||
49 | return scu_base; | 49 | return scu_base; |
50 | } | 50 | } |
51 | 51 | ||
52 | void __cpuinit platform_secondary_init(unsigned int cpu) | 52 | static void __cpuinit omap4_secondary_init(unsigned int cpu) |
53 | { | 53 | { |
54 | /* | 54 | /* |
55 | * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device. | 55 | * Configure ACTRL and enable NS SMP bit access on CPU1 on HS device. |
@@ -77,7 +77,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
77 | spin_unlock(&boot_lock); | 77 | spin_unlock(&boot_lock); |
78 | } | 78 | } |
79 | 79 | ||
80 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 80 | static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) |
81 | { | 81 | { |
82 | static struct clockdomain *cpu1_clkdm; | 82 | static struct clockdomain *cpu1_clkdm; |
83 | static bool booted; | 83 | static bool booted; |
@@ -165,7 +165,7 @@ static void __init wakeup_secondary(void) | |||
165 | * Initialise the CPU possible map early - this describes the CPUs | 165 | * Initialise the CPU possible map early - this describes the CPUs |
166 | * which may be present or become present in the system. | 166 | * which may be present or become present in the system. |
167 | */ | 167 | */ |
168 | void __init smp_init_cpus(void) | 168 | static void __init omap4_smp_init_cpus(void) |
169 | { | 169 | { |
170 | unsigned int i = 0, ncores = 1, cpu_id; | 170 | unsigned int i = 0, ncores = 1, cpu_id; |
171 | 171 | ||
@@ -196,7 +196,7 @@ void __init smp_init_cpus(void) | |||
196 | set_smp_cross_call(gic_raise_softirq); | 196 | set_smp_cross_call(gic_raise_softirq); |
197 | } | 197 | } |
198 | 198 | ||
199 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) | 199 | static void __init omap4_smp_prepare_cpus(unsigned int max_cpus) |
200 | { | 200 | { |
201 | 201 | ||
202 | /* | 202 | /* |
@@ -207,3 +207,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus) | |||
207 | scu_enable(scu_base); | 207 | scu_enable(scu_base); |
208 | wakeup_secondary(); | 208 | wakeup_secondary(); |
209 | } | 209 | } |
210 | |||
211 | struct smp_operations omap4_smp_ops __initdata = { | ||
212 | .smp_init_cpus = omap4_smp_init_cpus, | ||
213 | .smp_prepare_cpus = omap4_smp_prepare_cpus, | ||
214 | .smp_secondary_init = omap4_secondary_init, | ||
215 | .smp_boot_secondary = omap4_boot_secondary, | ||
216 | #ifdef CONFIG_HOTPLUG_CPU | ||
217 | .cpu_die = omap4_cpu_die, | ||
218 | #endif | ||
219 | }; | ||