aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2008-03-16 19:44:13 +0000
committerStefan Reinauer <stepan@openbios.org>2008-03-16 19:44:13 +0000
commitdd6877a46df7137854998982beaefc19c397f97d (patch)
tree9b974a27c465e0ec55c3f4ab683c7ec756179b3c /util
parent568667da20f33e8036b212fa257594d03903fe7d (diff)
check whether SST FWH chip was successfully erased on flashchip -E, too
(trivial) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3153 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r--util/flashrom/sst_fwhub.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/util/flashrom/sst_fwhub.c b/util/flashrom/sst_fwhub.c
index 0f5dd1586b..455107e01a 100644
--- a/util/flashrom/sst_fwhub.c
+++ b/util/flashrom/sst_fwhub.c
@@ -63,10 +63,19 @@ int erase_sst_fwhub(struct flashchip *flash)
{
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,15 +87,8 @@ int write_sst_fwhub(struct flashchip *flash, uint8_t *buf)
volatile uint8_t *bios = flash->virtual_memory;
// FIXME: We want block wide erase instead of ironing the whole chip
- erase_sst_fwhub(flash);
-
- // dumb check if erase was successful.
- for (i = 0; i < total_size; i++) {
- if (bios[i] != 0xff) {
- printf("ERASE FAILED!\n");
- return -1;
- }
- }
+ if (erase_sst_fwhub(flash))
+ return -1;
printf("Programming page: ");
for (i = 0; i < total_size / page_size; i++) {