From d4228fdc4793c900e3f5eb0d2db0576a6f36235d Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Fri, 28 Feb 2003 17:21:38 +0000 Subject: Made the ids always print in hex less verbose verify step Corresponding to coreboot v1 svn r752. --- flash_rom.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'flash_rom.c') 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; } -- cgit v1.1