summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-realview/platsmp.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-05-16 12:51:14 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-05-17 20:00:37 +0200
commita8cbcd92bd4bf893085eddf7f58e63ea98503d94 (patch)
tree7798cd1487362208793632f4ff0b4a6f579eb0ec /arch/arm/mach-realview/platsmp.c
parent[ARM] smp: SCU is used on non-realview platforms (diff)
downloadlinux-a8cbcd92bd4bf893085eddf7f58e63ea98503d94.tar.xz
linux-a8cbcd92bd4bf893085eddf7f58e63ea98503d94.zip
[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.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 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();
}
}