diff options
Diffstat (limited to 'arch/arm/mach-realview/platsmp.c')
-rw-r--r-- | arch/arm/mach-realview/platsmp.c | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index 30a9c68591f6..ac0e83f1cc3a 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
@@ -19,10 +19,12 @@ | |||
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> | ||
22 | 23 | ||
23 | #include <mach/board-eb.h> | 24 | #include <mach/board-eb.h> |
24 | #include <mach/board-pb11mp.h> | 25 | #include <mach/board-pb11mp.h> |
25 | #include <mach/scu.h> | 26 | #include <mach/board-pbx.h> |
27 | #include <asm/smp_scu.h> | ||
26 | 28 | ||
27 | #include "core.h" | 29 | #include "core.h" |
28 | 30 | ||
@@ -40,35 +42,19 @@ static void __iomem *scu_base_addr(void) | |||
40 | return __io_address(REALVIEW_EB11MP_SCU_BASE); | 42 | return __io_address(REALVIEW_EB11MP_SCU_BASE); |
41 | else if (machine_is_realview_pb11mp()) | 43 | else if (machine_is_realview_pb11mp()) |
42 | return __io_address(REALVIEW_TC11MP_SCU_BASE); | 44 | return __io_address(REALVIEW_TC11MP_SCU_BASE); |
45 | else if (machine_is_realview_pbx() && | ||
46 | (core_tile_pbx11mp() || core_tile_pbxa9mp())) | ||
47 | return __io_address(REALVIEW_PBX_TILE_SCU_BASE); | ||
43 | else | 48 | else |
44 | return (void __iomem *)0; | 49 | return (void __iomem *)0; |
45 | } | 50 | } |
46 | 51 | ||
47 | static unsigned int __init get_core_count(void) | 52 | static inline unsigned int get_core_count(void) |
48 | { | 53 | { |
49 | unsigned int ncores; | ||
50 | void __iomem *scu_base = scu_base_addr(); | 54 | void __iomem *scu_base = scu_base_addr(); |
51 | 55 | if (scu_base) | |
52 | if (scu_base) { | 56 | return scu_get_core_count(scu_base); |
53 | ncores = __raw_readl(scu_base + SCU_CONFIG); | 57 | return 1; |
54 | ncores = (ncores & 0x03) + 1; | ||
55 | } else | ||
56 | ncores = 1; | ||
57 | |||
58 | return ncores; | ||
59 | } | ||
60 | |||
61 | /* | ||
62 | * Setup the SCU | ||
63 | */ | ||
64 | static void scu_enable(void) | ||
65 | { | ||
66 | u32 scu_ctrl; | ||
67 | void __iomem *scu_base = scu_base_addr(); | ||
68 | |||
69 | scu_ctrl = __raw_readl(scu_base + SCU_CTRL); | ||
70 | scu_ctrl |= 1; | ||
71 | __raw_writel(scu_ctrl, scu_base + SCU_CTRL); | ||
72 | } | 58 | } |
73 | 59 | ||
74 | static DEFINE_SPINLOCK(boot_lock); | 60 | static DEFINE_SPINLOCK(boot_lock); |
@@ -184,7 +170,7 @@ void __init smp_init_cpus(void) | |||
184 | unsigned int i, ncores = get_core_count(); | 170 | unsigned int i, ncores = get_core_count(); |
185 | 171 | ||
186 | for (i = 0; i < ncores; i++) | 172 | for (i = 0; i < ncores; i++) |
187 | cpu_set(i, cpu_possible_map); | 173 | set_cpu_possible(i, true); |
188 | } | 174 | } |
189 | 175 | ||
190 | void __init smp_prepare_cpus(unsigned int max_cpus) | 176 | void __init smp_prepare_cpus(unsigned int max_cpus) |
@@ -217,19 +203,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
217 | if (max_cpus > ncores) | 203 | if (max_cpus > ncores) |
218 | max_cpus = ncores; | 204 | max_cpus = ncores; |
219 | 205 | ||
220 | #if defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) | ||
221 | /* | ||
222 | * Enable the local timer or broadcast device for the boot CPU. | ||
223 | */ | ||
224 | local_timer_setup(); | ||
225 | #endif | ||
226 | |||
227 | /* | 206 | /* |
228 | * Initialise the present map, which describes the set of CPUs | 207 | * Initialise the present map, which describes the set of CPUs |
229 | * actually populated at the present time. | 208 | * actually populated at the present time. |
230 | */ | 209 | */ |
231 | for (i = 0; i < max_cpus; i++) | 210 | for (i = 0; i < max_cpus; i++) |
232 | cpu_set(i, cpu_present_map); | 211 | set_cpu_present(i, true); |
233 | 212 | ||
234 | /* | 213 | /* |
235 | * Initialise the SCU if there are more than one CPU and let | 214 | * Initialise the SCU if there are more than one CPU and let |
@@ -239,7 +218,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
239 | * WFI | 218 | * WFI |
240 | */ | 219 | */ |
241 | if (max_cpus > 1) { | 220 | if (max_cpus > 1) { |
242 | scu_enable(); | 221 | /* |
222 | * Enable the local timer or broadcast device for the | ||
223 | * boot CPU, but only if we have more than one CPU. | ||
224 | */ | ||
225 | percpu_timer_setup(); | ||
226 | |||
227 | scu_enable(scu_base_addr()); | ||
243 | poke_milo(); | 228 | poke_milo(); |
244 | } | 229 | } |
245 | } | 230 | } |