diff options
author | Ronald G. Minnich <rminnich@gmail.com> | 2003-02-11 16:09:12 +0000 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2003-02-11 16:09:12 +0000 |
commit | 4572a822456304c52db0091b324bb403cc4e08e7 (patch) | |
tree | 9f423c1913e204d801a9def2d1e5e36e39fd902d /flash_rom.c | |
parent | bb0322f335bb35bd804454ac136668e8c68f0e58 (diff) | |
download | ast2050-flashrom-4572a822456304c52db0091b324bb403cc4e08e7.zip ast2050-flashrom-4572a822456304c52db0091b324bb403cc4e08e7.tar.gz |
Clean up at user request
Corresponding to coreboot v1 svn r743.
Diffstat (limited to 'flash_rom.c')
-rw-r--r-- | flash_rom.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/flash_rom.c b/flash_rom.c index a4f8ca5..0f51895 100644 --- a/flash_rom.c +++ b/flash_rom.c @@ -181,7 +181,7 @@ unsigned long micro = 0; void myusec_calibrate_delay() { - unsigned long count = 2 * 1024 * 1024; + unsigned long count = 20 * 1024 * 1024; volatile unsigned long i; unsigned long timeusec; struct timeval start, end; @@ -189,7 +189,7 @@ myusec_calibrate_delay() fprintf(stderr, "Setting up microsecond timing loop\n"); while (! ok) { - fprintf(stderr, "Try %d\n", count); + //fprintf(stderr, "Try %d\n", count); gettimeofday(&start, 0); for( i = count; i; i--) ; @@ -206,7 +206,7 @@ myusec_calibrate_delay() // compute one microsecond. That will be count / time micro = count / timeusec; - fprintf(stderr, "one us is %d count\n", micro); + //fprintf(stderr, "one us is %d count\n", micro); } @@ -227,8 +227,6 @@ main (int argc, char * argv[]) FILE * image; struct flashchip * flash; - myusec_calibrate_delay(); - if (argc > 2){ printf("usage: %s [romimage]\n", argv[0]); printf(" If no romimage is specified, then all that happens\n"); @@ -255,6 +253,11 @@ main (int argc, char * argv[]) buf = (char *) calloc (size, sizeof(char)); fread (buf, sizeof(char), size, image); + printf("Calibrating timer since microsleep sucks ... takes a second\n"); + myusec_calibrate_delay(); + printf("OK, calibrated, now do the deed\n"); + flash->write (flash, buf); verify_flash (flash, buf); + return 0; } |