diff options
Diffstat (limited to 'flash_rom.c')
-rw-r--r-- | flash_rom.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/flash_rom.c b/flash_rom.c index 94d4972a..0ec1e042 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; } |