diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-10-26 00:27:09 +0100 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2020-11-13 13:17:49 +0000 |
commit | 3bd017356a7766c4884e55a28ca481c8a9110ceb (patch) | |
tree | 3d9ebcf9af8d5cbf5c3c63b25ed3bc2800baf573 /src/soc/intel/broadwell/cpu/tsc_freq.c | |
parent | a0426267e330c60aa74528a06a0e130efe2ad32f (diff) |
soc/intel/broadwell: Relocate CPU files
Change-Id: Ib2ddce78db21db9c8deac632a77ecd71eb9887c2
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46794
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/broadwell/cpu/tsc_freq.c')
-rw-r--r-- | src/soc/intel/broadwell/cpu/tsc_freq.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/soc/intel/broadwell/cpu/tsc_freq.c b/src/soc/intel/broadwell/cpu/tsc_freq.c new file mode 100644 index 0000000000..4a8a34349f --- /dev/null +++ b/src/soc/intel/broadwell/cpu/tsc_freq.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <cpu/x86/msr.h> +#include <cpu/x86/tsc.h> +#include <soc/cpu.h> +#include <soc/msr.h> + +unsigned long tsc_freq_mhz(void) +{ + msr_t platform_info; + + platform_info = rdmsr(MSR_PLATFORM_INFO); + return CPU_BCLK * ((platform_info.lo >> 8) & 0xff); +} |