mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-01 09:00:45 +09:00
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>
This commit is contained in:
parent
19b54a7018
commit
6f2ffc3da2
@ -1156,6 +1156,8 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
|
|||||||
oob = ops->oobbuf;
|
oob = ops->oobbuf;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
|
|
||||||
bytes = min(mtd->writesize - col, readlen);
|
bytes = min(mtd->writesize - col, readlen);
|
||||||
aligned = (bytes == mtd->writesize);
|
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;
|
page = realpage & chip->pagemask;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
|
sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
|
||||||
|
|
||||||
len = min(len, readlen);
|
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);
|
memset(chip->oob_poi, 0xff, mtd->oobsize);
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
|
|
||||||
int bytes = mtd->writesize;
|
int bytes = mtd->writesize;
|
||||||
int cached = writelen > bytes && page != blockmask;
|
int cached = writelen > bytes && page != blockmask;
|
||||||
uint8_t *wbuf = buf;
|
uint8_t *wbuf = buf;
|
||||||
@ -2215,6 +2220,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
|
|||||||
instr->state = MTD_ERASING;
|
instr->state = MTD_ERASING;
|
||||||
|
|
||||||
while (len) {
|
while (len) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
/*
|
/*
|
||||||
* heck if we have a bad block, we do not erase bad blocks !
|
* heck if we have a bad block, we do not erase bad blocks !
|
||||||
*/
|
*/
|
||||||
|
@ -542,6 +542,8 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
|
|||||||
|
|
||||||
pages = write_size / pagesize_oob;
|
pages = write_size / pagesize_oob;
|
||||||
for (page = 0; page < pages; page++) {
|
for (page = 0; page < pages; page++) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
|
|
||||||
ops.datbuf = p_buffer;
|
ops.datbuf = p_buffer;
|
||||||
ops.oobbuf = ops.datbuf + pagesize;
|
ops.oobbuf = ops.datbuf + pagesize;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user