summaryrefslogtreecommitdiffstats
path: root/bootloader/x1000/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/x1000/utils.c')
-rw-r--r--bootloader/x1000/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bootloader/x1000/utils.c b/bootloader/x1000/utils.c
index 46624b0d1d..a1d90dedbb 100644
--- a/bootloader/x1000/utils.c
+++ b/bootloader/x1000/utils.c
@@ -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;