From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: smp: allow get the core count from L2 control on A15
Date: Tue, 31 Jan 2012 18:03:47 +0000 [thread overview]
Message-ID: <20120131180347.GB8338@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <04be01cce011$6b3b3550$41b19ff0$%kim@samsung.com>
On Tue, Jan 31, 2012 at 09:11:10PM +0900, Kukjin Kim wrote:
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index 57db122..be4d31d 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -233,6 +233,22 @@ void __ref cpu_die(void)
> }
> #endif /* CONFIG_HOTPLUG_CPU */
>
> +/*
> + * Get the number of CPU cores from the L2 control register on A15
> + */
> +unsigned long a15_get_core_count(void)
> +{
> + unsigned long val;
> +
> + /* Read L2 control register */
> + asm volatile("mrc p15, 1, %0, c9, c0, 2" : "=r"(val));
> +
> + /* [25:24] of L2 control register means core count - 1 */
> + val = ((val >> 24) & 0x3) + 1;
> +
> + return val;
> +}
> +
This is *definitely* the wrong place for this. Do we have the reading
of the number of cores from the SCU in smp.c ? No. Do we want to litter
smp.c with each architecture revisions own way of reading this information?
No.
Keep this kind of crap out of the main smp.c file please. It contains
zero CPU and platform specifics and should stay that way.
prev parent reply other threads:[~2012-01-31 18:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 12:11 [PATCH] ARM: smp: allow get the core count from L2 control on A15 Kukjin Kim
2012-01-31 14:13 ` Will Deacon
2012-01-31 14:21 ` Kukjin Kim
2012-01-31 14:32 ` Will Deacon
2012-01-31 14:40 ` Kukjin Kim
2012-01-31 15:20 ` Lorenzo Pieralisi
2012-01-31 18:03 ` Russell King - ARM Linux [this message]
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=20120131180347.GB8338@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).