Skip to content

Commit

Permalink
ARM: 7847/1: mcpm: Factor out logical-to-physical CPU translation
Browse files Browse the repository at this point in the history
This patch factors the logical-to-physical CPU translation out of
mcpm_boot_secondary(), so that it can be reused elsewhere.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Dave Martin authored and Russell King committed Oct 29, 2013
1 parent 49649ca commit 1e56609
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions arch/arm/common/mcpm_platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@
#include <asm/smp.h>
#include <asm/smp_plat.h>

static void cpu_to_pcpu(unsigned int cpu,
unsigned int *pcpu, unsigned int *pcluster)
{
unsigned int mpidr;

mpidr = cpu_logical_map(cpu);
*pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
*pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
}

static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
unsigned int mpidr, pcpu, pcluster, ret;
unsigned int pcpu, pcluster, ret;
extern void secondary_startup(void);

mpidr = cpu_logical_map(cpu);
pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
cpu_to_pcpu(cpu, &pcpu, &pcluster);

pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
__func__, cpu, pcpu, pcluster);

Expand Down

0 comments on commit 1e56609

Please sign in to comment.