aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv310/platsmp.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-12-03 06:09:48 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-20 10:09:08 -0500
commit05c74a6cbcfb416286a947668ba32f63d99fe74a (patch)
tree96f4dd3d5cbc67b14b93e9630f4f02becaa1a66a /arch/arm/mach-s5pv310/platsmp.c
parentaec66ba1f75c2030cf66f5a21d1c81aa83aa5d95 (diff)
ARM: SMP: consolidate the common parts of smp_prepare_cpus()
There is a certain amount of smp_prepare_cpus() which doesn't belong in the platform support code - that is, code which is invariant to the SMP implementation. Move this code into arch/arm/kernel/smp.c, and add a platform_ prefix to the original function. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s5pv310/platsmp.c')
-rw-r--r--arch/arm/mach-s5pv310/platsmp.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/arch/arm/mach-s5pv310/platsmp.c b/arch/arm/mach-s5pv310/platsmp.c
index 560ada83b0b1..51c44d4c9890 100644
--- a/arch/arm/mach-s5pv310/platsmp.c
+++ b/arch/arm/mach-s5pv310/platsmp.c
@@ -22,7 +22,6 @@
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
25#include <asm/localtimer.h>
26#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
27#include <asm/unified.h> 26#include <asm/unified.h>
28 27
@@ -142,18 +141,10 @@ void __init smp_init_cpus(void)
142 set_cpu_possible(i, true); 141 set_cpu_possible(i, true);
143} 142}
144 143
145void __init smp_prepare_cpus(unsigned int max_cpus) 144void __init platform_smp_prepare_cpus(unsigned int max_cpus)
146{ 145{
147 unsigned int ncores = num_possible_cpus();
148 unsigned int cpu = smp_processor_id();
149 int i; 146 int i;
150 147
151 smp_store_cpu_info(cpu);
152
153 /* are we trying to boot more cores than exist? */
154 if (max_cpus > ncores)
155 max_cpus = ncores;
156
157 /* 148 /*
158 * Initialise the present map, which describes the set of CPUs 149 * Initialise the present map, which describes the set of CPUs
159 * actually populated at the present time. 150 * actually populated at the present time.
@@ -161,25 +152,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
161 for (i = 0; i < max_cpus; i++) 152 for (i = 0; i < max_cpus; i++)
162 set_cpu_present(i, true); 153 set_cpu_present(i, true);
163 154
155 scu_enable(scu_base_addr());
156
164 /* 157 /*
165 * Initialise the SCU if there are more than one CPU and let 158 * Write the address of secondary startup into the
166 * them know where to start. 159 * system-wide flags register. The boot monitor waits
160 * until it receives a soft interrupt, and then the
161 * secondary CPU branches to this address.
167 */ 162 */
168 if (max_cpus > 1) {
169 /*
170 * Enable the local timer or broadcast device for the
171 * boot CPU, but only if we have more than one CPU.
172 */
173 percpu_timer_setup();
174
175 scu_enable(scu_base_addr());
176
177 /*
178 * Write the address of secondary startup into the
179 * system-wide flags register. The boot monitor waits
180 * until it receives a soft interrupt, and then the
181 * secondary CPU branches to this address.
182 */
183 __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM); 163 __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM);
184 }
185} 164}