Skip to contentSkip to conversation

ARM: EXYNOS: reset KFC cores when cpu is up

RFC In review Chanho Park 5 participants 13 messages Jul 15, 2015 – Aug 29, 2015

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

RFC 1/1 ARM: EXYNOS: reset KFC cores when cpu is up

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +12 -1
index 9bdf547..a076dde 100644
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
 		cluster >= EXYNOS5420_NR_CLUSTERS)
 		return -EINVAL;
 
-	exynos_cpu_power_up(cpunr);
+	if (!exynos_cpu_power_state(cpunr)) {
+		exynos_cpu_power_up(cpunr);
+
+		if (soc_is_exynos5800() && cluster) {
+			while (!pmu_raw_readl(S5P_PMU_SPARE2))
+				udelay(10);
+
+			pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+					EXYNOS_SWRESET);
+		}
+	}
+
 	return 0;
 }
 
arch/arm/mach-exynos/regs-pmu.h +6 -0
index b761433..fba9068 100644
@@ -513,6 +513,12 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
 #define SPREAD_ENABLE						0xF
 #define SPREAD_USE_STANDWFI					0xF
 
+#define EXYNOS5420_KFC_CORE_RESET0				BIT(8)
+#define EXYNOS5420_KFC_ETM_RESET0				BIT(20)
+
+#define EXYNOS5420_KFC_CORE_RESET(_nr)				\
+	((EXYNOS5420_KFC_CORE_RESET0 | EXYNOS5420_KFC_ETM_RESET0) << (_nr))
+
 #define EXYNOS5420_BB_CON1					0x0784
 #define EXYNOS5420_BB_SEL_EN					BIT(31)
 #define EXYNOS5420_BB_PMOS_EN					BIT(7)
Signature · 1 line
2.1.0
#1 lore raw
Quoted 9 lines · Chanho Park

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

1. Why the ordering patch is required? It seems unrelated...
2. I tried this already (as in vendor sources from opensource.samsung.com) and it did not help on my Odroid. Are you sure that this patch solely fixes the problem?

Best regards,
Krzysztof

Quoted 84 lines
[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +12 -1
index 9bdf547..a076dde 100644
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
 		cluster >= EXYNOS5420_NR_CLUSTERS)
 		return -EINVAL;
 
-	exynos_cpu_power_up(cpunr);
+	if (!exynos_cpu_power_state(cpunr)) {
+		exynos_cpu_power_up(cpunr);
+
+		if (soc_is_exynos5800() && cluster) {
+			while (!pmu_raw_readl(S5P_PMU_SPARE2))
+				udelay(10);
+
+			pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+					EXYNOS_SWRESET);
+		}
+	}
+
 	return 0;
 }
 
arch/arm/mach-exynos/regs-pmu.h +6 -0
index b761433..fba9068 100644
@@ -513,6 +513,12 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
 #define SPREAD_ENABLE						0xF
 #define SPREAD_USE_STANDWFI					0xF
 
+#define EXYNOS5420_KFC_CORE_RESET0				BIT(8)
+#define EXYNOS5420_KFC_ETM_RESET0				BIT(20)
+
+#define EXYNOS5420_KFC_CORE_RESET(_nr)				\
+	((EXYNOS5420_KFC_CORE_RESET0 | EXYNOS5420_KFC_ETM_RESET0) << (_nr))
+
 #define EXYNOS5420_BB_CON1					0x0784
 #define EXYNOS5420_BB_SEL_EN					BIT(31)
 #define EXYNOS5420_BB_PMOS_EN					BIT(7)
#2 lore raw

Hi,

Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Chanho Park

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

Quoted 4 lines
Quoted 2 lines

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

1. Why the ordering patch is required? It seems unrelated...

Because it related with my booting log :)

Quoted 3 lines

2. I tried this already (as in vendor sources from opensource.samsung.com) and it did not help on my Odroid. Are you sure that this patch solely fixes the problem?

If you turned on CONFIG_DEBUG_LL, you'll need Joonyoung's patch to correct uart address of exynos5422.
http://www.spinics.net/lists/linux-samsung-soc/msg37318.html

Signature · 2 lines
Best Regards,
Chanho Park
#3 lore raw
Quoted 19 lines · Chanho Park

