diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-16 06:51:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-17 14:00:37 -0400 |
commit | a8cbcd92bd4bf893085eddf7f58e63ea98503d94 (patch) | |
tree | 7798cd1487362208793632f4ff0b4a6f579eb0ec /arch/arm/mach-realview/platsmp.c | |
parent | 49613d4d9ae759193915823e67de546fca58c951 (diff) |
[ARM] smp: separate SCU support code from realview
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-realview/platsmp.c')
-rw-r--r-- | arch/arm/mach-realview/platsmp.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index c567d3e24447..c862ce19587e 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
@@ -45,31 +45,12 @@ static void __iomem *scu_base_addr(void) | |||
45 | return (void __iomem *)0; | 45 | return (void __iomem *)0; |
46 | } | 46 | } |
47 | 47 | ||
48 | static unsigned int __init get_core_count(void) | 48 | static inline unsigned int get_core_count(void) |
49 | { | 49 | { |
50 | unsigned int ncores; | ||
51 | void __iomem *scu_base = scu_base_addr(); | 50 | void __iomem *scu_base = scu_base_addr(); |
52 | 51 | if (scu_base) | |
53 | if (scu_base) { | 52 | return scu_get_core_count(scu_base); |
54 | ncores = __raw_readl(scu_base + SCU_CONFIG); | 53 | return 1; |
55 | ncores = (ncores & 0x03) + 1; | ||
56 | } else | ||
57 | ncores = 1; | ||
58 | |||
59 | return ncores; | ||
60 | } | ||
61 | |||
62 | /* | ||
63 | * Setup the SCU | ||
64 | */ | ||
65 | static void scu_enable(void) | ||
66 | { | ||
67 | u32 scu_ctrl; | ||
68 | void __iomem *scu_base = scu_base_addr(); | ||
69 | |||
70 | scu_ctrl = __raw_readl(scu_base + SCU_CTRL); | ||
71 | scu_ctrl |= 1; | ||
72 | __raw_writel(scu_ctrl, scu_base + SCU_CTRL); | ||
73 | } | 54 | } |
74 | 55 | ||
75 | static DEFINE_SPINLOCK(boot_lock); | 56 | static DEFINE_SPINLOCK(boot_lock); |
@@ -239,7 +220,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
239 | */ | 220 | */ |
240 | percpu_timer_setup(); | 221 | percpu_timer_setup(); |
241 | 222 | ||
242 | scu_enable(); | 223 | scu_enable(scu_base_addr()); |
243 | poke_milo(); | 224 | poke_milo(); |
244 | } | 225 | } |
245 | } | 226 | } |