From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] ARM: add common scu_init_cpus
Date: Fri, 29 Apr 2011 21:08:11 -0500 [thread overview]
Message-ID: <1304129297-6614-5-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1304129297-6614-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Cortex-A9 SCU based platforms use the same code for smp_init_cpus, so create
a common implementation for systems with an SCU.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/include/asm/smp_scu.h | 1 +
arch/arm/kernel/smp_scu.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 4eb6d00..6b03557 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -7,6 +7,7 @@
#ifndef __ASSEMBLER__
unsigned int scu_get_core_count(void __iomem *);
+void scu_init_cpus(void __iomem *);
void scu_enable(void __iomem *);
int scu_power_mode(void __iomem *, unsigned int);
#endif
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index a1e757c..e58b8c4 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -29,6 +29,25 @@ unsigned int __init scu_get_core_count(void __iomem *scu_base)
return (ncores & 0x03) + 1;
}
+void __init scu_init_cpus(void __iomem *scu_base)
+{
+ unsigned int i, ncores;
+
+ ncores = scu_get_core_count(scu_base);
+
+ /* sanity check */
+ if (ncores > NR_CPUS) {
+ printk(KERN_WARNING
+ "SCU: No. of cores (%d) greater than configured "
+ "maximum of %d - clipping\n",
+ ncores, NR_CPUS);
+ ncores = NR_CPUS;
+ }
+
+ for (i = 0; i < ncores; i++)
+ set_cpu_possible(i, true);
+}
+
/*
* Enable the SCU
*/
--
1.7.1
next prev parent reply other threads:[~2011-04-30 2:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-30 2:08 Resend [PATCH 00/10] ARM: SMP initialization consolidation Rob Herring
2011-04-30 2:08 ` [PATCH 01/10] ARM: move Versatile SMP pen code to common location Rob Herring
2011-04-30 2:08 ` [PATCH 02/10] ARM: ux500: convert to use common secondary pen code Rob Herring
2011-04-30 2:08 ` [PATCH 03/10] ARM: msm: " Rob Herring
2011-04-30 2:08 ` Rob Herring [this message]
2011-04-30 2:08 ` [PATCH 05/10] ARM: omap: use common scu_init_cpus Rob Herring
2011-04-30 2:08 ` [PATCH 06/10] ARM: realview: " Rob Herring
2011-04-30 2:08 ` [PATCH 07/10] ARM: vexpress: " Rob Herring
2011-04-30 2:08 ` [PATCH 08/10] ARM: ux500: " Rob Herring
2011-04-30 2:08 ` [PATCH 09/10] ARM: shmobile: " Rob Herring
2011-04-30 2:08 ` [PATCH 10/10] ARM: move set_cpu_present calls to common smp code Rob Herring
2011-04-30 5:58 ` Resend [PATCH 00/10] ARM: SMP initialization consolidation Stephen Boyd
2011-05-02 23:40 ` Russell King - ARM Linux
2011-05-03 13:57 ` Arnd Bergmann
2011-05-08 9:42 ` Russell King - ARM Linux
2011-05-08 19:38 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304129297-6614-5-git-send-email-robherring2@gmail.com \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).