[coreboot-gerrit] Change in coreboot[master]: cpu/intel/model_206ax: Add ENERGY_PERF_BIAS control

Patrick Rudolph (Code Review) gerrit at coreboot.org
Mon Nov 20 10:33:35 CET 2017


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/22532


Change subject: cpu/intel/model_206ax: Add ENERGY_PERF_BIAS control
......................................................................

cpu/intel/model_206ax: Add ENERGY_PERF_BIAS control

* Add Kconfig options to set ENGERGY_PERF_BIAS:
** Automatic
** Power-save
** Normal
** Performance

Change-Id: Id9680d8fe52ed3e30bb8b39c4906b593a9e810b4
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/cpu/intel/model_206ax/Kconfig
M src/cpu/intel/model_206ax/model_206ax_init.c
2 files changed, 46 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/22532/1

diff --git a/src/cpu/intel/model_206ax/Kconfig b/src/cpu/intel/model_206ax/Kconfig
index f16b119..50ed9ed 100644
--- a/src/cpu/intel/model_206ax/Kconfig
+++ b/src/cpu/intel/model_206ax/Kconfig
@@ -35,4 +35,30 @@
 	hex
 	default 0x800000
 
+choice
+	prompt "Default Energy Perf Bias"
+	default CPU_ENGERGY_PERF_BIAS_AUTO
+
+config CPU_ENGERGY_PERF_BIAS_AUTO
+	bool "Automatic selection"
+	help
+	  Let coreboot decide what to do.
+
+config CPU_ENGERGY_PERF_BIAS_POWERSAVE
+	bool "Power-save"
+	help
+	  Select for setting ENERGY_POLICY_POWERSAVE.
+
+config CPU_ENGERGY_PERF_BIAS_NORMAL
+	bool "Normal"
+	help
+	  Select for setting ENERGY_POLICY_NORMAL.
+
+config CPU_ENGERGY_PERF_BIAS_PERFORMANCE
+	bool "Performance"
+	help
+	  Select for setting ENERGY_POLICY_PERFORMANCE.
+
+endchoice
+
 endif
diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c
index 1385fd6..96b8dc4 100644
--- a/src/cpu/intel/model_206ax/model_206ax_init.c
+++ b/src/cpu/intel/model_206ax/model_206ax_init.c
@@ -501,6 +501,7 @@
 static void model_206ax_init(struct device *cpu)
 {
 	char processor_name[49];
+	u8 perf_bias;
 
 	/* Turn on caching if we haven't already */
 	x86_enable_cache();
@@ -544,7 +545,25 @@
 	configure_dca_cap();
 
 	/* Set energy policy */
-	set_energy_perf_bias(ENERGY_POLICY_NORMAL);
+	if (IS_ENABLED(CONFIG_CPU_ENGERGY_PERF_BIAS_AUTO)) {
+		switch (get_platform_id()) {
+		case 4:
+			perf_bias = ENERGY_POLICY_POWERSAVE;
+			break;
+		case 7:
+			perf_bias = ENERGY_POLICY_PERFORMANCE;
+			break;
+		default:
+			perf_bias = ENERGY_POLICY_NORMAL;
+		}
+	} else if (IS_ENABLED(CPU_ENGERGY_PERF_BIAS_POWERSAVE)) {
+		perf_bias = ENERGY_POLICY_POWERSAVE;
+	} else if (IS_ENABLED(CPU_ENGERGY_PERF_BIAS_NORMAL)) {
+		perf_bias = ENERGY_POLICY_NORMAL;
+	} else {
+		perf_bias = ENERGY_POLICY_PERFORMANCE;
+	}
+	set_energy_perf_bias(perf_bias);
 
 	/* Set Max Ratio */
 	set_max_ratio();

-- 
To view, visit https://review.coreboot.org/22532
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9680d8fe52ed3e30bb8b39c4906b593a9e810b4
Gerrit-Change-Number: 22532
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171120/c0ef7cc2/attachment.html>


More information about the coreboot-gerrit mailing list