From 5d7e2b4c0cf052a4889f071a91c420d42cb8bed0 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Mon, 21 Apr 2025 12:03:05 -0700 Subject: [PATCH] mb/google/fatcat: Disable VR settings on Panther Lake H SoC Introduce a new static function `disable_vr_settings_on_pantherlake_h()` to disable Voltage Regulator (VR) settings when a Panther Lake H System on Chip (SoC) is detected. The existing VR configurations, introduced by commit d19dd192dbe3 ("mb/google/fatcat: Add PTL-U Fast VMode Voltage Regulator settings"), are optimized for Panther Lake U SoC, which can cause performance issues on Panther Lake H boards under stress due to the I_TRIP value being lower than what the device could actually use. By disabling these settings, the Firmware Support Package (FSP) falls back to default values for the SoC, which are more suitable. TEST=Observe the "Disabling VR settings on PTL-H" log during a boot test on a Panther Lake H variant. Change-Id: Ifc371212259fa724425158ad9ebadebd30c81705 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/87403 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- src/mainboard/google/fatcat/romstage.c | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/mainboard/google/fatcat/romstage.c b/src/mainboard/google/fatcat/romstage.c index 8f0000c2ce..44a901a0ec 100644 --- a/src/mainboard/google/fatcat/romstage.c +++ b/src/mainboard/google/fatcat/romstage.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include +#include #include #include #include @@ -22,6 +23,49 @@ __weak void variant_update_soc_memory_init_params(FSPM_UPD *memupd) /* Nothing to do */ } +static bool soc_is_pantherlake_h(void) +{ + uint16_t mch_id = pci_s_read_config16(PCI_DEV(0, 0, 0), PCI_DEVICE_ID); + + if (mch_id == 0xffff) { + printk(BIOS_ERR, "No matching PCI DID present\n"); + return false; + } + + /* + * Identify Panther Lake H by testing all Memory Controller Hub (MCH) IDs utilized on fatcat + * devices. + */ + switch (mch_id) { + case PCI_DID_INTEL_PTL_H_ID_1: + case PCI_DID_INTEL_PTL_H_ID_2: + case PCI_DID_INTEL_PTL_H_ID_3: + case PCI_DID_INTEL_PTL_H_ID_4: + return true; + default: + return false; + } +} + +static void disable_vr_settings_on_pantherlake_h(FSP_M_CONFIG *m_cfg) +{ + if (!soc_is_pantherlake_h()) + return; + + /* + * The board operates a Panther Lake H SoC; disable the PTL-U VR settings. + * + * The Voltage Regulator (VR) configurations supplied by the device tree are + * specifically adjusted for a Panther Lake U SoC, which is intended for fatcat board + * designs. When these settings are applied to a board equipped with a Panther Lake H + * SoC, it may experience performance problems under high-stress conditions. This is + * because the I_TRIP value is set lower than the device's actual capability. + */ + printk(BIOS_INFO, "Disabling VR settings on PTL-H.\n"); + for (size_t i = 0; i < NUM_VR_DOMAINS; i++) + m_cfg->CepEnable[i] = false; +} + void mainboard_memory_init_params(FSPM_UPD *memupd) { const struct pad_config *pads; @@ -40,6 +84,9 @@ void mainboard_memory_init_params(FSPM_UPD *memupd) memcfg_init(memupd, mem_config, &spd_info, half_populated); + /* Override FSP-M Voltage Regulator settings on Panther Lake H. */ + disable_vr_settings_on_pantherlake_h(&memupd->FspmConfig); + /* Override FSP-M UPD per board if required. */ variant_update_soc_memory_init_params(memupd); }