From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/7] ARM: kernel: smp_setup_processor_id() updates
Date: Mon, 19 Nov 2012 12:45:02 +0000 [thread overview]
Message-ID: <1353329106-24084-4-git-send-email-lorenzo.pieralisi@arm.com> (raw)
In-Reply-To: <1353329106-24084-1-git-send-email-lorenzo.pieralisi@arm.com>
This patch applies some basic changes to the smp_setup_processor_id()
ARM implementation to make the code that builds cpu_logical_map more
uniform across the kernel.
The function now prints the full extent of the boot CPU MPIDR[23:0] and
initializes the cpu_logical_map for CPUs up to nr_cpu_ids.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
---
arch/arm/kernel/setup.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index da1d1aa..4515bf6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -426,13 +426,14 @@ int __cpu_logical_map[NR_CPUS];
void __init smp_setup_processor_id(void)
{
int i;
- u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0;
+ u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0;
+ u32 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
cpu_logical_map(0) = cpu;
- for (i = 1; i < NR_CPUS; ++i)
+ for (i = 1; i < nr_cpu_ids; ++i)
cpu_logical_map(i) = i == cpu ? 0 : i;
- printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu);
+ printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr);
}
static void __init setup_processor(void)
--
1.7.12
next prev parent reply other threads:[~2012-11-19 12:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-19 12:44 [PATCH v4 0/7] ARM: multi-cluster aware boot protocol Lorenzo Pieralisi
2012-11-19 12:45 ` [PATCH v4 1/7] ARM: kernel: enhance MPIDR macro definitions Lorenzo Pieralisi
2012-11-19 13:44 ` Will Deacon
2012-11-19 15:37 ` Nicolas Pitre
2012-11-19 12:45 ` [PATCH v4 2/7] ARM: kernel: update topology to use new MPIDR macros Lorenzo Pieralisi
2012-11-19 13:45 ` Will Deacon
2012-11-19 15:38 ` Nicolas Pitre
2012-11-19 12:45 ` Lorenzo Pieralisi [this message]
2012-11-19 13:45 ` [PATCH v4 3/7] ARM: kernel: smp_setup_processor_id() updates Will Deacon
2012-11-19 12:45 ` [PATCH v4 4/7] ARM: kernel: add device tree init map function Lorenzo Pieralisi
2012-11-19 13:54 ` Mark Rutland
2012-11-19 14:07 ` Lorenzo Pieralisi
2012-11-19 12:45 ` [PATCH v4 5/7] ARM: kernel: add cpu logical map DT init in setup_arch Lorenzo Pieralisi
2012-11-19 12:45 ` [PATCH v4 6/7] ARM: kernel: add logical mappings look-up Lorenzo Pieralisi
2012-11-19 12:45 ` [PATCH v4 7/7] ARM: gic: use a private mapping for CPU target interfaces Lorenzo Pieralisi
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=1353329106-24084-4-git-send-email-lorenzo.pieralisi@arm.com \
--to=lorenzo.pieralisi@arm.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