summaryrefslogtreecommitdiff
path: root/plat/rockchip/common/plat_topology.c
diff options
context:
space:
mode:
Diffstat (limited to 'plat/rockchip/common/plat_topology.c')
-rw-r--r--plat/rockchip/common/plat_topology.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plat/rockchip/common/plat_topology.c b/plat/rockchip/common/plat_topology.c
index 911978a0..8a139455 100644
--- a/plat/rockchip/common/plat_topology.c
+++ b/plat/rockchip/common/plat_topology.c
@@ -45,11 +45,13 @@ int plat_core_pos_by_mpidr(u_register_t mpidr)
{
unsigned int cluster_id, cpu_id;
- cpu_id = MPIDR_AFFLVL0_VAL(mpidr);
- cluster_id = MPIDR_AFFLVL1_VAL(mpidr);
+ cpu_id = mpidr & MPIDR_AFFLVL_MASK;
+ cluster_id = mpidr & MPIDR_CLUSTER_MASK;
- if (cluster_id >= PLATFORM_CLUSTER_COUNT)
+ cpu_id += (cluster_id >> PLAT_RK_CLST_TO_CPUID_SHIFT);
+
+ if (cpu_id >= PLATFORM_CORE_COUNT)
return -1;
- return ((cluster_id * PLATFORM_CLUSTER0_CORE_COUNT) + cpu_id);
+ return cpu_id;
}