Hi,

Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · Chanho Park

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

Quoted 4 lines
Quoted 2 lines

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

1. Why the ordering patch is required? It seems unrelated...

Because it related with my booting log :)

Quoted 7 lines
Quoted 3 lines

2. I tried this already (as in vendor sources from opensource.samsung.com) and it did not help on my Odroid. Are you sure that this patch solely fixes the problem?

If you turned on CONFIG_DEBUG_LL, you'll need Joonyoung's patch to correct uart address of exynos5422.
http://www.spinics.net/lists/linux-samsung-soc/msg37318.html

I mean that you don't need anything else to fix the problem? I'll give it a try later on my board but I was quite sure that I checked this before :) .

Best regards,
Krzysztof

Tested-by on v1 1/1
#4 lore raw
In reply to Chanho Park

Hi Chanho,

Quoted 93 lines · Chanho Park

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +12 -1
index 9bdf547..a076dde 100644
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
                cluster >= EXYNOS5420_NR_CLUSTERS)
                return -EINVAL;
 
-       exynos_cpu_power_up(cpunr);
+       if (!exynos_cpu_power_state(cpunr)) {
+               exynos_cpu_power_up(cpunr);
+
+               if (soc_is_exynos5800() && cluster) {
+                       while (!pmu_raw_readl(S5P_PMU_SPARE2))
+                               udelay(10);
+
+                       pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+                                       EXYNOS_SWRESET);
+               }
+       }
+
        return 0;
 }
 
arch/arm/mach-exynos/regs-pmu.h +6 -1
index b761433..fba9068 100644
@@ -513,6 +513,12 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
 #define SPREAD_ENABLE                                          0xF
 #define SPREAD_USE_STANDWFI                                    0xF
 
+#define EXYNOS5420_KFC_CORE_RESET0                             BIT(8)
+#define EXYNOS5420_KFC_ETM_RESET0                              BIT(20)
+
+#define EXYNOS5420_KFC_CORE_RESET(_nr)                         \
+       ((EXYNOS5420_KFC_CORE_RESET0 | EXYNOS5420_KFC_ETM_RESET0) << (_nr))
+
 #define EXYNOS5420_BB_CON1                                     0x0784
 #define EXYNOS5420_BB_SEL_EN                                   BIT(31)
 #define EXYNOS5420_BB_PMOS_EN                                  BIT(7)
--
Quoted 2 lines

2.1.0

It brought all the 8 core up on my Odroid-XU3

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Chanho Park

Hello Chanho,

Quoted 56 lines · Chanho Park

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +0 -0
index 9bdf547..a076dde 100644

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 76

Quoted 8 lines
arch/arm/mach-exynos/mcpm-exynos.c +4 -1
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
 		cluster >= EXYNOS5420_NR_CLUSTERS)
 		return -EINVAL;
 
