From c08d804f01d88ac028c7271f0efed07373c3bc97 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 24 Mar 2023 22:07:48 +0100 Subject: soc/amd/stoneyridge/monotonic_time: add comment that we can't use TSC Due to a non-constant TSC rate before the microcode update is applied, the Performance Time Stamp Counter is used instead. To clarify this, add a comment to the timestamp_get implementation. See commit 24079323d4d8 ("soc/amd/stoneyridge: provide alternate monotonic timer") and the description of the TscInvariant bit in CPUID Fn8000_0007_EDX Advanced Power Management Information in the public version of BKDG #55072 Rev 3.09 for more details. Signed-off-by: Felix Held Change-Id: I824b372c36fa6f3eb912469b235a9474f6a58ff5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74018 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai --- src/soc/amd/stoneyridge/monotonic_timer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/soc/amd/stoneyridge/monotonic_timer.c b/src/soc/amd/stoneyridge/monotonic_timer.c index 06e0c93413..bd1e4e7aac 100644 --- a/src/soc/amd/stoneyridge/monotonic_timer.c +++ b/src/soc/amd/stoneyridge/monotonic_timer.c @@ -12,6 +12,8 @@ void timer_monotonic_get(struct mono_time *mt) mono_time_set_usecs(mt, timestamp_get()); } +/* The TSC has a non-constant rate before the microcode update is applied, so it can't be used + in timestamp_get before that. Instead, the Performance Time Stamp Counter is used. */ uint64_t timestamp_get(void) { msr_t msr; -- cgit v1.2.3