Skip to content

Commit

Permalink
hw/arm/exynos: Fix proper mapping of CPUs by providing real cluster ID
Browse files Browse the repository at this point in the history
The Exynos4210 has cluster ID 0x9 in its MPIDR register (raw value
0x8000090x).  If this cluster ID is not provided, then Linux kernel
cannot map DeviceTree nodes to MPIDR values resulting in kernel
warning and lack of any secondary CPUs:

    DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map
    ...
    smp: Bringing up secondary CPUs ...
    smp: Brought up 1 node, 1 CPU
    SMP: Total of 1 processors activated (24.00 BogoMIPS).

Provide a cluster ID so Linux will see proper MPIDR and will try to
bring the secondary CPU online.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Message-id: 20170226200142.31169-2-krzk@kernel.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
krzk authored and pm215 committed Feb 28, 2017
1 parent 1e0228f commit f3a6339
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hw/arm/exynos4210.c
Expand Up @@ -142,6 +142,16 @@ void exynos4210_write_secondary(ARMCPU *cpu,
info->smp_loader_start);
}

static uint64_t exynos4210_calc_affinity(int cpu)
{
uint64_t mp_affinity;

/* Exynos4210 has 0x9 as cluster ID */
mp_affinity = (0x9 << ARM_AFF1_SHIFT) | cpu;

return mp_affinity;
}

Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
unsigned long ram_size)
{
Expand All @@ -167,6 +177,8 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
}

s->cpu[n] = ARM_CPU(cpuobj);
object_property_set_int(cpuobj, exynos4210_calc_affinity(n),
"mp-affinity", &error_abort);
object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
"reset-cbar", &error_abort);
object_property_set_bool(cpuobj, true, "realized", &error_fatal);
Expand Down

0 comments on commit f3a6339

Please sign in to comment.