[coreboot] r3569 - trunk/util/flashrom

svn at coreboot.org svn at coreboot.org
Sun Sep 7 05:14:27 CEST 2008


Author: stuge
Date: 2008-09-07 05:14:27 +0200 (Sun, 07 Sep 2008)
New Revision: 3569

Modified:
   trunk/util/flashrom/udelay.c
Log:
flashrom: Debug print actual time base calculated by myusec_calibrate_delay()

Signed-off-by: Peter Stuge <peter at stuge.se>
Acked-by: Peter Stuge <peter at stuge.se>


Modified: trunk/util/flashrom/udelay.c
===================================================================
--- trunk/util/flashrom/udelay.c	2008-09-05 21:23:02 UTC (rev 3568)
+++ trunk/util/flashrom/udelay.c	2008-09-07 03:14:27 UTC (rev 3569)
@@ -55,6 +55,12 @@
 	// compute one microsecond. That will be count / time
 	micro = count / timeusec;
 
-	printf_debug("%ldM loops per second. ", (unsigned long)micro);
+	gettimeofday(&start, 0);
+	myusec_delay(100);
+	gettimeofday(&end, 0);
+	timeusec = 1000000 * (end.tv_sec - start.tv_sec) +
+	    (end.tv_usec - start.tv_usec);
+	printf_debug("%ldM loops per second, 100 myus = %ld us. ",
+	    (unsigned long)micro, timeusec);
 	printf("OK.\n");
 }





More information about the coreboot mailing list