From patchwork Tue Sep 9 13:54:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rostislav Lisovy X-Patchwork-Id: 387339 X-Patchwork-Delegate: scottwood@freescale.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 C719F140188 for ; Wed, 10 Sep 2014 00:20:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8770DA7427; Tue, 9 Sep 2014 16:20:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 WUy5uOWtEbXg; Tue, 9 Sep 2014 16:20:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A816A7454; Tue, 9 Sep 2014 16:20:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B0279A7454 for ; Tue, 9 Sep 2014 16:20:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 omxCj11mIXH7 for ; Tue, 9 Sep 2014 16:20:34 +0200 (CEST) X-Greylist: delayed 1551 seconds by postgrey-1.27 at theia; Tue, 09 Sep 2014 16:20:29 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 mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by theia.denx.de (Postfix) with ESMTPS id 1427CA7427 for ; Tue, 9 Sep 2014 16:20:29 +0200 (CEST) Received: by mail-wi0-f175.google.com with SMTP id ex7so4398248wid.14 for ; Tue, 09 Sep 2014 07:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Gb0BkBOooDUpSUxcS2pE6LxDDdwcUbjPcveALWUoamI=; b=oHOLPB/sWImAaRLGsDMn4ya2ZGBo6B+4btzOUW3k/KwAk2v0CUDhBUzeC/KRA9Sz9Q XxKukckTUuYYWwX5JoRwC3rIzrzap63nNB5rpGMcFp19m3LdVTzkra9dYmWe0MCAdZNQ oeaUYvd7f96U/QaLko4F0XYc2Am2r+LHS/1hoIcjPaZ80JLYHB3xNxQDvY2Phh9xvySu Tp2rzkrKR140+TJ2seJbNF5PLm+aKKljiWrQIA2N6kMWyCKdOAg0CEeftwQmPI/3DvLL +IiopiJSY6HgFnzHUT/vaIeG4EvA9asehYBkYPOQPbsN2viqXs5fVjCtFuI6h08NRmEq rLfg== X-Received: by 10.180.205.234 with SMTP id lj10mr30350273wic.1.1410270878248; Tue, 09 Sep 2014 06:54:38 -0700 (PDT) Received: from lp-lvrv.comap.cz ([195.122.193.158]) by mx.google.com with ESMTPSA id h3sm15000439wjz.24.2014.09.09.06.54.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Sep 2014 06:54:37 -0700 (PDT) From: Rostislav Lisovy X-Google-Original-From: Rostislav Lisovy To: u-boot@lists.denx.de, scottwood@freescale.com Date: Tue, 9 Sep 2014 15:54:30 +0200 Message-Id: <1410270870-15843-1-git-send-email-lisovy@merica.cz> X-Mailer: git-send-email 1.9.1 Cc: Michal Vokac , lisovy@gmail.com, Rostislav Lisovy , Michal Sojka Subject: [U-Boot] [PATCH] mtd: nand: am335x: Fix 'bit-flip' errors in SPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de OMAP GPMC driver used with some NAND Flash devices (e.g. Spansion S34ML08G1) causes that U-boot shows hundreds of 'nand: bit-flip corrected' error messages. Possible cause was discussed in the mailinglist thread: http://lists.denx.de/pipermail/u-boot/2014-April/177508.html The issue was partially fixed with the cc81a5291910d7a.git however this has to be done to fix the SPL. The original author of the code is Belisko Marek Signed-off-by: Rostislav Lisovy --- drivers/mtd/nand/am335x_spl_bch.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/am335x_spl_bch.c b/drivers/mtd/nand/am335x_spl_bch.c index ce65d8e..bf8b2ee 100644 --- a/drivers/mtd/nand/am335x_spl_bch.c +++ b/drivers/mtd/nand/am335x_spl_bch.c @@ -64,14 +64,18 @@ static int nand_command(int block, int page, uint32_t offs, NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */ hwctrl(&nand_info[0], (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */ /* Row address */ - hwctrl(&nand_info[0], (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */ - hwctrl(&nand_info[0], ((page_addr >> 8) & 0xff), + if (cmd != NAND_CMD_RNDOUT) { + hwctrl(&nand_info[0], (page_addr & 0xff), + NAND_CTRL_ALE); /* A[19:12] */ + hwctrl(&nand_info[0], ((page_addr >> 8) & 0xff), NAND_CTRL_ALE); /* A[27:20] */ #ifdef CONFIG_SYS_NAND_5_ADDR_CYCLE - /* One more address cycle for devices > 128MiB */ - hwctrl(&nand_info[0], (page_addr >> 16) & 0x0f, + /* One more address cycle for devices > 128MiB */ + hwctrl(&nand_info[0], (page_addr >> 16) & 0x0f, NAND_CTRL_ALE); /* A[31:28] */ #endif + } + hwctrl(&nand_info[0], NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); if (cmd == NAND_CMD_READ0) {