[coreboot-gerrit] Patch set updated for coreboot: x86/cpu/tsc: Allow use of monotonic_timer_get in early boot stages

Andrey Petrov (andrey.petrov@intel.com) gerrit at coreboot.org
Sat Apr 9 00:51:53 CEST 2016


Andrey Petrov (andrey.petrov at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14297

-gerrit

commit e0ce80be00560f8187b5f050be3f0f4f8e169842
Author: Andrey Petrov <andrey.petrov at intel.com>
Date:   Fri Apr 8 14:29:54 2016 -0700

    x86/cpu/tsc: Allow use of monotonic_timer_get in early boot stages
    
    This change allows using of monotonic_timer_get() in pre-ram stages
    by storing variables in CAR memory.
    
    Change-Id: I2253960fd7f5da1f6b06af289911c08441b6c74c
    Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
 src/cpu/x86/tsc/delay_tsc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/cpu/x86/tsc/delay_tsc.c b/src/cpu/x86/tsc/delay_tsc.c
index 0ad5d3b..2147ecb 100644
--- a/src/cpu/x86/tsc/delay_tsc.c
+++ b/src/cpu/x86/tsc/delay_tsc.c
@@ -1,3 +1,4 @@
+#include <arch/early_variables.h>
 #include <console/console.h>
 #include <arch/io.h>
 #include <cpu/x86/msr.h>
@@ -6,9 +7,10 @@
 #include <delay.h>
 #include <thread.h>
 
-#if !defined(__PRE_RAM__)
+#if !defined(__ROMCC__)
+static unsigned long clocks_per_usec CAR_GLOBAL;
 
-static unsigned long clocks_per_usec;
+#if !defined(__PRE_RAM__)
 
 #if CONFIG_TSC_CONSTANT_RATE
 static unsigned long calibrate_tsc(void)
@@ -188,9 +190,7 @@ void udelay(unsigned us)
 	}
 }
 
-#if CONFIG_TSC_MONOTONIC_TIMER && !defined(__PRE_RAM__)
-#include <timer.h>
-
+#if IS_ENABLED(CONFIG_TSC_MONOTONIC_TIMER)
 static struct monotonic_counter {
 	int initialized;
 	struct mono_time time;
@@ -223,4 +223,5 @@ void timer_monotonic_get(struct mono_time *mt)
 	/* Save result. */
 	*mt = mono_counter.time;
 }
-#endif
+#endif /*IS_ENABLED(CONFIG_TSC_MONOTONIC_TIMER) */
+#endif /* !defined(__ROMCC__) */



More information about the coreboot-gerrit mailing list