-	exynos_cpu_power_up(cpunr);
+	if (!exynos_cpu_power_state(cpunr)) {
+		exynos_cpu_power_up(cpunr);
+
+		if (soc_is_exynos5800() && cluster) {

I believe of_machine_is_compatible("samsung,exynos5800") is preferred nowadays over soc_is_exynos5800().

Now, is correct to do this for all Exynos5422/5800 based boards? AFAIU from the previous discussions, this behavior is specific to the Odroid XU3 so maybe of_machine_is_compatible("hardkernel,odroid-xu3") instead?

I know this can affect other Exynos5800 boards that are shipped with a similar binary BL1/BL2 blobs that also use SPARE2 as a sync mechanism but maybe is better to add more exceptions later rather than do it for all Exynos5800?

The Exynos5800 based Chromebook doesn't have this issue for example and all the 8 cores are brought up correctly.

Having said that, I tested this patch on an Exynos5800 Peach Pi and all the 8 cores are up and also after a S2R so seems to be a no-op when the PMU_SPARE2 is not used for this.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#6 lore raw

Hello Javier,

Quoted 12 lines

I believe of_machine_is_compatible("samsung,exynos5800") is preferred nowadays over soc_is_exynos5800().

Now, is correct to do this for all Exynos5422/5800 based boards? AFAIU from the previous discussions, this behavior is specific to the Odroid XU3 so maybe of_machine_is_compatible("hardkernel,odroid-xu3") instead?

I know this can affect other Exynos5800 boards that are shipped with a similar binary BL1/BL2 blobs that also use SPARE2 as a sync mechanism but maybe is better to add more exceptions later rather than do it for all Exynos5800?

Quoted 6 lines

The Exynos5800 based Chromebook doesn't have this issue for example and all the 8 cores are brought up correctly.

Having said that, I tested this patch on an Exynos5800 Peach Pi and all the 8 cores are up and also after a S2R so seems to be a no-op when the PMU_SPARE2 is not used for this.

Thanks for the testing. I'll find more proper way it could be applied only for exynos5422 boards.

Signature · 2 lines
Best Regards,
Chanho Park
#7 lore raw
In reply to Chanho Park

2015-07-15 10:36 GMT+09:00 Chanho Park <[email protected]>:

Quoted 32 lines

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs
Quoted 2 lines

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Few questions/issues:
1. For the proper patch the commit message needs to be fixed a little. The dmesg above is meaningless but instead you can put short dmesg (2 or 4 lines) with failed booting of CPUs.
2. Why only MCPM? Isn't this also needed without MCPM?

Quoted 12 lines
Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

I think both Chanho Parks are the same person :) so you may leave only one (the one matching "From").

Quoted 10 lines
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +0 -0
index 9bdf547..a076dde 100644

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 74

Quoted 6 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -1
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
                cluster >= EXYNOS5420_NR_CLUSTERS)
                return -EINVAL;
 
-       exynos_cpu_power_up(cpunr);
+       if (!exynos_cpu_power_state(cpunr)) {
+               exynos_cpu_power_up(cpunr);

This second exynos_cpu_power_up() is needed? Do you know why?

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 76

Quoted 2 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
+
+               if (soc_is_exynos5800() && cluster) {

If of_machine_is_compatible() can be used then please use it. Javier also mentioned it and he pointed that this is not necessary on Chromebooks.

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 81

Quoted 5 lines
arch/arm/mach-exynos/mcpm-exynos.c +5 -0
+                       while (!pmu_raw_readl(S5P_PMU_SPARE2))
+                               udelay(10);
+
+                       pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+                                       EXYNOS_SWRESET);

This is quite similar to existing exynos_core_restart(). Can you extend it for this purpose? Or at least put it as separate function near exynos_core_restart() so this would be grouped close to each other?

Documenting this behaviour would be really nice (you can combine some of my findings on SPARE2 from previous discussion, if they are useful of course).

Quoted 30 lines
arch/arm/mach-exynos/mcpm-exynos.c +3 -0
+               }
+       }
+
        return 0;
 }
 
arch/arm/mach-exynos/regs-pmu.h +6 -1
index b761433..fba9068 100644
@@ -513,6 +513,12 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
 #define SPREAD_ENABLE                                          0xF
 #define SPREAD_USE_STANDWFI                                    0xF
 
+#define EXYNOS5420_KFC_CORE_RESET0                             BIT(8)
+#define EXYNOS5420_KFC_ETM_RESET0                              BIT(20)
+
+#define EXYNOS5420_KFC_CORE_RESET(_nr)                         \
+       ((EXYNOS5420_KFC_CORE_RESET0 | EXYNOS5420_KFC_ETM_RESET0) << (_nr))
+
 #define EXYNOS5420_BB_CON1                                     0x0784
 #define EXYNOS5420_BB_SEL_EN                                   BIT(31)
 #define EXYNOS5420_BB_PMOS_EN                                  BIT(7)
--

2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Hi,

Quoted 33 lines · Krzysztof Kozlowski

2015-07-15 10:36 GMT+09:00 Chanho Park <[email protected]>:

Quoted 32 lines

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs
Quoted 7 lines
Quoted 2 lines

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Few questions/issues:
1. For the proper patch the commit message needs to be fixed a little. The dmesg above is meaningless but instead you can put short dmesg (2 or 4 lines) with failed booting of CPUs.

They will be gone when I make a official patch.

Quoted 1 line

2. Why only MCPM? Isn't this also needed without MCPM?

