diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2006-11-07 13:48:46 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2006-11-07 13:48:46 +0000 |
commit | f7980d8941ac80ce3aba5f42c5c1371c2c53e370 (patch) | |
tree | e8162cd1352976fb68189d3578be07374ad39103 | |
parent | c65113cec7c628ab55f71114db5b13b2f2967db4 (diff) |
Instead of checking the first byte only, the whole part is checked now. This
will detect any improper erase, closes #31
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2494 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | util/flashrom/sst_fwhub.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/util/flashrom/sst_fwhub.c b/util/flashrom/sst_fwhub.c index e835a1ab09..8b62e7fae7 100644 --- a/util/flashrom/sst_fwhub.c +++ b/util/flashrom/sst_fwhub.c @@ -95,14 +95,17 @@ int write_sst_fwhub(struct flashchip *flash, uint8_t *buf) flash->page_size; volatile uint8_t *bios = flash->virt_addr; - // Do we want block wide erase? + // FIXME: We want block wide erase instead of ironing the whole chip erase_sst_fwhub(flash); - // FIXME: This test is not sufficient! - if (*bios != 0xff) { - printf("ERASE FAILED\n"); - return -1; + // dumb check if erase was successful. + for (i=0; i < total_size; i++) { + if (bios[i] != 0xff) { + printf("ERASE FAILED\n"); + return -1; + } } + printf("Programming Page: "); for (i = 0; i < total_size / page_size; i++) { printf("%04d at address: 0x%08x", i, i * page_size); |