summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/timestamp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index ca25093423..21b3d29a53 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -278,6 +278,10 @@ static void timestamp_sync_cache_to_cbmem(int is_recovery)
if (ts_cbmem_table->base_time == 0)
ts_cbmem_table->base_time = ts_cache_table->base_time;
+ /* Seed the timestamp tick frequency in ramstage. */
+ if (ENV_RAMSTAGE)
+ ts_cbmem_table->tick_freq_mhz = timestamp_tick_freq_mhz();
+
/* Cache no longer required. */
ts_cache_table->num_entries = 0;
ts_cache->cache_state = TIMESTAMP_CACHE_NOT_NEEDED;
@@ -299,3 +303,9 @@ uint64_t __attribute__((weak)) timestamp_get(void)
return mono_time_diff_microseconds(&t1, &t2);
}
+
+/* Like timestamp_get() above this matches up with microsecond granularity. */
+int __attribute__((weak)) timestamp_tick_freq_mhz(void)
+{
+ return 1;
+}