[coreboot] r3153 - trunk/util/flashrom

svn at coreboot.org svn at coreboot.org
Sun Mar 16 20:44:13 CET 2008


Author: stepan
Date: 2008-03-16 20:44:13 +0100 (Sun, 16 Mar 2008)
New Revision: 3153

Modified:
   trunk/util/flashrom/sst_fwhub.c
Log:
check whether SST FWH chip was successfully erased on flashchip -E, too
(trivial)

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/util/flashrom/sst_fwhub.c
===================================================================
--- trunk/util/flashrom/sst_fwhub.c	2008-03-16 02:06:25 UTC (rev 3152)
+++ trunk/util/flashrom/sst_fwhub.c	2008-03-16 19:44:13 UTC (rev 3153)
@@ -63,10 +63,19 @@
 {
 	int i;
 	unsigned int total_size = flash->total_size * 1024;
+	volatile uint8_t *bios = flash->virtual_memory;
 
 	for (i = 0; i < total_size; i += flash->page_size)
 		erase_sst_fwhub_block(flash, i);
 
+	// dumb check if erase was successful.
+	for (i = 0; i < total_size; i++) {
+		if (bios[i] != 0xff) {
+			printf("ERASE FAILED!\n");
+			return -1;
+		}
+	}
+
 	return 0;
 }
 
@@ -78,16 +87,9 @@
 	volatile uint8_t *bios = flash->virtual_memory;
 
 	// FIXME: We want block wide erase instead of ironing the whole chip
-	erase_sst_fwhub(flash);
+	if (erase_sst_fwhub(flash))
+		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);





More information about the coreboot mailing list