Commit e60fd351 authored by Stefan Reinauer's avatar Stefan Reinauer Committed by Stefan Reinauer
Browse files

Instead of checking the first byte only, the whole part is checked now


This

Corresponding to flashrom svn r71 and coreboot v2 svn r2494.

will detect any improper erase, closes #31
Signed-off-by: default avatarStefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de> 
parent 987942dc
......@@ -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) {
// 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment