| 1 |
|
| 2 |
|
| 3 |
#include <amdblocks/cpu.h> |
| 4 |
#include <cpu/x86/msr.h> |
| 5 |
#include <cpu/amd/msr.h> |
| 6 |
#include <cpu/x86/tsc.h> |
| 7 |
#include <console/console.h> |
| 8 |
#include <soc/pci_devs.h> |
| 9 |
#include <soc/msr.h> |
| 10 |
#include <device/pci_ops.h> |
| 11 |
|
| 12 |
unsigned long tsc_freq_mhz(void) |
| 13 |
{ |
| 14 |
union pstate_msr pstate_reg; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
pstate_reg.raw = rdmsr(PSTATE_MSR(get_pstate_0_reg())).raw; |
| 23 |
if (!pstate_reg.pstate_en) |
| 24 |
die("Unknown error: cannot determine P-state 0\n"); |
| 25 |
|
| 26 |
return get_pstate_core_freq(pstate_reg); |
| 27 |
} |