Anastasios Koutian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83270?usp=email )
Change subject: cpu/intel/model_206ax: Allow package power limit clamping ......................................................................
cpu/intel/model_206ax: Allow package power limit clamping
Tested on ThinkPad T420 with the i7-3940XM.
Change-Id: Id0c0aedc29aca121d0fd1d8f8826089e13a026be Signed-off-by: Anastasios Koutian akoutian2@gmail.com --- M src/cpu/intel/model_206ax/chip.h M src/cpu/intel/model_206ax/model_206ax_init.c 2 files changed, 13 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/83270/1
diff --git a/src/cpu/intel/model_206ax/chip.h b/src/cpu/intel/model_206ax/chip.h index e20dd1a..aa4c0ef 100644 --- a/src/cpu/intel/model_206ax/chip.h +++ b/src/cpu/intel/model_206ax/chip.h @@ -3,6 +3,8 @@ #ifndef __CPU_INTEL_MODEL_206AX_CHIP_H__ #define __CPU_INTEL_MODEL_206AX_CHIP_H__
+#include "stdbool.h" + /* Keep this in sync with acpi.c */ enum cpu_acpi_level { CPU_ACPI_DISABLED = 0, @@ -44,7 +46,9 @@ int tcc_offset; /* TCC Activation Offset */
int pl1; /* Long-term power limit*/ + bool pl1_clamp; /* Long-term power limit clamping limitation */ int pl2; /* Short-term power limit*/ + bool pl2_clamp; /* Short-term power limit clamping limitation */
int pp0_current_limit; /* Primary Plane Current Limit (Icc) in Amps */ int pp1_current_limit; /* Secondary Plane Current Limit (IAXG) in Amps */ diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c index f4eefa3..dd71d0f 100644 --- a/src/cpu/intel/model_206ax/model_206ax_init.c +++ b/src/cpu/intel/model_206ax/model_206ax_init.c @@ -141,18 +141,26 @@ /* Set long term power limit to TDP */ limit.lo |= tdp & PKG_POWER_LIMIT_MASK; } + if(conf->pl2_clamp) { + printk(BIOS_DEBUG, "%s: Enabling PL1 clamping limitation\n", dev_path(dev)); + limit.lo |= PKG_POWER_LIMIT_CLAMP; + } limit.lo |= PKG_POWER_LIMIT_EN; limit.lo |= (power_limit_1_val & PKG_POWER_LIMIT_TIME_MASK) << PKG_POWER_LIMIT_TIME_SHIFT;
limit.hi = 0; if(conf->pl2){ - printk(BIOS_DEBUG, "%s: setting PL2 to %u microwatts\n", dev_path(dev), conf->pl2); + printk(BIOS_DEBUG, "%s: Enabling PL2 clamping limitation\n", dev_path(dev)); limit.hi |= ((conf->pl2 * power_unit) / 1000000) & PKG_POWER_LIMIT_MASK; } else { /* Set short term power limit to 1.25 * TDP */ limit.hi |= ((tdp * 125) / 100) & PKG_POWER_LIMIT_MASK; } + if(conf->pl2_clamp) { + printk(BIOS_DEBUG, "Enabling PL2 clamping limitation\n"); + limit.hi |= PKG_POWER_LIMIT_CLAMP; + } limit.hi |= PKG_POWER_LIMIT_EN; /* Power limit 2 time is only programmable on SNB EP/EX */