From: Stefan Roese Date: Tue, 6 May 2014 10:36:59 +0200 Subject: [U-Boot] [PATCH 2/2] mtd: nand: nand_base.c: Fix address cycle problem with NAND_CMD_RNDOUT In-Reply-To: <1399365419-23775-1-git-send-email-sr@denx.de> References: <1399365419-23775-1-git-send-email-sr@denx.de> Message-ID: <1399365419-23775-2-git-send-email-sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Pekon Gupta On some NAND devices (e.g. Hynix H27U2G8F2CTR-BI on Siemens DXR2 / Draco boards) the SPL issues the following bit-flip error messages: nand: bit-flip corrected @oob=0 ... This patch makes sure that only the required address cycles are sent to the NAND chip. The same issue has been reported by Bacem Daassi: http://e2e.ti.com/support/arm/sitara_arm/f/791/t/259699.aspx " The issue is mainly due to a NAND protocol violation in the omap driver since the Random Data Output command (05h-E0h) expects to see only the column address that should be addressed within the already loaded read page into the read buffer. Only 2 address cycles with ALE active should be provided between the 05h and E0h commands. The Page read command expects the full address footprint (2bytes for column address + 3bytes for row address), but once the page is loaded into the read buffer, Random Data Output should be used with only 2bytes for column address. " Signed-off-by: Pekon Gupta Signed-off-by: Stefan Roese Tested-by: Samuel Egli Cc: Marek Belisko Cc: Scott Wood --- drivers/mtd/nand/nand_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 1ce55fd..f11fce4 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -674,7 +674,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, ctrl &= ~NAND_CTRL_CHANGE; chip->cmd_ctrl(mtd, column >> 8, ctrl); } - if (page_addr != -1) { + if (page_addr != -1 && command != NAND_CMD_RNDOUT) { chip->cmd_ctrl(mtd, page_addr, ctrl); chip->cmd_ctrl(mtd, page_addr >> 8, NAND_NCE | NAND_ALE); -- 1.9.2