]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: EXYNOS: add generic function to calculate cpu number
authorChander Kashyap <chander.kashyap@linaro.org>
Fri, 4 Jul 2014 21:24:35 +0000 (06:24 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Fri, 18 Jul 2014 18:35:55 +0000 (03:35 +0900)
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>
arch/arm/mach-exynos/regs-pmu.h

index 1d13b08708f0055e49baa27e43ac24be6e355530..aff23bd395e69c94de6f6be815d5dd2c1dcdcf8f 100644 (file)
 
 #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 */