aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/platsmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-realview/platsmp.c')
-rw-r--r--arch/arm/mach-realview/platsmp.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index c567d3e2444..c862ce19587 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
48static unsigned int __init get_core_count(void) 48static 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 */
65static 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
75static DEFINE_SPINLOCK(boot_lock); 56static 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}