summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-02-02 18:15:57 -0600
committerScott Wood <scottwood@freescale.com>2011-04-01 14:49:08 -0500
commit6f2ffc3da2b794c3ee44d1a5ab5bcbe4b0851bd3 (patch)
tree452b37816d160cadd92aaa65f9f990ba9fb6fa09 /drivers/mtd/nand/nand_base.c
parent19b54a701811220221fc4d5089a2bb18892018ca (diff)
downloadu-boot-imx-6f2ffc3da2b794c3ee44d1a5ab5bcbe4b0851bd3.zip
u-boot-imx-6f2ffc3da2b794c3ee44d1a5ab5bcbe4b0851bd3.tar.gz
u-boot-imx-6f2ffc3da2b794c3ee44d1a5ab5bcbe4b0851bd3.tar.bz2
NAND: add more watchdog resets
Poke the watchdog in a variety of looping constructs, which could take a long time to complete. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 70c0593..b9bd394 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1156,6 +1156,8 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
oob = ops->oobbuf;
while(1) {
+ WATCHDOG_RESET();
+
bytes = min(mtd->writesize - col, readlen);
aligned = (bytes == mtd->writesize);
@@ -1485,6 +1487,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
page = realpage & chip->pagemask;
while(1) {
+ WATCHDOG_RESET();
sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
len = min(len, readlen);
@@ -1884,6 +1887,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
memset(chip->oob_poi, 0xff, mtd->oobsize);
while(1) {
+ WATCHDOG_RESET();
+
int bytes = mtd->writesize;
int cached = writelen > bytes && page != blockmask;
uint8_t *wbuf = buf;
@@ -2215,6 +2220,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
instr->state = MTD_ERASING;
while (len) {
+ WATCHDOG_RESET();
/*
* heck if we have a bad block, we do not erase bad blocks !
*/