summaryrefslogtreecommitdiffstats
path: root/flash_rom.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2003-02-28 17:21:38 +0000
committerRonald G. Minnich <rminnich@gmail.com>2003-02-28 17:21:38 +0000
commitd4228fdc4793c900e3f5eb0d2db0576a6f36235d (patch)
tree8b97e52b0701f641a3566e0448b699ce912e46a7 /flash_rom.c
parent4d32e789a867bbf1419fc1f4f82b1145891d4d16 (diff)
downloadast2050-flashrom-d4228fdc4793c900e3f5eb0d2db0576a6f36235d.zip
ast2050-flashrom-d4228fdc4793c900e3f5eb0d2db0576a6f36235d.tar.gz
Made the ids always print in hex less verbose verify step
Corresponding to coreboot v1 svn r752.
Diffstat (limited to 'flash_rom.c')
-rw-r--r--flash_rom.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/flash_rom.c b/flash_rom.c
index 94d4972..0ec1e04 100644
--- a/flash_rom.c
+++ b/flash_rom.c
@@ -180,7 +180,7 @@ struct flashchip * probe_flash(struct flashchip * flash)
return NULL;
}
-int verify_flash (struct flashchip * flash, char * buf)
+int verify_flash (struct flashchip * flash, char * buf, int verbose)
{
int i = 0;
int total_size = flash->total_size *1024;
@@ -188,13 +188,19 @@ int verify_flash (struct flashchip * flash, char * buf)
printf("Verifying address: ");
while (i++ < total_size) {
- printf("0x%08x", i);
+ if (verbose)
+ printf("0x%08x", i);
if (*(bios+i) != *(buf+i)) {
+ printf("FAILED\n");
return 0;
}
- printf("\b\b\b\b\b\b\b\b\b\b");
+ if (verbose)
+ printf("\b\b\b\b\b\b\b\b\b\b");
}
- printf("\n");
+ if (verbose)
+ printf("\n");
+ else
+ printf("VERIFIED\n");
return 1;
}
@@ -211,7 +217,7 @@ myusec_calibrate_delay()
struct timeval start, end;
int ok = 0;
- fprintf(stderr, "Setting up microsecond timing loop\n");
+ printf("Setting up microsecond timing loop\n");
while (! ok) {
//fprintf(stderr, "Try %d\n", count);
gettimeofday(&start, 0);
@@ -333,6 +339,6 @@ main (int argc, char * argv[])
printf("OK, calibrated, now do the deed\n");
flash->write (flash, buf);
- verify_flash (flash, buf);
+ verify_flash (flash, buf, /* verbose = */ 0);
return 0;
}
OpenPOWER on IntegriCloud