From 1fb4a7409b0288ce349e0c359783f24df269d36b Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Tue, 7 Oct 2025 10:29:09 -0700 Subject: [PATCH] soc/intel/pantherlake: Add VR power state current thresholds This commit introduces support for configuring power state current thresholds (PS1, PS2, PS3) for each Voltage Regulator (VR) domain in the Panther Lake SoC. The thresholds allow platform integrators to specify current thresholds (in 1/4 A increments, 0-128 A) for each VR domain and power state. A value of 0 indicates AUTO (use default). Change-Id: If4d473901c8de02b3d6cef44f5481a1864f14d63 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/89450 Tested-by: build bot (Jenkins) Reviewed-by: Cliff Huang --- src/soc/intel/pantherlake/chip.h | 14 ++++++++++++++ src/soc/intel/pantherlake/romstage/fsp_params.c | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/src/soc/intel/pantherlake/chip.h b/src/soc/intel/pantherlake/chip.h index 1b6b0aecb3..bfd307553b 100644 --- a/src/soc/intel/pantherlake/chip.h +++ b/src/soc/intel/pantherlake/chip.h @@ -457,6 +457,20 @@ struct soc_intel_pantherlake_config { */ uint16_t icc_max[MAX_PTL_SKUS][NUM_VR_DOMAINS]; + /* + * Power State Current Thresholds for VR Domains. + * + * These arrays define the current thresholds for different power states (PS1, + * PS2, PS3) for each Voltage Regulator (VR) domain. + * + * Each value is defined in 1/4 A increments. For example, a value of 400 + * corresponds to 100A. The valid range is 0-512 (0-128A). A value of 0 + * indicates AUTO (use default). + */ + uint16_t ps1_threshold[NUM_VR_DOMAINS]; + uint16_t ps2_threshold[NUM_VR_DOMAINS]; + uint16_t ps3_threshold[NUM_VR_DOMAINS]; + /* * SerialIO device mode selection: * PchSerialIoDisabled, diff --git a/src/soc/intel/pantherlake/romstage/fsp_params.c b/src/soc/intel/pantherlake/romstage/fsp_params.c index c0dd691836..04cd86d7a1 100644 --- a/src/soc/intel/pantherlake/romstage/fsp_params.c +++ b/src/soc/intel/pantherlake/romstage/fsp_params.c @@ -357,6 +357,15 @@ static void fill_fspm_vr_config_params(FSP_M_CONFIG *m_cfg, m_cfg->TdcMode[i] = config->tdc_mode[i]; m_cfg->TdcTimeWindow[i] = config->tdc_time_window_ms[i]; } + + for (size_t i = 0; i < ARRAY_SIZE(config->ps1_threshold); i++) { + if (config->ps1_threshold[i]) + m_cfg->Ps1Threshold[i] = config->ps1_threshold[i]; + if (config->ps2_threshold[i]) + m_cfg->Ps2Threshold[i] = config->ps2_threshold[i]; + if (config->ps3_threshold[i]) + m_cfg->Ps3Threshold[i] = config->ps3_threshold[i]; + } } #if CONFIG(PLATFORM_HAS_EARLY_LOW_BATTERY_INDICATOR)