Nico Huber has submitted this change. ( 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
Setting the clamp bit allows the CPU to operate below the highest non-turbo frequency in order to obey the power limit.
Tested on ThinkPad T420 with the i7-3940XM.
Change-Id: Id0c0aedc29aca121d0fd1d8f8826089e13a026be Signed-off-by: Anastasios Koutian akoutian2@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/83270 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de --- M src/cpu/intel/model_206ax/chip.h M src/cpu/intel/model_206ax/model_206ax_init.c 2 files changed, 12 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/src/cpu/intel/model_206ax/chip.h b/src/cpu/intel/model_206ax/chip.h index f26fa61..1102cfe 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 */
unsigned int pl1_mw; /* Long-term power limit in milliwatts */ + bool pl1_clamp; /* Long-term power limit clamping limitation */ unsigned int pl2_mw; /* Short-term power limit in milliwatts */ + 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 aafb4dc..0d0e3f7 100644 --- a/src/cpu/intel/model_206ax/model_206ax_init.c +++ b/src/cpu/intel/model_206ax/model_206ax_init.c @@ -141,6 +141,10 @@ /* Set long term power limit to TDP */ limit.lo |= tdp & PKG_POWER_LIMIT_MASK; } + if (conf->pl2_clamp) { + printk(BIOS_DEBUG, "Enabling PL1 clamping limitation\n"); + 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; @@ -153,6 +157,10 @@ /* 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 */