From patchwork Wed Sep 2 16:57:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian Luo X-Patchwork-Id: 513581 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9740C140134 for ; Thu, 3 Sep 2015 02:57:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49E684B721; Wed, 2 Sep 2015 18:57:31 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DW85ktOf-F52; Wed, 2 Sep 2015 18:57:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8C8AA4B716; Wed, 2 Sep 2015 18:57:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 675B64B716 for ; Wed, 2 Sep 2015 18:57:27 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sczFEsvE9w2f for ; Wed, 2 Sep 2015 18:57:27 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp6-v.fe.bosch.de (smtp6-v.fe.bosch.de [139.15.237.11]) by theia.denx.de (Postfix) with ESMTPS id 3CD934B713 for ; Wed, 2 Sep 2015 18:57:24 +0200 (CEST) Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.54]) by imta24.fe.bosch.de (Postfix) with ESMTP id 0F9C3D80204 for ; Wed, 2 Sep 2015 18:57:24 +0200 (CEST) Received: from SI-HUB1000.de.bosch.com (vsgw22.fe.internet.bosch.com [10.4.98.11]) by vsmta14.fe.internet.bosch.com (Postfix) with ESMTP id BDF07A40289 for ; Wed, 2 Sep 2015 18:57:23 +0200 (CEST) Received: from localhost (10.52.158.81) by SI-HUB1000.de.bosch.com (10.4.103.106) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 2 Sep 2015 18:57:23 +0200 From: Jian Luo To: Date: Wed, 2 Sep 2015 18:57:18 +0200 Message-ID: <1441213038-4216-1-git-send-email-jian.luo4@boschrexroth.de> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.52.158.81] X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-7.5.0.1017-21786.006 X-TMASE-MatchedRID: PGBjaeQfqDL3Zb7NlHCdGJYsKSXWWrsH1OQXWj4Uo3pAtKM3hDDAfF/2 zKXxjR59AH6P0Kn8Urk2UxiSZt+wSe1uFxCM1BxvngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPInxM yeYT53RlkX7kmhk6q+Emwod6Gp1Y132q+9n0oykZfEMiSW5UErVV6ST6dLSCuiJCAHwXHNIDb1D A0M1k28Qe+BvJo6Mx/7Yn1uNB8DtYV4remnWxifeiPYvP0WKzlGj81Ipo8t/Jf0gWUaNlyzFZca 9RSYo/b Subject: [U-Boot] [PATCH] arm: socfpga: Fix memory error caused by re-enabling OCRAM ECC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "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 --- 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);