Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68670 )
Change subject: soc/intel/alderlake: [TEST] Configure EPP at exit stage BS_PAYLOAD_BOOT ......................................................................
soc/intel/alderlake: [TEST] Configure EPP at exit stage BS_PAYLOAD_BOOT
The patch configures the EPP (Energy Performance Preference) at end exit stage of BS_PAYLOAD_BOOT instead configuring as part of CPU feature programming. Existing code can't configure the EPP value beyond the 0x7F, hence configuration is moved at end.
Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com Change-Id: I2db806ed651789d58dcb01688a11a569768c3122 --- M src/soc/intel/alderlake/cpu.c 1 file changed, 40 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/68670/1
diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c index e339d6d..5dfe151 100644 --- a/src/soc/intel/alderlake/cpu.c +++ b/src/soc/intel/alderlake/cpu.c @@ -7,6 +7,7 @@ */
#include <console/console.h> +#include <bootstate.h> #include <device/pci.h> #include <device/pci_ids.h> #include <cpu/x86/mp.h> @@ -133,11 +134,6 @@ * Lake or Raptor Lake CPUs, as this results in higher uncore power. */ set_energy_perf_bias(7);
- const config_t *conf = config_of_soc(); - /* Set energy-performance preference */ - if (conf->enable_energy_perf_pref) - if (check_energy_perf_cap()) - set_energy_perf_pref(conf->energy_perf_pref_value); /* Enable Turbo */ enable_turbo();
@@ -299,3 +295,26 @@ return 0; } } + +static void set_core_epp(void *epp) +{ + set_energy_perf_pref(*(uint8_t *)epp); +} + +static void run_set_core_epp(void *unused) +{ + const config_t *conf = config_of_soc(); + + /* Set energy-performance preference */ + if (conf->enable_energy_perf_pref && check_energy_perf_cap()) { + + uint8_t energy_perf_pref_value = conf->energy_perf_pref_value; + + if (mp_run_on_all_cpus(set_core_epp, &energy_perf_pref_value) != CB_SUCCESS) { + printk(BIOS_ERR, "cpu: Failed to set core EPP\n"); + return; + } + } +} + +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_EXIT, run_set_core_epp, NULL);