[PATCH] mtd: apply tPROG delay for ONFI nand's page program

From: Huang Shijie
Date: Mon Jan 14 2013 - 03:11:39 EST


With some latest Micron's onfi nand(such as MT29F64G08CBABAWP),
I find that if we do not apply the tPROG delay as the datasheet tells us,
the page program may fails. You will read out the all 0xff from this page
in this case.

This patch adds the tPROG delay for page program when it is an onfi nand.

Signed-off-by: Huang Shijie <b32955@xxxxxxxxxxxxx>
---
drivers/mtd/nand/nand_base.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8323ac9..b628dd5 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -841,6 +841,10 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
*/
ndelay(100);

+ /* Apply the tPROG delay for ONFI nand program. */
+ if (chip->onfi_version && state == FL_WRITING)
+ udelay(le16_to_cpu(chip->onfi_params.t_prog));
+
if ((state == FL_ERASING) && (chip->options & NAND_IS_AND))
chip->cmdfunc(mtd, NAND_CMD_STATUS_MULTI, -1, -1);
else
--
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/