Current exynos platsmp is not aware multi clusters. MCPM covered secondary cpu booting of exynos big.Little cores. Without MCPM, same approach and codes will be required on platsmp thus I think it's redundant.

Quoted 30 lines
Quoted 13 lines
Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

I think both Chanho Parks are the same person :) so you may leave only one (the one matching "From").

Quoted 13 lines
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +0 -0
index 9bdf547..a076dde 100644
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
                cluster >= EXYNOS5420_NR_CLUSTERS)
                return -EINVAL;
 
Quoted 5 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 74

Quoted 3 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -1
-       exynos_cpu_power_up(cpunr);
+       if (!exynos_cpu_power_state(cpunr)) {
+               exynos_cpu_power_up(cpunr);

This second exynos_cpu_power_up() is needed? Do you know why?

It's redirected to exynos's platsmp and it turned on CPU through pmu registers.
-> exynos_cpu_powerup: mcpm-exynos.c
-> exynos_cpu_power_up: platsmp.c

Current mcpm exynos tried to run exynos_cpu_power_up twice during secondary cpu is up. The first is from cpu_power_up of mcpm and the second is from cpu_is_up. I want to avoid second power up the cpu if it already turned on.

static void exynos_cpu_is_up(unsigned int cpu, unsigned int cluster)

{
        /* especially when resuming: make sure power control is set */

        exynos_cpu_powerup(cpu, cluster);
}
Quoted 7 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 76

Quoted 3 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
+
+               if (soc_is_exynos5800() && cluster) {

If of_machine_is_compatible() can be used then please use it. Javier also mentioned it and he pointed that this is not necessary on Chromebooks.

Okay. I'll use of_machine_is_compatible() instead of soc_is_exynos5800 to avoid running it from exynos5800.

Quoted 11 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 81

Quoted 6 lines
arch/arm/mach-exynos/mcpm-exynos.c +5 -0
+                       while (!pmu_raw_readl(S5P_PMU_SPARE2))
+                               udelay(10);
+
+                       pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+                                       EXYNOS_SWRESET);

This is quite similar to existing exynos_core_restart(). Can you extend it for this purpose? Or at least put it as separate function near exynos_core_restart() so this would be grouped close to each other?

As I said above, the platsmp is not aware multi clusters. I feel like it would be dirty if I try to merge them.

Quoted 4 lines

Documenting this behaviour would be really nice (you can combine some of my findings on SPARE2 from previous discussion, if they are useful of course).

No one knows exactly why we should wait until SPARE2 is up. I'll specify known issue of it with your findings.

Signature · 2 lines
Best Regards,
Chanho Park
#9 lore raw
Quoted 45 lines · Chanho Park

Hi,

Quoted 33 lines · Krzysztof Kozlowski

2015-07-15 10:36 GMT+09:00 Chanho Park <[email protected]>:

Quoted 32 lines

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs
Quoted 7 lines
Quoted 2 lines

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Few questions/issues:
1. For the proper patch the commit message needs to be fixed a little. The dmesg above is meaningless but instead you can put short dmesg (2 or 4 lines) with failed booting of CPUs.

Quoted 8 lines

They will be gone when I make a official patch.

Quoted 1 line

2. Why only MCPM? Isn't this also needed without MCPM?

Current exynos platsmp is not aware multi clusters. MCPM covered secondary cpu booting of exynos big.Little cores. Without MCPM, same approach and codes will be required on platsmp thus I think it's redundant.

Okay.

Quoted 46 lines
Quoted 31 lines
Quoted 14 lines
Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

I think both Chanho Parks are the same person :) so you may leave only one (the one matching "From").

Quoted 13 lines
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +0 -0
index 9bdf547..a076dde 100644
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
                cluster >= EXYNOS5420_NR_CLUSTERS)
                return -EINVAL;
 
Quoted 5 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 74

