diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-03 06:09:48 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-20 10:09:08 -0500 |
commit | 05c74a6cbcfb416286a947668ba32f63d99fe74a (patch) | |
tree | 96f4dd3d5cbc67b14b93e9630f4f02becaa1a66a /arch/arm/mach-realview | |
parent | aec66ba1f75c2030cf66f5a21d1c81aa83aa5d95 (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-realview')
-rw-r--r-- | arch/arm/mach-realview/platsmp.c | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index ef3cc86f5140..380562cd6580 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
22 | #include <asm/localtimer.h> | ||
23 | #include <asm/unified.h> | 22 | #include <asm/unified.h> |
24 | 23 | ||
25 | #include <mach/board-eb.h> | 24 | #include <mach/board-eb.h> |
@@ -147,20 +146,10 @@ void __init smp_init_cpus(void) | |||
147 | set_cpu_possible(i, true); | 146 | set_cpu_possible(i, true); |
148 | } | 147 | } |
149 | 148 | ||
150 | void __init smp_prepare_cpus(unsigned int max_cpus) | 149 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
151 | { | 150 | { |
152 | unsigned int ncores = num_possible_cpus(); | ||
153 | unsigned int cpu = smp_processor_id(); | ||
154 | int i; | 151 | int i; |
155 | 152 | ||
156 | smp_store_cpu_info(cpu); | ||
157 | |||
158 | /* | ||
159 | * are we trying to boot more cores than exist? | ||
160 | */ | ||
161 | if (max_cpus > ncores) | ||
162 | max_cpus = ncores; | ||
163 | |||
164 | /* | 153 | /* |
165 | * Initialise the present map, which describes the set of CPUs | 154 | * Initialise the present map, which describes the set of CPUs |
166 | * actually populated at the present time. | 155 | * actually populated at the present time. |
@@ -168,22 +157,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
168 | for (i = 0; i < max_cpus; i++) | 157 | for (i = 0; i < max_cpus; i++) |
169 | set_cpu_present(i, true); | 158 | set_cpu_present(i, true); |
170 | 159 | ||
171 | if (max_cpus > 1) { | 160 | scu_enable(scu_base_addr()); |
172 | /* | 161 | |
173 | * Enable the local timer or broadcast device for the | 162 | /* |
174 | * boot CPU, but only if we have more than one CPU. | 163 | * Write the address of secondary startup into the |
175 | */ | 164 | * system-wide flags register. The BootMonitor waits |
176 | percpu_timer_setup(); | 165 | * until it receives a soft interrupt, and then the |
177 | 166 | * secondary CPU branches to this address. | |
178 | scu_enable(scu_base_addr()); | 167 | */ |
179 | 168 | __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), | |
180 | /* | 169 | __io_address(REALVIEW_SYS_FLAGSSET)); |
181 | * Write the address of secondary startup into the | ||
182 | * system-wide flags register. The BootMonitor waits | ||
183 | * until it receives a soft interrupt, and then the | ||
184 | * secondary CPU branches to this address. | ||
185 | */ | ||
186 | __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), | ||
187 | __io_address(REALVIEW_SYS_FLAGSSET)); | ||
188 | } | ||
189 | } | 170 | } |