summaryrefslogtreecommitdiffstats
path: root/mx29f002.c
diff options
context:
space:
mode:
Diffstat (limited to 'mx29f002.c')
-rw-r--r--mx29f002.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mx29f002.c b/mx29f002.c
index c96cc93..9d50b00 100644
--- a/mx29f002.c
+++ b/mx29f002.c
@@ -71,6 +71,10 @@ int erase_29f002(struct flashchip *flash)
chip_writeb(0x30, bios + 0x3bfff);
#endif
+ if (check_erased_range(flash, 0, flash->total_size * 1024)) {
+ fprintf(stderr, "ERASE FAILED!\n");
+ return -1;
+ }
return 0;
}
@@ -83,7 +87,10 @@ int write_29f002(struct flashchip *flash, uint8_t *buf)
chip_writeb(0xF0, bios);
programmer_delay(10);
- erase_29f002(flash);
+ if (erase_29f002(flash)) {
+ fprintf(stderr, "ERASE FAILED!\n");
+ return -1;
+ }
//*bios = 0xF0;
#if 1
printf("Programming page: ");
OpenPOWER on IntegriCloud