public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] arm: socfpga: Fix memory error caused by re-enabling OCRAM ECC
@ 2015-09-02 17:02 Jian Luo
  2015-09-02 17:09 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Jian Luo @ 2015-09-02 17:02 UTC (permalink / raw)
  To: u-boot

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(-)

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);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v2] arm: socfpga: Fix memory error caused by re-enabling OCRAM ECC
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2015-09-02 17:09 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-02 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox