mirror of https://gitee.com/openkylin/linux.git
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: Chander Kashyap <chander.kashyap@linaro.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
parent
e2e54362d9
commit
6ec4f8d0d9
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue