[coreboot-gerrit] Change in coreboot[master]: cpu/intel/turbo: Add option to disable turbo
Subrata Banik (Code Review)
gerrit at coreboot.org
Fri May 12 08:28:02 CEST 2017
Subrata Banik has uploaded a new change for review. ( https://review.coreboot.org/19674 )
Change subject: cpu/intel/turbo: Add option to disable turbo
......................................................................
cpu/intel/turbo: Add option to disable turbo
disable_turbo function use 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 at intel.com>
---
M src/cpu/intel/turbo/turbo.c
M src/include/cpu/intel/turbo.h
2 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/19674/1
diff --git a/src/cpu/intel/turbo/turbo.c b/src/cpu/intel/turbo/turbo.c
index ac66273..3fae3f0 100644
--- a/src/cpu/intel/turbo/turbo.c
+++ b/src/cpu/intel/turbo/turbo.c
@@ -106,3 +106,20 @@
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");
+}
diff --git a/src/include/cpu/intel/turbo.h b/src/include/cpu/intel/turbo.h
index 6626cb1..58f4831 100644
--- a/src/include/cpu/intel/turbo.h
+++ b/src/include/cpu/intel/turbo.h
@@ -39,4 +39,7 @@
/* Enable turbo */
void enable_turbo(void);
+/* Disable turbo */
+void disable_turbo(void);
+
#endif
--
To view, visit https://review.coreboot.org/19674
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If3e387e16e9fa6f63cb0ffff6ab2759b447e7c5c
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Subrata Banik <subrata.banik at intel.com>
More information about the coreboot-gerrit
mailing list