From 99356386a6e4f976c0070723611fd9f7a286ba3e Mon Sep 17 00:00:00 2001 From: MAULIK V VAGHELA Date: Thu, 3 Mar 2022 13:07:57 +0530 Subject: [PATCH] soc/intel/alderlake: Allow mainboard to configure c1-state auto-demotion FSP has a parameter to enable/disable c1-state autodemotion feature. Boards/Baseboard can choose to use this feature as per requirement. This patch hooks up this parameter to devicetree BUG=b:221876248 BRANCH=firmware-brya-14505.B TEST=Check code compiles and correct value has been passed to FSP. Change-Id: I2d7839d8fecd7b5403f52f3926d1d0bc06728ed9 Signed-off-by: Maulik V Vaghela Reviewed-on: https://review.coreboot.org/c/coreboot/+/62629 Tested-by: build bot (Jenkins) Reviewed-by: Nick Vaccaro --- src/soc/intel/alderlake/chip.h | 6 ++++++ src/soc/intel/alderlake/fsp_params.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/soc/intel/alderlake/chip.h b/src/soc/intel/alderlake/chip.h index e7e2f20805..a69e6455ee 100644 --- a/src/soc/intel/alderlake/chip.h +++ b/src/soc/intel/alderlake/chip.h @@ -560,6 +560,12 @@ struct soc_intel_alderlake_config { /* Energy-Performance Preference (HWP feature) */ bool enable_energy_perf_pref; uint8_t energy_perf_pref_value; + + /* + * Enable or Disable C1 Cstate Demotion. + * Default 0. Set this to 1 in order to disable C state demotion. + */ + bool disable_c1_state_auto_demotion; }; typedef struct soc_intel_alderlake_config config_t; diff --git a/src/soc/intel/alderlake/fsp_params.c b/src/soc/intel/alderlake/fsp_params.c index 90ecf86d05..f0e0ac2c6f 100644 --- a/src/soc/intel/alderlake/fsp_params.c +++ b/src/soc/intel/alderlake/fsp_params.c @@ -717,6 +717,8 @@ static void fill_fsps_misc_power_params(FSP_S_CONFIG *s_cfg, /* PsysPmax is in unit of 1/8 Watt */ s_cfg->PsysPmax = config->platform_pmax * 8; } + + s_cfg->C1StateAutoDemotion = !config->disable_c1_state_auto_demotion; } static void fill_fsps_irq_params(FSP_S_CONFIG *s_cfg,