Quoted 3 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -1
-       exynos_cpu_power_up(cpunr);
+       if (!exynos_cpu_power_state(cpunr)) {
+               exynos_cpu_power_up(cpunr);

This second exynos_cpu_power_up() is needed? Do you know why?

It's redirected to exynos's platsmp and it turned on CPU through pmu registers.
-> exynos_cpu_powerup: mcpm-exynos.c
-> exynos_cpu_power_up: platsmp.c

Current mcpm exynos tried to run exynos_cpu_power_up twice during secondary cpu is up. The first is from cpu_power_up of mcpm and the second is from cpu_is_up. I want to avoid second power up the cpu if it already turned on.

Quoted 6 lines

static void exynos_cpu_is_up(unsigned int cpu, unsigned int cluster)

{
        /* especially when resuming: make sure power control is set */

        exynos_cpu_powerup(cpu, cluster);
}

Okay, I get it. I misunderstood the patch. It's fine.

Quoted 20 lines
Quoted 9 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 76

Quoted 5 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
+
+               if (soc_is_exynos5800() && cluster) {

If of_machine_is_compatible() can be used then please use it. Javier also mentioned it and he pointed that this is not necessary on Chromebooks.

Okay. I'll use of_machine_is_compatible() instead of soc_is_exynos5800 to avoid running it from exynos5800.

Quoted 7 lines
Quoted 6 lines
arch/arm/mach-exynos/mcpm-exynos.c +5 -0
+                       while (!pmu_raw_readl(S5P_PMU_SPARE2))
+                               udelay(10);
+
+                       pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+                                       EXYNOS_SWRESET);
Quoted 7 lines
Quoted 4 lines

This is quite similar to existing exynos_core_restart(). Can you extend it for this purpose? Or at least put it as separate function near exynos_core_restart() so this would be grouped close to each other?

As I said above, the platsmp is not aware multi clusters. I feel like it would be dirty if I try to merge them.

But here you are not reseting the cluster but reseting a CPU. Very similar function exists already - for waiting on SPARE2 and reseting CPU. I don't see what multiple clusters are changing here?

Quoted 7 lines
Quoted 4 lines

Documenting this behaviour would be really nice (you can combine some of my findings on SPARE2 from previous discussion, if they are useful of course).

No one knows exactly why we should wait until SPARE2 is up. I'll specify known issue of it with your findings.

Right, no one... at least publicly (probably the guys who have access to sources of BL1/BL2 know). Still it is important to document the reason why we think these steps are necessary. Some 3rd party developer won't have a clue why you are spinning on some SPARE2 register...

Best regards,
Krzysztof

#10 lore raw

2015-07-16 10:49 GMT+09:00 Krzysztof Kozlowski <[email protected]>:

Quoted 149 lines · Chanho Park
Quoted 45 lines

Hi,

Quoted 33 lines · Krzysztof Kozlowski

2015-07-15 10:36 GMT+09:00 Chanho Park <[email protected]>:

Quoted 32 lines

The cpu booting of exynos5422 has been still broken since we discussed it in last year[1]. I found this resetting codes from odroid-xu3 kernel of hardkernel, it could help to boot 8 cores well. This patch need to have more test like STR and other SoC especially exynos5800 which is variant of exynos5422. If this patch is broken on exynos5800, I'll find another way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs
Quoted 7 lines
Quoted 2 lines

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Few questions/issues:
1. For the proper patch the commit message needs to be fixed a little. The dmesg above is meaningless but instead you can put short dmesg (2 or 4 lines) with failed booting of CPUs.

Quoted 8 lines

They will be gone when I make a official patch.

Quoted 1 line

2. Why only MCPM? Isn't this also needed without MCPM?

Current exynos platsmp is not aware multi clusters. MCPM covered secondary cpu booting of exynos big.Little cores. Without MCPM, same approach and codes will be required on platsmp thus I think it's redundant.

Okay.

Quoted 46 lines
Quoted 31 lines
Quoted 14 lines
Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

I think both Chanho Parks are the same person :) so you may leave only one (the one matching "From").

Quoted 13 lines
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/mcpm-exynos.c +0 -0
index 9bdf547..a076dde 100644
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
                cluster >= EXYNOS5420_NR_CLUSTERS)
                return -EINVAL;
 
Quoted 5 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 74

