diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2011-09-08 08:15:22 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-09-14 05:14:50 -0400 |
commit | 06853ae475e1386d6d11d139ba7bf2c97b3d1768 (patch) | |
tree | 601470fcced6d92d29017b6efefbb4bdc2008a0f /arch/arm/mach-exynos | |
parent | a17257322f5e6ca376c15908b55423369274fcad (diff) |
ARM: SoC: convert Exynos4 to SMP operations
Convert Exynos4 to use struct smp_operations to provide its SMP
and CPU hotplug operations.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/common.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos/hotplug.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-armlex4210.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos5-dt.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-nuri.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-origen.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-smdk4x12.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-smdkv310.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-universal_c210.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/platsmp.c | 20 |
10 files changed, 33 insertions, 19 deletions
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index aed2eeb06517..dac146df79ac 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | extern struct sys_timer exynos4_timer; | 15 | extern struct sys_timer exynos4_timer; |
16 | 16 | ||
17 | struct map_desc; | ||
17 | void exynos_init_io(struct map_desc *mach_desc, int size); | 18 | void exynos_init_io(struct map_desc *mach_desc, int size); |
18 | void exynos4_init_irq(void); | 19 | void exynos4_init_irq(void); |
19 | void exynos5_init_irq(void); | 20 | void exynos5_init_irq(void); |
@@ -59,4 +60,8 @@ void exynos4212_register_clocks(void); | |||
59 | #define exynos4212_register_clocks() | 60 | #define exynos4212_register_clocks() |
60 | #endif | 61 | #endif |
61 | 62 | ||
63 | extern struct smp_operations exynos_smp_ops; | ||
64 | |||
65 | extern void exynos_cpu_die(unsigned int cpu); | ||
66 | |||
62 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ | 67 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ |
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 9c17a0a43858..edccc36dd692 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include <mach/regs-pmu.h> | 22 | #include <mach/regs-pmu.h> |
23 | 23 | ||
24 | #include "common.h" | ||
25 | |||
24 | extern volatile int pen_release; | 26 | extern volatile int pen_release; |
25 | 27 | ||
26 | static inline void cpu_enter_lowpower(void) | 28 | static inline void cpu_enter_lowpower(void) |
@@ -95,17 +97,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) | |||
95 | } | 97 | } |
96 | } | 98 | } |
97 | 99 | ||
98 | int platform_cpu_kill(unsigned int cpu) | ||
99 | { | ||
100 | return 1; | ||
101 | } | ||
102 | |||
103 | /* | 100 | /* |
104 | * platform-specific code to shutdown a CPU | 101 | * platform-specific code to shutdown a CPU |
105 | * | 102 | * |
106 | * Called with IRQs disabled | 103 | * Called with IRQs disabled |
107 | */ | 104 | */ |
108 | void platform_cpu_die(unsigned int cpu) | 105 | void __ref exynos_cpu_die(unsigned int cpu) |
109 | { | 106 | { |
110 | int spurious = 0; | 107 | int spurious = 0; |
111 | 108 | ||
@@ -124,12 +121,3 @@ void platform_cpu_die(unsigned int cpu) | |||
124 | if (spurious) | 121 | if (spurious) |
125 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | 122 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); |
126 | } | 123 | } |
127 | |||
128 | int platform_cpu_disable(unsigned int cpu) | ||
129 | { | ||
130 | /* | ||
131 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
132 | * e.g. clock tick interrupts) | ||
133 | */ | ||
134 | return cpu == 0 ? -EPERM : 0; | ||
135 | } | ||
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c index 5a3daa0168d8..3f37a5e8a1f4 100644 --- a/arch/arm/mach-exynos/mach-armlex4210.c +++ b/arch/arm/mach-exynos/mach-armlex4210.c | |||
@@ -199,6 +199,7 @@ static void __init armlex4210_machine_init(void) | |||
199 | MACHINE_START(ARMLEX4210, "ARMLEX4210") | 199 | MACHINE_START(ARMLEX4210, "ARMLEX4210") |
200 | /* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */ | 200 | /* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */ |
201 | .atag_offset = 0x100, | 201 | .atag_offset = 0x100, |
202 | .smp = smp_ops(exynos_smp_ops), | ||
202 | .init_irq = exynos4_init_irq, | 203 | .init_irq = exynos4_init_irq, |
203 | .map_io = armlex4210_map_io, | 204 | .map_io = armlex4210_map_io, |
204 | .handle_irq = gic_handle_irq, | 205 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index ef770bc2318f..8833060f77e9 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c | |||
@@ -79,6 +79,7 @@ static char const *exynos5250_dt_compat[] __initdata = { | |||
79 | DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") | 79 | DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") |
80 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | 80 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
81 | .init_irq = exynos5_init_irq, | 81 | .init_irq = exynos5_init_irq, |
82 | .smp = smp_ops(exynos_smp_ops), | ||
82 | .map_io = exynos5250_dt_map_io, | 83 | .map_io = exynos5250_dt_map_io, |
83 | .handle_irq = gic_handle_irq, | 84 | .handle_irq = gic_handle_irq, |
84 | .init_machine = exynos5250_dt_machine_init, | 85 | .init_machine = exynos5250_dt_machine_init, |
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index ea785fcaf6c3..ffaa355c1bde 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c | |||
@@ -1383,6 +1383,7 @@ static void __init nuri_machine_init(void) | |||
1383 | MACHINE_START(NURI, "NURI") | 1383 | MACHINE_START(NURI, "NURI") |
1384 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ | 1384 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ |
1385 | .atag_offset = 0x100, | 1385 | .atag_offset = 0x100, |
1386 | .smp = smp_ops(exynos_smp_ops), | ||
1386 | .init_irq = exynos4_init_irq, | 1387 | .init_irq = exynos4_init_irq, |
1387 | .map_io = nuri_map_io, | 1388 | .map_io = nuri_map_io, |
1388 | .handle_irq = gic_handle_irq, | 1389 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index 4e574c24581c..abd0e6059ab3 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c | |||
@@ -806,6 +806,7 @@ static void __init origen_machine_init(void) | |||
806 | MACHINE_START(ORIGEN, "ORIGEN") | 806 | MACHINE_START(ORIGEN, "ORIGEN") |
807 | /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */ | 807 | /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */ |
808 | .atag_offset = 0x100, | 808 | .atag_offset = 0x100, |
809 | .smp = smp_ops(exynos_smp_ops), | ||
809 | .init_irq = exynos4_init_irq, | 810 | .init_irq = exynos4_init_irq, |
810 | .map_io = origen_map_io, | 811 | .map_io = origen_map_io, |
811 | .handle_irq = gic_handle_irq, | 812 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c index b26beb13ebef..964693bdc242 100644 --- a/arch/arm/mach-exynos/mach-smdk4x12.c +++ b/arch/arm/mach-exynos/mach-smdk4x12.c | |||
@@ -370,6 +370,7 @@ static void __init smdk4x12_machine_init(void) | |||
370 | MACHINE_START(SMDK4212, "SMDK4212") | 370 | MACHINE_START(SMDK4212, "SMDK4212") |
371 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | 371 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
372 | .atag_offset = 0x100, | 372 | .atag_offset = 0x100, |
373 | .smp = smp_ops(exynos_smp_ops), | ||
373 | .init_irq = exynos4_init_irq, | 374 | .init_irq = exynos4_init_irq, |
374 | .map_io = smdk4x12_map_io, | 375 | .map_io = smdk4x12_map_io, |
375 | .handle_irq = gic_handle_irq, | 376 | .handle_irq = gic_handle_irq, |
@@ -383,6 +384,7 @@ MACHINE_START(SMDK4412, "SMDK4412") | |||
383 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | 384 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
384 | /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ | 385 | /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ |
385 | .atag_offset = 0x100, | 386 | .atag_offset = 0x100, |
387 | .smp = smp_ops(exynos_smp_ops), | ||
386 | .init_irq = exynos4_init_irq, | 388 | .init_irq = exynos4_init_irq, |
387 | .map_io = smdk4x12_map_io, | 389 | .map_io = smdk4x12_map_io, |
388 | .handle_irq = gic_handle_irq, | 390 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c index 73f2bce097e1..69b858ceefc5 100644 --- a/arch/arm/mach-exynos/mach-smdkv310.c +++ b/arch/arm/mach-exynos/mach-smdkv310.c | |||
@@ -417,6 +417,7 @@ MACHINE_START(SMDKV310, "SMDKV310") | |||
417 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | 417 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
418 | /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ | 418 | /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ |
419 | .atag_offset = 0x100, | 419 | .atag_offset = 0x100, |
420 | .smp = smp_ops(exynos_smp_ops), | ||
420 | .init_irq = exynos4_init_irq, | 421 | .init_irq = exynos4_init_irq, |
421 | .map_io = smdkv310_map_io, | 422 | .map_io = smdkv310_map_io, |
422 | .handle_irq = gic_handle_irq, | 423 | .handle_irq = gic_handle_irq, |
@@ -429,6 +430,7 @@ MACHINE_END | |||
429 | MACHINE_START(SMDKC210, "SMDKC210") | 430 | MACHINE_START(SMDKC210, "SMDKC210") |
430 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | 431 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
431 | .atag_offset = 0x100, | 432 | .atag_offset = 0x100, |
433 | .smp = smp_ops(exynos_smp_ops), | ||
432 | .init_irq = exynos4_init_irq, | 434 | .init_irq = exynos4_init_irq, |
433 | .map_io = smdkv310_map_io, | 435 | .map_io = smdkv310_map_io, |
434 | .handle_irq = gic_handle_irq, | 436 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index 4d1f40d44ed1..922ca0f11795 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c | |||
@@ -1155,6 +1155,7 @@ static void __init universal_machine_init(void) | |||
1155 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | 1155 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") |
1156 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ | 1156 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ |
1157 | .atag_offset = 0x100, | 1157 | .atag_offset = 0x100, |
1158 | .smp = smp_ops(exynos_smp_ops), | ||
1158 | .init_irq = exynos4_init_irq, | 1159 | .init_irq = exynos4_init_irq, |
1159 | .map_io = universal_map_io, | 1160 | .map_io = universal_map_io, |
1160 | .handle_irq = gic_handle_irq, | 1161 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 36c3984aaa47..3fad8ad3f92c 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c | |||
@@ -32,6 +32,8 @@ | |||
32 | 32 | ||
33 | #include <plat/cpu.h> | 33 | #include <plat/cpu.h> |
34 | 34 | ||
35 | #include "common.h" | ||
36 | |||
35 | extern void exynos4_secondary_startup(void); | 37 | extern void exynos4_secondary_startup(void); |
36 | 38 | ||
37 | #define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ | 39 | #define CPU1_BOOT_REG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ |
@@ -64,7 +66,7 @@ static void __iomem *scu_base_addr(void) | |||
64 | 66 | ||
65 | static DEFINE_SPINLOCK(boot_lock); | 67 | static DEFINE_SPINLOCK(boot_lock); |
66 | 68 | ||
67 | void __cpuinit platform_secondary_init(unsigned int cpu) | 69 | static void __cpuinit exynos_secondary_init(unsigned int cpu) |
68 | { | 70 | { |
69 | /* | 71 | /* |
70 | * if any interrupts are already enabled for the primary | 72 | * if any interrupts are already enabled for the primary |
@@ -86,7 +88,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
86 | spin_unlock(&boot_lock); | 88 | spin_unlock(&boot_lock); |
87 | } | 89 | } |
88 | 90 | ||
89 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 91 | static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) |
90 | { | 92 | { |
91 | unsigned long timeout; | 93 | unsigned long timeout; |
92 | 94 | ||
@@ -161,7 +163,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
161 | * which may be present or become present in the system. | 163 | * which may be present or become present in the system. |
162 | */ | 164 | */ |
163 | 165 | ||
164 | void __init smp_init_cpus(void) | 166 | static void __init exynos_smp_init_cpus(void) |
165 | { | 167 | { |
166 | void __iomem *scu_base = scu_base_addr(); | 168 | void __iomem *scu_base = scu_base_addr(); |
167 | unsigned int i, ncores; | 169 | unsigned int i, ncores; |
@@ -184,7 +186,7 @@ void __init smp_init_cpus(void) | |||
184 | set_smp_cross_call(gic_raise_softirq); | 186 | set_smp_cross_call(gic_raise_softirq); |
185 | } | 187 | } |
186 | 188 | ||
187 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) | 189 | static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) |
188 | { | 190 | { |
189 | if (!soc_is_exynos5250()) | 191 | if (!soc_is_exynos5250()) |
190 | scu_enable(scu_base_addr()); | 192 | scu_enable(scu_base_addr()); |
@@ -198,3 +200,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus) | |||
198 | __raw_writel(virt_to_phys(exynos4_secondary_startup), | 200 | __raw_writel(virt_to_phys(exynos4_secondary_startup), |
199 | CPU1_BOOT_REG); | 201 | CPU1_BOOT_REG); |
200 | } | 202 | } |
203 | |||
204 | struct smp_operations exynos_smp_ops __initdata = { | ||
205 | .smp_init_cpus = exynos_smp_init_cpus, | ||
206 | .smp_prepare_cpus = exynos_smp_prepare_cpus, | ||
207 | .smp_secondary_init = exynos_secondary_init, | ||
208 | .smp_boot_secondary = exynos_boot_secondary, | ||
209 | #ifdef CONFIG_HOTPLUG_CPU | ||
210 | .cpu_die = exynos_cpu_die, | ||
211 | #endif | ||
212 | }; | ||