aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-12-02 13:09:37 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-20 10:08:27 -0500
commitfd778f0ad7dda1108281410ddca0d07936256d3c (patch)
treefe85b4ab73930c9fc0ad761dffd2d9394f2e1452 /arch
parent8975b6c0fdd57e061f4d1040163778ceaf340ad8 (diff)
ARM: SMP: get rid of get_core_count()
We don't need this small function as well as scu_get_core_count() Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/omap-smp.c12
-rw-r--r--arch/arm/mach-realview/platsmp.c13
-rw-r--r--arch/arm/mach-ux500/platsmp.c9
3 files changed, 8 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 5f10f38354ae..405a8fc53308 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -29,16 +29,6 @@
29/* SCU base address */ 29/* SCU base address */
30static void __iomem *scu_base; 30static void __iomem *scu_base;
31 31
32/*
33 * Use SCU config register to count number of cores
34 */
35static inline unsigned int get_core_count(void)
36{
37 if (scu_base)
38 return scu_get_core_count(scu_base);
39 return 1;
40}
41
42static DEFINE_SPINLOCK(boot_lock); 32static DEFINE_SPINLOCK(boot_lock);
43 33
44void __cpuinit platform_secondary_init(unsigned int cpu) 34void __cpuinit platform_secondary_init(unsigned int cpu)
@@ -118,7 +108,7 @@ void __init smp_init_cpus(void)
118 scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); 108 scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256);
119 BUG_ON(!scu_base); 109 BUG_ON(!scu_base);
120 110
121 ncores = get_core_count(); 111 ncores = scu_get_core_count(scu_base);
122 112
123 /* sanity check */ 113 /* sanity check */
124 if (ncores > NR_CPUS) { 114 if (ncores > NR_CPUS) {
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 13116cd37639..6595e875fb2f 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -50,14 +50,6 @@ static void __iomem *scu_base_addr(void)
50 return (void __iomem *)0; 50 return (void __iomem *)0;
51} 51}
52 52
53static inline unsigned int get_core_count(void)
54{
55 void __iomem *scu_base = scu_base_addr();
56 if (scu_base)
57 return scu_get_core_count(scu_base);
58 return 1;
59}
60
61static DEFINE_SPINLOCK(boot_lock); 53static DEFINE_SPINLOCK(boot_lock);
62 54
63void __cpuinit platform_secondary_init(unsigned int cpu) 55void __cpuinit platform_secondary_init(unsigned int cpu)
@@ -158,7 +150,10 @@ static void __init poke_milo(void)
158 */ 150 */
159void __init smp_init_cpus(void) 151void __init smp_init_cpus(void)
160{ 152{
161 unsigned int i, ncores = get_core_count(); 153 void __iomem *scu_base = scu_base_addr();
154 unsigned int i, ncores;
155
156 ncores = scu_base ? scu_get_core_count(scu_base) : 1;
162 157
163 /* sanity check */ 158 /* sanity check */
164 if (ncores > NR_CPUS) { 159 if (ncores > NR_CPUS) {
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index e31024e3a7cc..fd40fa175913 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -28,11 +28,6 @@
28 */ 28 */
29volatile int __cpuinitdata pen_release = -1; 29volatile int __cpuinitdata pen_release = -1;
30 30
31static unsigned int __init get_core_count(void)
32{
33 return scu_get_core_count(__io_address(UX500_SCU_BASE));
34}
35
36static DEFINE_SPINLOCK(boot_lock); 31static DEFINE_SPINLOCK(boot_lock);
37 32
38void __cpuinit platform_secondary_init(unsigned int cpu) 33void __cpuinit platform_secondary_init(unsigned int cpu)
@@ -126,7 +121,9 @@ static void __init wakeup_secondary(void)
126 */ 121 */
127void __init smp_init_cpus(void) 122void __init smp_init_cpus(void)
128{ 123{
129 unsigned int i, ncores = get_core_count(); 124 unsigned int i, ncores;
125
126 ncores = scu_get_core_count(__io_address(UX500_SCU_BASE));
130 127
131 /* sanity check */ 128 /* sanity check */
132 if (ncores > NR_CPUS) { 129 if (ncores > NR_CPUS) {