public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] imx6: cache: disable L2 before touching Auxiliary Control Register
Date: Wed, 4 May 2016 15:32:28 +0200	[thread overview]
Message-ID: <5729F9EC.5060401@denx.de> (raw)
In-Reply-To: <1462346870-19154-1-git-send-email-van.freenix@gmail.com>

Hi Peng,

On 04/05/2016 09:27, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> According PL310 TRM, Auxiliary Control Register
> "
> The register must be written to using a secure access, and it can be
> read using either a secure or a NS access. If you write to this register
> with a NS access, it results in a write response with a DECERR response,
> and the register is not updated. Writing to this register with the L2
> cache enabled, that is, bit[0] of L2 Control Register set to 1,
> results in a SLVERR.
> "
> 
> So If L2 cache is already enabled by ROM, chaning value of ACR
> will cause SLVERR and uboot hang.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  arch/arm/imx-common/cache.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/imx-common/cache.c b/arch/arm/imx-common/cache.c
> index 54b021c..b775488 100644
> --- a/arch/arm/imx-common/cache.c
> +++ b/arch/arm/imx-common/cache.c
> @@ -43,6 +43,12 @@ void v7_outer_cache_enable(void)
>  
>  
>  	/*
> +	 * Must disable the L2 before changing the latency parameters
> +	 * and auxiliary control register.
> +	 */
> +	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
> +
> +	/*
>  	 * Set bit 22 in the auxiliary control register. If this bit
>  	 * is cleared, PL310 treats Normal Shared Non-cacheable
>  	 * accesses as Cacheable no-allocate.
> @@ -59,9 +65,6 @@ void v7_outer_cache_enable(void)
>  	}
>  #endif
>  
> -	/* Must disable the L2 before changing the latency parameters */
> -	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
> -
>  	writel(0x132, &pl310->pl310_tag_latency_ctrl);
>  	writel(0x132, &pl310->pl310_data_latency_ctrl);
>  
> 

It should be fine to have in release, I think.

Acked-by : Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

      reply	other threads:[~2016-05-04 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  7:27 [U-Boot] [PATCH] imx6: cache: disable L2 before touching Auxiliary Control Register Peng Fan
2016-05-04 13:32 ` Stefano Babic [this message]

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=5729F9EC.5060401@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox