public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm: socfpga: Fix memory error caused by re-enabling OCRAM ECC
Date: Wed, 2 Sep 2015 19:09:03 +0200	[thread overview]
Message-ID: <201509021909.03213.marex@denx.de> (raw)
In-Reply-To: <1441213375-4367-1-git-send-email-jian.luo4@boschrexroth.de>

On Wednesday, September 02, 2015 at 07:02:55 PM, Jian Luo wrote:
> Re-enabling OCRAM ECC can cause some value changes in SRAM. Just
> clear fake interrupt status and keep other bits intact.
> 
> Signed-off-by: Jian Luo <jian.luo4@boschrexroth.de>
> ---
> Changes for v2:
> 	- add CC to custodian
> 
>  arch/arm/mach-socfpga/spl.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)

+CC Dinh.

> diff --git a/arch/arm/mach-socfpga/spl.c b/arch/arm/mach-socfpga/spl.c
> index 775a827..c858406 100644
> --- a/arch/arm/mach-socfpga/spl.c
> +++ b/arch/arm/mach-socfpga/spl.c
> @@ -90,12 +90,14 @@ void board_init_f(ulong dummy)
>  	 * and DBE might triggered during power on
>  	 */
>  	reg = readl(&sysmgr_regs->eccgrp_ocram);
> -	if (reg & SYSMGR_ECC_OCRAM_SERR)
> -		writel(SYSMGR_ECC_OCRAM_SERR | SYSMGR_ECC_OCRAM_EN,
> -		       &sysmgr_regs->eccgrp_ocram);
> -	if (reg & SYSMGR_ECC_OCRAM_DERR)
> -		writel(SYSMGR_ECC_OCRAM_DERR  | SYSMGR_ECC_OCRAM_EN,
> -		       &sysmgr_regs->eccgrp_ocram);
> +	if (reg & SYSMGR_ECC_OCRAM_SERR) {
> +		reg &= ~SYSMGR_ECC_OCRAM_SERR;
> +		writel(reg, &sysmgr_regs->eccgrp_ocram);
> +	}
> +	if (reg & SYSMGR_ECC_OCRAM_DERR) {
> +		reg &= ~SYSMGR_ECC_OCRAM_DERR;
> +		writel(reg, &sysmgr_regs->eccgrp_ocram);
> +	}
> 
>  	memset(__bss_start, 0, __bss_end - __bss_start);

Best regards,
Marek Vasut

      reply	other threads:[~2015-09-02 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 17:02 [U-Boot] [PATCH v2] arm: socfpga: Fix memory error caused by re-enabling OCRAM ECC Jian Luo
2015-09-02 17:09 ` Marek Vasut [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=201509021909.03213.marex@denx.de \
    --to=marex@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