Quoted 3 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -1
-       exynos_cpu_power_up(cpunr);
+       if (!exynos_cpu_power_state(cpunr)) {
+               exynos_cpu_power_up(cpunr);

This second exynos_cpu_power_up() is needed? Do you know why?

It's redirected to exynos's platsmp and it turned on CPU through pmu registers.
-> exynos_cpu_powerup: mcpm-exynos.c
-> exynos_cpu_power_up: platsmp.c

Current mcpm exynos tried to run exynos_cpu_power_up twice during secondary cpu is up. The first is from cpu_power_up of mcpm and the second is from cpu_is_up. I want to avoid second power up the cpu if it already turned on.

Quoted 6 lines

static void exynos_cpu_is_up(unsigned int cpu, unsigned int cluster)

{
        /* especially when resuming: make sure power control is set */

        exynos_cpu_powerup(cpu, cluster);
}

Okay, I get it. I misunderstood the patch. It's fine.

Quoted 20 lines
Quoted 9 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 76

Quoted 5 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
+
+               if (soc_is_exynos5800() && cluster) {

If of_machine_is_compatible() can be used then please use it. Javier also mentioned it and he pointed that this is not necessary on Chromebooks.

Okay. I'll use of_machine_is_compatible() instead of soc_is_exynos5800 to avoid running it from exynos5800.

Quoted 7 lines
Quoted 6 lines
arch/arm/mach-exynos/mcpm-exynos.c +5 -0
+                       while (!pmu_raw_readl(S5P_PMU_SPARE2))
+                               udelay(10);
+
+                       pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
+                                       EXYNOS_SWRESET);
Quoted 7 lines
Quoted 4 lines

This is quite similar to existing exynos_core_restart(). Can you extend it for this purpose? Or at least put it as separate function near exynos_core_restart() so this would be grouped close to each other?

As I said above, the platsmp is not aware multi clusters. I feel like it would be dirty if I try to merge them.

But here you are not reseting the cluster but reseting a CPU. Very similar function exists already - for waiting on SPARE2 and reseting CPU. I don't see what multiple clusters are changing here?

Quoted 5 lines
Quoted 4 lines

Documenting this behaviour would be really nice (you can combine some of my findings on SPARE2 from previous discussion, if they are useful of course).

Quoted 7 lines
Quoted 2 lines

No one knows exactly why we should wait until SPARE2 is up. I'll specify known issue of it with your findings.

Right, no one... at least publicly (probably the guys who have access to sources of BL1/BL2 know). Still it is important to document the reason why we think these steps are necessary. Some 3rd party developer won't have a clue why you are spinning on some SPARE2 register...

Dear Chanho,

Do you plan to send next version of the patchset? I tested it on my Odroid XU3L (5422) and it works good so the idea you had is correct.

Best regards,
Krzysztof

#11 lore raw
In reply to Chanho Park
Quoted 63 lines · Chanho Park

The cpu booting of exynos5422 has been still broken since we discussed
it in last year[1]. I found this resetting codes from odroid-xu3 kernel of
hardkernel, it could help to boot 8 cores well. This patch need to have
more test like STR and other SoC especially exynos5800 which is variant
of exynos5422. If this patch is broken on exynos5800, I'll find another
way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015 -June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach renamed from arch/arm/mach-exynos/mcpm-exynos.c +0 -1
-exynos/mcpm-exynos.c

index 9bdf547..a076dde 100644

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, · line 77

Quoted 9 lines
arch/arm/mach-exynos/mcpm-exynos.c +4 -1
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu, 
 unsigned int cluster)
 		cluster >= EXYNOS5420_NR_CLUSTERS)
 		return -EINVAL;
 
