diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-03-09 19:28:16 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-03-10 21:26:01 +0000 |
commit | 2c9821898554eb139193ab6342dd0c2221160e9c (patch) | |
tree | c88dda9e6c7d6da67acd3d86a150b2e31df4208f /src/soc/amd/stoneyridge | |
parent | 7be147dfaa2ddacbbc033e6758ca37229351110a (diff) |
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 <felix-coreboot@felixheld.de>
Change-Id: Ibc5d64c74eaabfc4b7834a34410b48f590f78a12
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73637
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/amd/stoneyridge')
-rw-r--r-- | src/soc/amd/stoneyridge/monotonic_timer.c | 5 |
1 files changed, 1 insertions, 4 deletions
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; } |