ARM: 7847/1: mcpm: Factor out logical-to-physical CPU translation
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>
This commit is contained in:
parent
49649cad34
commit
1e5660999a
1 changed files with 14 additions and 5 deletions
|
@ -19,14 +19,23 @@
|
||||||
#include <asm/smp.h>
|
#include <asm/smp.h>
|
||||||
#include <asm/smp_plat.h>
|
#include <asm/smp_plat.h>
|
||||||
|
|
||||||
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
static void cpu_to_pcpu(unsigned int cpu,
|
||||||
|
unsigned int *pcpu, unsigned int *pcluster)
|
||||||
{
|
{
|
||||||
unsigned int mpidr, pcpu, pcluster, ret;
|
unsigned int mpidr;
|
||||||
extern void secondary_startup(void);
|
|
||||||
|
|
||||||
mpidr = cpu_logical_map(cpu);
|
mpidr = cpu_logical_map(cpu);
|
||||||
pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
|
*pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
|
||||||
pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
|
*pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||||
|
{
|
||||||
|
unsigned int pcpu, pcluster, ret;
|
||||||
|
extern void secondary_startup(void);
|
||||||
|
|
||||||
|
cpu_to_pcpu(cpu, &pcpu, &pcluster);
|
||||||
|
|
||||||
pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
|
pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
|
||||||
__func__, cpu, pcpu, pcluster);
|
__func__, cpu, pcpu, pcluster);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue