From a8cbcd92bd4bf893085eddf7f58e63ea98503d94 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 16 May 2009 11:51:14 +0100 Subject: [ARM] smp: separate SCU support code from realview Signed-off-by: Russell King --- arch/arm/mach-realview/platsmp.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'arch/arm/mach-realview/platsmp.c') 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) return (void __iomem *)0; } -static unsigned int __init get_core_count(void) +static inline unsigned int get_core_count(void) { - unsigned int ncores; void __iomem *scu_base = scu_base_addr(); - - if (scu_base) { - ncores = __raw_readl(scu_base + SCU_CONFIG); - ncores = (ncores & 0x03) + 1; - } else - ncores = 1; - - return ncores; -} - -/* - * Setup the SCU - */ -static void scu_enable(void) -{ - u32 scu_ctrl; - void __iomem *scu_base = scu_base_addr(); - - scu_ctrl = __raw_readl(scu_base + SCU_CTRL); - scu_ctrl |= 1; - __raw_writel(scu_ctrl, scu_base + SCU_CTRL); + if (scu_base) + return scu_get_core_count(scu_base); + return 1; } static DEFINE_SPINLOCK(boot_lock); @@ -239,7 +220,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) */ percpu_timer_setup(); - scu_enable(); + scu_enable(scu_base_addr()); poke_milo(); } } -- cgit v1.2.2