Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/7] ARM: kernel: update topology to use new MPIDR macros
Date: Mon, 19 Nov 2012 12:45:01 +0000	[thread overview]
Message-ID: <1353329106-24084-3-git-send-email-lorenzo.pieralisi@arm.com> (raw)
In-Reply-To: <1353329106-24084-1-git-send-email-lorenzo.pieralisi@arm.com>

This patch updates the topology initialization code to use the newly
defined accessors to retrieve the MPIDR affinity levels.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
---
 arch/arm/kernel/topology.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 4642c7d..cba99bd 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -262,19 +262,14 @@ void store_cpu_topology(unsigned int cpuid)
 
 		if (mpidr & MPIDR_MT_BITMASK) {
 			/* core performance interdependency */
-			cpuid_topo->thread_id = (mpidr >> MPIDR_LEVEL0_SHIFT)
-				& MPIDR_LEVEL0_MASK;
-			cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL1_SHIFT)
-				& MPIDR_LEVEL1_MASK;
-			cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL2_SHIFT)
-				& MPIDR_LEVEL2_MASK;
+			cpuid_topo->thread_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+			cpuid_topo->core_id = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+			cpuid_topo->socket_id = MPIDR_AFFINITY_LEVEL(mpidr, 2);
 		} else {
 			/* largely independent cores */
 			cpuid_topo->thread_id = -1;
-			cpuid_topo->core_id = (mpidr >> MPIDR_LEVEL0_SHIFT)
-				& MPIDR_LEVEL0_MASK;
-			cpuid_topo->socket_id = (mpidr >> MPIDR_LEVEL1_SHIFT)
-				& MPIDR_LEVEL1_MASK;
+			cpuid_topo->core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+			cpuid_topo->socket_id = MPIDR_AFFINITY_LEVEL(mpidr, 1);
 		}
 	} else {
 		/*
-- 
1.7.12

  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 ` Lorenzo Pieralisi [this message]
2012-11-19 13:45   ` [PATCH v4 2/7] ARM: kernel: update topology to use new MPIDR macros Will Deacon
2012-11-19 15:38   ` Nicolas Pitre
2012-11-19 12:45 ` [PATCH v4 3/7] ARM: kernel: smp_setup_processor_id() updates Lorenzo Pieralisi
2012-11-19 13:45   ` 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-3-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