From 36b6b055bd259a6fcc2a15afc04424c8f9434f39 Mon Sep 17 00:00:00 2001 From: Dinesh Gehlot Date: Mon, 12 Dec 2022 08:48:14 +0000 Subject: [PATCH] soc/intel/meteorlake: Add ASPM setting in pcie_rp_config This change provides config for devicetree to control ASPM per port TEST=Build and Boot verified on google/rex Port of 'commit 6e52c1da4a22 ("soc/intel/{adl,common}: Add ASPM setting in pcie_rp_config)' Signed-off-by: Dinesh Gehlot Change-Id: I284bf51628193aa5f82f21fbf29c57a6ea5f9cd8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/70661 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/soc/intel/meteorlake/fsp_params.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/soc/intel/meteorlake/fsp_params.c b/src/soc/intel/meteorlake/fsp_params.c index ad6db109e4..d40779ab79 100644 --- a/src/soc/intel/meteorlake/fsp_params.c +++ b/src/soc/intel/meteorlake/fsp_params.c @@ -93,6 +93,21 @@ static int get_l1_substate_control(enum L1_substates_control ctl) return ctl - 1; } +/* + * get_aspm_control() ensures that the right UPD value is set in fsp_params. + * 0: Disable ASPM + * 1: L0s only + * 2: L1 only + * 3: L0s and L1 + * 4: Auto configuration + */ +static unsigned int get_aspm_control(enum ASPM_control ctl) +{ + if (ctl > ASPM_AUTO) + ctl = ASPM_AUTO; + return ctl; +} + __weak void mainboard_update_soc_chip_config(struct soc_intel_meteorlake_config *config) { /* Override settings per board. */ @@ -393,6 +408,8 @@ static void fill_fsps_pcie_params(FSP_S_CONFIG *s_cfg, s_cfg->PcieRpHotPlug[i] = !!(rp_cfg->flags & PCIE_RP_HOTPLUG) || CONFIG(SOC_INTEL_COMPLIANCE_TEST_MODE); s_cfg->PcieRpClkReqDetect[i] = !!(rp_cfg->flags & PCIE_RP_CLK_REQ_DETECT); + if (rp_cfg->pcie_rp_aspm) + s_cfg->PcieRpAspm[i] = get_aspm_control(rp_cfg->pcie_rp_aspm); } s_cfg->PcieComplianceTestMode = CONFIG(SOC_INTEL_COMPLIANCE_TEST_MODE); }