[coreboot-gerrit] Change in coreboot[master]: cpu/intel/turbo: Add option to disable turbo

Martin Roth (Code Review) gerrit at coreboot.org
Tue May 16 17:43:30 CEST 2017


Martin Roth has submitted this change and it was merged. ( 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 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 at intel.com>
Reviewed-on: https://review.coreboot.org/19674
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
M src/cpu/intel/turbo/turbo.c
M src/include/cpu/intel/turbo.h
2 files changed, 20 insertions(+), 0 deletions(-)

Approvals:
  Aaron Durbin: Looks good to me, approved
  build bot (Jenkins): Verified



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: merged
Gerrit-Change-Id: If3e387e16e9fa6f63cb0ffff6ab2759b447e7c5c
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan at intel.com>
Gerrit-Reviewer: Barnali Sarkar <barnali.sarkar at intel.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie at chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi at intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma at intel.com>



More information about the coreboot-gerrit mailing list