From patchwork Wed Sep 2 17:02:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian Luo X-Patchwork-Id: 513585 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 2A86F1401DA for ; Thu, 3 Sep 2015 03:03:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 52BDD4B73A; Wed, 2 Sep 2015 19:03:36 +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 hYlcga4sNvNu; Wed, 2 Sep 2015 19:03:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D5EB64B721; Wed, 2 Sep 2015 19:03:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 351A24B721 for ; Wed, 2 Sep 2015 19:03:33 +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 jtUlfDm-D3cV for ; Wed, 2 Sep 2015 19:03:33 +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 085634B71D for ; Wed, 2 Sep 2015 19:03:30 +0200 (CEST) Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.54]) by imta24.fe.bosch.de (Postfix) with ESMTP id E0A24D801C2; Wed, 2 Sep 2015 19:03:29 +0200 (CEST) Received: from SI-HUB1000.de.bosch.com (vsgw24.fe.internet.bosch.com [10.4.98.24]) by vsmta14.fe.internet.bosch.com (Postfix) with ESMTP id A68EBA4027E; Wed, 2 Sep 2015 19:03:29 +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 19:03:29 +0200 From: Jian Luo To: Date: Wed, 2 Sep 2015 19:02:55 +0200 Message-ID: <1441213375-4367-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.1018-21786.006 X-TMASE-MatchedRID: p2a4vL6Qte/3Zb7NlHCdGJYsKSXWWrsH1OQXWj4Uo3pcKZwALwMGs3Tv v/bTZRlovW1l5OPxq8eHFkT6njbcLZ85ToRWQ9x7+Buo4Q3kVMp9LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO0om+oXB9/U853Yh7+1Nk4/H8CWNQFyUIBhzfd+3uu3+jHzSnn+1ojcVDR5lHLFhqcXWV QaYCByIy3T/c9jmA16aRno6ShdszNAA2X6v+LJlnMlKjd7kJW0P2nrhpzTnX4SFeEaqul3aBrUU 4vusNEjwL6SxPpr1/I= Cc: marex@denx.de Subject: [U-Boot] [PATCH v2] 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 --- 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);