Commit 6ec4f8d0 authored by Chander Kashyap's avatar Chander Kashyap Committed by Kukjin Kim

ARM: EXYNOS: add generic function to calculate cpu number

The address of cpu power registers in pmu is based on cpu number
offsets. This function calculate the same. This is essentially
required in case of multi-cluster SoC's e.g Exynos5420.
Signed-off-by: default avatarChander Kashyap <chander.kashyap@linaro.org>
Reviewed-by: default avatarTomasz Figa <t.figa@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent e2e54362
......@@ -323,4 +323,13 @@
#define EXYNOS5420_SWRESET_KFC_SEL 0x3
#include <asm/cputype.h>
#define MAX_CPUS_IN_CLUSTER 4
static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
{
return ((MPIDR_AFFINITY_LEVEL(mpidr, 1) * MAX_CPUS_IN_CLUSTER)
+ MPIDR_AFFINITY_LEVEL(mpidr, 0));
}
#endif /* __ASM_ARCH_REGS_PMU_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment