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
This commit is contained in:
Stefan Reinauer 2006-11-07 13:48:46 +00:00 committed by Stefan Reinauer
parent c65113cec7
commit f7980d8941
1 changed files with 8 additions and 5 deletions

View File

@ -95,14 +95,17 @@ int write_sst_fwhub(struct flashchip *flash, uint8_t *buf)
flash->page_size; flash->page_size;
volatile uint8_t *bios = flash->virt_addr; 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); erase_sst_fwhub(flash);
// FIXME: This test is not sufficient! // dumb check if erase was successful.
if (*bios != 0xff) { for (i=0; i < total_size; i++) {
printf("ERASE FAILED\n"); if (bios[i] != 0xff) {
return -1; printf("ERASE FAILED\n");
return -1;
}
} }
printf("Programming Page: "); printf("Programming Page: ");
for (i = 0; i < total_size / page_size; i++) { for (i = 0; i < total_size / page_size; i++) {
printf("%04d at address: 0x%08x", i, i * page_size); printf("%04d at address: 0x%08x", i, i * page_size);