From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Kozlowski Subject: Re: [RFC] ARM: EXYNOS: reset KFC cores when cpu is up Date: Wed, 15 Jul 2015 10:46:02 +0900 Message-ID: <55A5BB5A.2040807@samsung.com> References: <1436924213-29732-1-git-send-email-parkch98@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from mailout2.w1.samsung.com ([210.118.77.12]:40417 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbbGOBqH (ORCPT ); Tue, 14 Jul 2015 21:46:07 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NRI00BDTA8SI640@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 15 Jul 2015 02:46:05 +0100 (BST) In-reply-to: <1436924213-29732-1-git-send-email-parkch98@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Chanho Park , kgene@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Chanwoo Choi , Kevin Hilman , Heesub Shin , Mauro Ribeiro , Abhilash Kesavan , Przemyslaw Marczak , Marek Szyprowski , Chanho Park On 15.07.2015 10:36, Chanho Park wrote: > 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 > > [ 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 > Cc: Chanwoo Choi > Cc: Kevin Hilman > Cc: Heesub Shin > Cc: Mauro Ribeiro > Cc: Abhilash Kesavan > Cc: Przemyslaw Marczak > Cc: Marek Szyprowski > Cc: Krzysztof Kozlowski > Signed-off-by: Chanho Park > Signed-off-by: Chanho Park > --- > arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++- > arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c > index 9bdf547..a076dde 100644 > --- a/arch/arm/mach-exynos/mcpm-exynos.c > +++ b/arch/arm/mach-exynos/mcpm-exynos.c > @@ -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; > } > > diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h > index b761433..fba9068 100644 > --- a/arch/arm/mach-exynos/regs-pmu.h > +++ b/arch/arm/mach-exynos/regs-pmu.h > @@ -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) > From mboxrd@z Thu Jan 1 00:00:00 1970 From: k.kozlowski@samsung.com (Krzysztof Kozlowski) Date: Wed, 15 Jul 2015 10:46:02 +0900 Subject: [RFC] ARM: EXYNOS: reset KFC cores when cpu is up In-Reply-To: <1436924213-29732-1-git-send-email-parkch98@gmail.com> References: <1436924213-29732-1-git-send-email-parkch98@gmail.com> Message-ID: <55A5BB5A.2040807@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 15.07.2015 10:36, Chanho Park wrote: > 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 > > [ 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 > Cc: Chanwoo Choi > Cc: Kevin Hilman > Cc: Heesub Shin > Cc: Mauro Ribeiro > Cc: Abhilash Kesavan > Cc: Przemyslaw Marczak > Cc: Marek Szyprowski > Cc: Krzysztof Kozlowski > Signed-off-by: Chanho Park > Signed-off-by: Chanho Park > --- > arch/arm/mach-exynos/mcpm-exynos.c | 13 ++++++++++++- > arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c > index 9bdf547..a076dde 100644 > --- a/arch/arm/mach-exynos/mcpm-exynos.c > +++ b/arch/arm/mach-exynos/mcpm-exynos.c > @@ -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; > } > > diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h > index b761433..fba9068 100644 > --- a/arch/arm/mach-exynos/regs-pmu.h > +++ b/arch/arm/mach-exynos/regs-pmu.h > @@ -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) >