From 2c9821898554eb139193ab6342dd0c2221160e9c Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 9 Mar 2023 19:28:16 +0100 Subject: soc/amd/stoneyridge/monotonic_timer: use raw MSR data Since mst_t is a union of the struct containing the lower and higher 32 bits and the raw 64 bit value, there's no need to convert the lower and higher 32 bits into a 64 bit value and we can just use the 64 bit raw value. Signed-off-by: Felix Held Change-Id: Ibc5d64c74eaabfc4b7834a34410b48f590f78a12 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73637 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Fred Reitberger Reviewed-by: Eric Lai Reviewed-by: Arthur Heymans --- src/soc/amd/stoneyridge/monotonic_timer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/soc/amd') diff --git a/src/soc/amd/stoneyridge/monotonic_timer.c b/src/soc/amd/stoneyridge/monotonic_timer.c index 46bb34b7da..06e0c93413 100644 --- a/src/soc/amd/stoneyridge/monotonic_timer.c +++ b/src/soc/amd/stoneyridge/monotonic_timer.c @@ -14,12 +14,9 @@ void timer_monotonic_get(struct mono_time *mt) uint64_t timestamp_get(void) { - unsigned long long val; msr_t msr; msr = rdmsr(CU_PTSC_MSR); - val = ((unsigned long long)msr.hi << 32) | msr.lo; - - return val / PTSC_FREQ_MHZ; + return msr.raw / PTSC_FREQ_MHZ; } -- cgit v1.2.3