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>
This commit is contained in:
		@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user