All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tushar Behera <trblinux@gmail.com>
To: Nicolas Pitre <nicolas.pitre@linaro.org>,
	Abhilash Kesavan <kesavan.abhilash@gmail.com>,
	Doug Anderson <dianders@google.com>,
	Andrew Bresticker <abrestic@chromium.org>
Cc: Kevin Hilman <khilman@linaro.org>,
	Olof Johansson <olof@lixom.net>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linaro-kernel@lists.linaro.org
Subject: Re: [PATCH 3/3] ARM: exynos: activate the CCI on boot CPU/cluster with the MCPM loopback
Date: Tue, 24 Jun 2014 13:52:59 +0530	[thread overview]
Message-ID: <53A93563.2050409@gmail.com> (raw)
In-Reply-To: <1403583071-5650-4-git-send-email-nicolas.pitre@linaro.org>

On 06/24/2014 09:41 AM, Nicolas Pitre wrote:
> The Chromebook firmware doesn't enable the CCI for the boot cpu, and
> arguably it shouldn't have to either. Let's have the kernel handle the
> CCI on its own for the boot CPU the same way it does it for secondary CPUs
> by using the MCPM loopback.
> 
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> ---

Tested on top of next-20140623. Verified that all 8 cores are coming up
on Exynos5800 based Peach-pi board.

Tested-by: Tushar Behera <tushar.b@samsung.com>

>  arch/arm/mach-exynos/mcpm-exynos.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
> index 0498d0b887..0c839f94ec 100644
> --- a/arch/arm/mach-exynos/mcpm-exynos.c
> +++ b/arch/arm/mach-exynos/mcpm-exynos.c
> @@ -290,6 +290,19 @@ static void __naked exynos_pm_power_up_setup(unsigned int affinity_level)
>  	"b	cci_enable_port_for_self");
>  }
>  
> +static void __init exynos_cache_off(void)
> +{
> +	if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A15) {
> +		/* disable L2 prefetching on the Cortex-A15 */
> +		asm volatile(
> +		"mcr	p15, 1, %0, c15, c0, 3\n\t"
> +		"isb\n\t"
> +		"dsb"
> +		: : "r" (0x400));
> +	}
> +	exynos_v7_exit_coherency_flush(all);
> +}
> +
>  static const struct of_device_id exynos_dt_mcpm_match[] = {
>  	{ .compatible = "samsung,exynos5420" },
>  	{ .compatible = "samsung,exynos5800" },
> @@ -333,6 +346,8 @@ static int __init exynos_mcpm_init(void)
>  	ret = mcpm_platform_register(&exynos_power_ops);
>  	if (!ret)
>  		ret = mcpm_sync_init(exynos_pm_power_up_setup);
> +	if (!ret)
> +		ret = mcpm_loopback(exynos_cache_off); /* turn on the CCI */
>  	if (ret) {
>  		iounmap(ns_sram_base_addr);
>  		return ret;
> 


-- 
Tushar Behera

WARNING: multiple messages have this Message-ID (diff)
From: trblinux@gmail.com (Tushar Behera)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: exynos: activate the CCI on boot CPU/cluster with the MCPM loopback
Date: Tue, 24 Jun 2014 13:52:59 +0530	[thread overview]
Message-ID: <53A93563.2050409@gmail.com> (raw)
In-Reply-To: <1403583071-5650-4-git-send-email-nicolas.pitre@linaro.org>

On 06/24/2014 09:41 AM, Nicolas Pitre wrote:
> The Chromebook firmware doesn't enable the CCI for the boot cpu, and
> arguably it shouldn't have to either. Let's have the kernel handle the
> CCI on its own for the boot CPU the same way it does it for secondary CPUs
> by using the MCPM loopback.
> 
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> ---

Tested on top of next-20140623. Verified that all 8 cores are coming up
on Exynos5800 based Peach-pi board.

Tested-by: Tushar Behera <tushar.b@samsung.com>

>  arch/arm/mach-exynos/mcpm-exynos.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
> index 0498d0b887..0c839f94ec 100644
> --- a/arch/arm/mach-exynos/mcpm-exynos.c
> +++ b/arch/arm/mach-exynos/mcpm-exynos.c
> @@ -290,6 +290,19 @@ static void __naked exynos_pm_power_up_setup(unsigned int affinity_level)
>  	"b	cci_enable_port_for_self");
>  }
>  
> +static void __init exynos_cache_off(void)
> +{
> +	if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A15) {
> +		/* disable L2 prefetching on the Cortex-A15 */
> +		asm volatile(
> +		"mcr	p15, 1, %0, c15, c0, 3\n\t"
> +		"isb\n\t"
> +		"dsb"
> +		: : "r" (0x400));
> +	}
> +	exynos_v7_exit_coherency_flush(all);
> +}
> +
>  static const struct of_device_id exynos_dt_mcpm_match[] = {
>  	{ .compatible = "samsung,exynos5420" },
>  	{ .compatible = "samsung,exynos5800" },
> @@ -333,6 +346,8 @@ static int __init exynos_mcpm_init(void)
>  	ret = mcpm_platform_register(&exynos_power_ops);
>  	if (!ret)
>  		ret = mcpm_sync_init(exynos_pm_power_up_setup);
> +	if (!ret)
> +		ret = mcpm_loopback(exynos_cache_off); /* turn on the CCI */
>  	if (ret) {
>  		iounmap(ns_sram_base_addr);
>  		return ret;
> 


-- 
Tushar Behera

  reply	other threads:[~2014-06-24  8:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24  4:11 [PATCH 0/3] MCPM: clarify boot CPU situation wrt CCI Nicolas Pitre
2014-06-24  4:11 ` Nicolas Pitre
2014-06-24  4:11 ` [PATCH 1/3] ARM: MCPM: provide infrastructure to allow for MCPM loopback Nicolas Pitre
2014-06-24  4:11   ` Nicolas Pitre
2014-06-24 16:12   ` Doug Anderson
2014-06-24 16:12     ` Doug Anderson
2014-06-24  4:11 ` [PATCH 2/3] ARM: TC2: test the MCPM loopback during boot Nicolas Pitre
2014-06-24  4:11   ` Nicolas Pitre
2014-06-24  4:11 ` [PATCH 3/3] ARM: exynos: activate the CCI on boot CPU/cluster with the MCPM loopback Nicolas Pitre
2014-06-24  4:11   ` Nicolas Pitre
2014-06-24  8:22   ` Tushar Behera [this message]
2014-06-24  8:22     ` Tushar Behera
2014-06-24 16:15   ` Doug Anderson
2014-06-24 16:15     ` Doug Anderson
2014-06-24 17:50     ` Nicolas Pitre
2014-06-24 17:50       ` Nicolas Pitre
2014-06-24 15:35 ` [PATCH 0/3] MCPM: clarify boot CPU situation wrt CCI Kevin Hilman
2014-06-24 15:35   ` Kevin Hilman
2014-06-24 22:57   ` Doug Anderson
2014-06-24 22:57     ` Doug Anderson
2014-06-26  2:41     ` Kevin Hilman
2014-06-26  2:41       ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A93563.2050409@gmail.com \
    --to=trblinux@gmail.com \
    --cc=abrestic@chromium.org \
    --cc=dianders@google.com \
    --cc=kesavan.abhilash@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=olof@lixom.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.