diff options
author | Subrata Banik <subrata.banik@intel.com> | 2017-05-02 19:35:42 +0530 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-05-16 17:43:28 +0200 |
commit | 7bde848d625d078f15a77bf7ed53613789c0daf8 (patch) | |
tree | 64d19aa3f71259e9697c587be33ecef958155fe2 /src/cpu/intel/turbo | |
parent | 7a00a63829881a099d679de13d725d94ea658ed9 (diff) | |
download | coreboot-7bde848d625d078f15a77bf7ed53613789c0daf8.tar.xz |
cpu/intel/turbo: Add option to disable turbo
disable_turbo function can be used to disable turbo mode
on each processor by settings MSR 0x1A0 bit 38.
This option will help to perform some quick test
without enabling turbo mode.
Change-Id: If3e387e16e9fa6f63cb0ffff6ab2759b447e7c5c
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/19674
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/cpu/intel/turbo')
-rw-r--r-- | src/cpu/intel/turbo/turbo.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cpu/intel/turbo/turbo.c b/src/cpu/intel/turbo/turbo.c index ac6627372b..3fae3f0bd7 100644 --- a/src/cpu/intel/turbo/turbo.c +++ b/src/cpu/intel/turbo/turbo.c @@ -106,3 +106,20 @@ void enable_turbo(void) printk(BIOS_INFO, "Turbo has been enabled\n"); } } + +/* + * Try to disable Turbo mode. + */ +void disable_turbo(void) +{ + msr_t msr; + + /* Set Turbo Disable bit in Misc Enables */ + msr = rdmsr(MSR_IA32_MISC_ENABLES); + msr.hi |= H_MISC_DISABLE_TURBO; + wrmsr(MSR_IA32_MISC_ENABLES, msr); + + /* Update cached turbo state */ + set_global_turbo_state(TURBO_UNAVAILABLE); + printk(BIOS_INFO, "Turbo has been disabled\n"); +} |