[U-Boot] [PATCH 5/5] mtd: davinci nand: Use ECC for NAND write verification

Peter Tyser ptyser at xes-inc.com
Mon Jan 26 23:24:51 CET 2015


From: Joe Schaack <jschaack at xes-inc.com>

Modify the nand_davinci_write_page() function to use ECC when appropriate
to verify writes.  Previously if a single bit error occured and software
ECC was used the write verification would report a failure.  However,
the write really did succeed, since ECC can handle the error.

Signed-off-by: Joe Schaack <jschaack at xes-inc.com>
Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
I don't have davinci hardware to test on, but the change should
mirror the nand_base.c change.

 drivers/mtd/nand/davinci_nand.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index b4e22d1..cd0b07c 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -415,7 +415,10 @@ static int nand_davinci_write_page(struct mtd_info *mtd, struct nand_chip *chip,
 
 	/* Send command to read back the data */
 	chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
-	chip->ecc.read_page_raw(mtd, chip, vfy_buf, oob_required, page);
+	if (unlikely(raw))
+		chip->ecc.read_page_raw(mtd, chip, vfy_buf, oob_required, page);
+	else
+		chip->ecc.read_page(mtd, chip, vfy_buf, oob_required, page);
 
 	if (memcmp(buf, vfy_buf, mtd->writesize))
 		ret = -EIO;
-- 
1.9.1



More information about the U-Boot mailing list