Author: stepan Date: 2006-11-07 14:48:46 +0100 (Tue, 07 Nov 2006) New Revision: 2494
Modified: trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c Log: 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
Modified: trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c =================================================================== --- trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c 2006-11-07 11:16:21 UTC (rev 2493) +++ trunk/LinuxBIOSv2/util/flashrom/sst_fwhub.c 2006-11-07 13:48:46 UTC (rev 2494) @@ -95,14 +95,17 @@ 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);