-	exynos_cpu_power_up(cpunr);
+	if (!exynos_cpu_power_state(cpunr)) {
+		exynos_cpu_power_up(cpunr);
+
+		if (soc_is_exynos5800() && cluster) {

This seems a tad subtle. You're assuming here cluster 1 is the little cluster. Would be good to make this more specific/obvious.

Quoted 1 line

From looking at other mcpm-exynos code the assumption seems valid

(otherwise more code would be broken), so it may make sense to simply define LITTLE_CLUSTER and BIG_CLUSTER and check explicitely for that.

Krzysztof on IRC mention that the cluster layout is read from MPIDR so in principle this assumption could be invalidated on some Exynos versions, but then again, given the amount of fallout from that i don't see it as a practical issue at the moment :)

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 78

Quoted 2 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
+			while (!pmu_raw_readl(S5P_PMU_SPARE2))
+				udelay(10);

Would love to see some documentation for this magical pmu register, but i guess you can't have them all :)

Signature · 2 lines
Sjoerd Simons <[email protected]>
Collabora Ltd.
#12 lore raw

2015-07-17 17:05 GMT+09:00 Sjoerd Simons <[email protected]>:

Quoted 77 lines · Chanho Park
Quoted 63 lines

The cpu booting of exynos5422 has been still broken since we discussed
it in last year[1]. I found this resetting codes from odroid-xu3 kernel of
hardkernel, it could help to boot 8 cores well. This patch need to have
more test like STR and other SoC especially exynos5800 which is variant
of exynos5422. If this patch is broken on exynos5800, I'll find another
way to check exynos5422.

This patch is top of my previous exynos5422 cpu ordering patch[2] and need to enable CONFIG_EXYNOS5420_MCPM=y

[    0.047509] CPU0: update cpu_capacity 448
[    0.047534] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.047874] Setting up static identity map for 0x400082c0 -
0x40008318
[    0.048340] ARM CCI driver probed
[    0.048597] Exynos MCPM support installed
[    0.065676] CPU1: update cpu_capacity 448
[    0.065685] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.070672] CPU2: update cpu_capacity 448
[    0.070680] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.075644] CPU3: update cpu_capacity 448
[    0.075653] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.080590] CPU4: update cpu_capacity 1535
[    0.080600] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.085591] CPU5: update cpu_capacity 1535
[    0.085599] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.090590] CPU6: update cpu_capacity 1535
[    0.090598] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.095585] CPU7: update cpu_capacity 1535
[    0.095593] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.095720] Brought up 8 CPUs

[1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015 -June/350632.html [2]:https://patchwork.kernel.org/patch/6782891/

Cc Joonyoung Shim <[email protected]>
Cc Chanwoo Choi <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Heesub Shin <[email protected]>
Cc Mauro Ribeiro <[email protected]>
Cc Abhilash Kesavan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++-
 arch/arm/mach-exynos/regs-pmu.h    |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/arm/mach renamed from arch/arm/mach-exynos/mcpm-exynos.c +0 -1
-exynos/mcpm-exynos.c

index 9bdf547..a076dde 100644

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, · line 77

Quoted 9 lines
arch/arm/mach-exynos/mcpm-exynos.c +4 -1
@@ -70,7 +70,18 @@ static int exynos_cpu_powerup(unsigned int cpu,
 unsigned int cluster)
              cluster >= EXYNOS5420_NR_CLUSTERS)
              return -EINVAL;
 
-     exynos_cpu_power_up(cpunr);
+     if (!exynos_cpu_power_state(cpunr)) {
+             exynos_cpu_power_up(cpunr);
+
+             if (soc_is_exynos5800() && cluster) {

This seems a tad subtle. You're assuming here cluster 1 is the little cluster. Would be good to make this more specific/obvious.

Quoted 8 lines

From looking at other mcpm-exynos code the assumption seems valid (otherwise more code would be broken), so it may make sense to simply define LITTLE_CLUSTER and BIG_CLUSTER and check explicitely for that.

Krzysztof on IRC mention that the cluster layout is read from MPIDR so in principle this assumption could be invalidated on some Exynos versions, but then again, given the amount of fallout from that i don't see it as a practical issue at the moment :)

For these SoCs this cluster ID should be fixed. However you are right that it is a little fuzzy so it would be better to find a more reliable way.

Quoted 6 lines

arch/arm/mach-exynos/mcpm-exynos.c static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) · line 78

Quoted 3 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
+                     while (!pmu_raw_readl(S5P_PMU_SPARE2))
+                             udelay(10);

Would love to see some documentation for this magical pmu register, but i guess you can't have them all :)

I started documenting more of such registers here:
Documentation/arm/Samsung/Bootloader-interface.txt
The SPARE2 register is 0x908. I would be good to extend the documentation but unfortunately all I knowledge I got came from observation or vendor's source code, not from bootloader source code.

I know that Przemyslaw Marczak is also looking at the issue so maybe he could share some details?

Best regards,
Krzysztof