aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/intel/haswell/haswell_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/intel/haswell/haswell_init.c')
-rw-r--r--src/cpu/intel/haswell/haswell_init.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c
index 369ace9b45..dd1970c033 100644
--- a/src/cpu/intel/haswell/haswell_init.c
+++ b/src/cpu/intel/haswell/haswell_init.c
@@ -249,8 +249,17 @@ static u32 pcode_mailbox_read(u32 command)
static void initialize_vr_config(void)
{
+ struct cpu_vr_config vr_config = { 0 };
msr_t msr;
+ const struct device *lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC);
+
+ if (lapic && lapic->chip_info) {
+ const struct cpu_intel_haswell_config *conf = lapic->chip_info;
+
+ vr_config = conf->vr_config;
+ }
+
printk(BIOS_DEBUG, "Initializing VR config.\n");
/* Configure VR_CURRENT_CONFIG. */
@@ -280,13 +289,23 @@ static void initialize_vr_config(void)
msr.hi &= ~(1 << (51 - 32));
/* Enable decay mode on C-state entry. */
msr.hi |= (1 << (52 - 32));
+ /* Set the slow ramp rate */
if (haswell_is_ult()) {
- /* Set the slow ramp rate to be fast ramp rate / 4 */
msr.hi &= ~(0x3 << (53 - 32));
- msr.hi |= (0x01 << (53 - 32));
+ /* Configure the C-state exit ramp rate. */
+ if (vr_config.slow_ramp_rate_enable) {
+ /* Configured slow ramp rate. */
+ msr.hi |= ((vr_config.slow_ramp_rate_set & 0x3) << (53 - 32));
+ /* Set exit ramp rate to slow. */
+ msr.hi &= ~(1 << (50 - 32));
+ } else {
+ /* Fast ramp rate / 4. */
+ msr.hi |= (1 << (53 - 32));
+ }
}
/* Set MIN_VID (31:24) to allow CPU to have full control. */
msr.lo &= ~0xff000000;
+ msr.lo |= (vr_config.cpu_min_vid & 0xff) << 24;
wrmsr(MSR_VR_MISC_CONFIG, msr);
/* Configure VR_MISC_CONFIG2 MSR. */