Skip to contentSkip to conversation

arm: exynos: add generic function to calculate cpu number

PATCH In review Chander Kashyap 2 participants 6 messages Apr 25, 2014 – May 14, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 multicluster SoC's e.g Exynos5420.

---
 arch/arm/mach-exynos/regs-pmu.h |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-exynos/regs-pmu.h +9 -0
index 4f6a256..217da2e 100644
@@ -313,4 +313,13 @@
 
 #define EXYNOS5_OPTION_USE_RETENTION				(1 << 4)
 
+#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 */
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 29 lines · Chander Kashyap

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 multicluster SoC's e.g Exynos5420.

---
 arch/arm/mach-exynos/regs-pmu.h |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-exynos/regs-pmu.h +9 -1
index 4f6a256..217da2e 100644
@@ -313,4 +313,13 @@
 
 #define EXYNOS5_OPTION_USE_RETENTION                           (1 << 4)
 
+#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 */
--
Quoted 2 lines

1.7.9.5

Kukjin, Can you please have a look.

Signature · 2 lines
with warm regards,
Chander Kashyap
#2 lore raw
Quoted 37 lines · Chander Kashyap
Quoted 29 lines · Chander Kashyap

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 multicluster SoC's e.g Exynos5420.

---
 arch/arm/mach-exynos/regs-pmu.h |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-exynos/regs-pmu.h +9 -1
index 4f6a256..217da2e 100644
@@ -313,4 +313,13 @@
 
 #define EXYNOS5_OPTION_USE_RETENTION                           (1 << 4)
 
+#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 */
--
Quoted 2 lines

1.7.9.5

Kukjin, Can you please have a look.

Quoted 3 lines

--
with warm regards,
Chander Kashyap

Hi Kgene,
Can you take this patch if no issues with it.

Signature · 2 lines
with warm regards,
Chander Kashyap
#3 lore raw

Hi Chander,

Quoted 38 lines · Chander Kashyap
Quoted 37 lines · Chander Kashyap
Quoted 29 lines · Chander Kashyap

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 multicluster SoC's e.g Exynos5420.

---
 arch/arm/mach-exynos/regs-pmu.h |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-exynos/regs-pmu.h +9 -1
index 4f6a256..217da2e 100644
@@ -313,4 +313,13 @@
 
 #define EXYNOS5_OPTION_USE_RETENTION                           (1 << 4)
 
+#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 */
--
Quoted 2 lines

1.7.9.5

Kukjin, Can you please have a look.

Quoted 5 lines
Quoted 3 lines

--
with warm regards,
Chander Kashyap

Hi Kgene,
Can you take this patch if no issues with it.

Is there any user for this function right now? Shouldn't this patch rather be included as a part of some series that adds actual users of it?

Best regards,
Tomasz

#4 lore raw
Quoted 41 lines · Tomasz Figa

Hi Chander,

Quoted 38 lines · Chander Kashyap
Quoted 37 lines · Chander Kashyap
Quoted 29 lines · Chander Kashyap

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 multicluster SoC's e.g Exynos5420.

---
 arch/arm/mach-exynos/regs-pmu.h |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-exynos/regs-pmu.h +9 -1
index 4f6a256..217da2e 100644
@@ -313,4 +313,13 @@
 
 #define EXYNOS5_OPTION_USE_RETENTION                           (1 << 4)
 
+#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 */
--
Quoted 2 lines

1.7.9.5

Kukjin, Can you please have a look.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

--
with warm regards,
Chander Kashyap

Hi Kgene,
Can you take this patch if no issues with it.

Is there any user for this function right now? Shouldn't this patch rather be included as a part of some series that adds actual users of it?

Hi Tomasz,
Exynos5420 patches have dependency on this.
Those patches already posted.

Quoted 4 lines

Best regards,
Tomasz

Signature · 2 lines
with warm regards,
Chander Kashyap
#5 lore raw
Quoted 48 lines · Chander Kashyap
Quoted 47 lines · Tomasz Figa

Hi Chander,

Quoted 43 lines · Chander Kashyap
Quoted 37 lines · Chander Kashyap
Quoted 29 lines · Chander Kashyap

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 multicluster SoC's e.g Exynos5420.

---
 arch/arm/mach-exynos/regs-pmu.h |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/mach-exynos/regs-pmu.h +9 -1
index 4f6a256..217da2e 100644
@@ -313,4 +313,13 @@
 
 #define EXYNOS5_OPTION_USE_RETENTION                           (1 << 4)
 
+#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 */
--
Quoted 2 lines

1.7.9.5

Kukjin, Can you please have a look.

Quoted 3 lines

--
with warm regards,
Chander Kashyap

Hi Kgene,
Can you take this patch if no issues with it.

Quoted 7 lines
Quoted 2 lines

Is there any user for this function right now? Shouldn't this patch rather be included as a part of some series that adds actual users of it?

Hi Tomasz,
Exynos5420 patches have dependency on this.
Those patches already posted.

Please ignore. Sending this with cpuidle patches

Quoted 11 lines
Quoted 5 lines

Best regards,
Tomasz

--
with warm regards,
Chander Kashyap

Signature · 2 lines
with warm regards,
Chander Kashyap