forked from len0rd/rockbox
x1000: check for ECC failures in bootloader uimage reader
Update the uimage reader's bad block handling to treat an ECC uncorrectable error on the first page of the block as a bad block. Change-Id: Id3aa7a338fcc36c0e2381063b119efe41f957122
This commit is contained in:
parent
5901ac8756
commit
45e2d5d641
1 changed files with 9 additions and 0 deletions
|
|
@ -189,6 +189,15 @@ static ssize_t uimage_nand_reader(void* buf, size_t count, void* rctx)
|
|||
|
||||
while(d->page < d->end_page && read_count < count) {
|
||||
rc = nand_page_read(ndrv, d->page, ndrv->page_buf);
|
||||
|
||||
/* Ignore ECC errors on the first page of a block. This may
|
||||
* indicate a bad block. */
|
||||
if(rc == NAND_ERR_ECC_FAIL &&
|
||||
d->page % ndrv->ppb == 0 && d->offset == 0) {
|
||||
d->page += ndrv->ppb;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(rc < 0)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue