summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarsha B R <harsha.b.r@intel.com>2022-07-25 17:24:37 +0530
committerPaul Fagerburg <pfagerburg@chromium.org>2022-07-29 15:01:03 +0000
commit5754eade4a93c6fe7d1d380b15883fef9ad96225 (patch)
tree7dee4847a8eb598f315c8340e471464afb0a5b7b /src
parent59b9d96d62bff51936f64df1a4ccb506b375694c (diff)
downloadcoreboot-5754eade4a93c6fe7d1d380b15883fef9ad96225.tar.gz
coreboot-5754eade4a93c6fe7d1d380b15883fef9ad96225.tar.bz2
coreboot-5754eade4a93c6fe7d1d380b15883fef9ad96225.zip
intel/pmclib: Avoid PMC ABASE read of SLP_TYP and STATUS in ramstage
The patch updates platform_is_resuming() API such that platform resume state is determined from the saved state (CBMEM) instead of checking PMC registers (PM1_STS & PM1_CNT) as they are getting cleared (before/early) ramstage. coreboot sends DISCONNECT IPC command which times out during resume (S3) if system has servoV4 connected on port0. The issue occurs only during the first cycle of resume (S3) test cycle after cold boot due to side effect of platform_is_resuming() API that is not determining the resume (S3) state correctly in ramstage. PM1_STS and PM1_CNT register gets cleared at the start of ramstage. platform_is_resuming() function was checks the cleared register value and fails the condition of resume (S3) resulting in sending DISCONNECT IPC command. Checking the platform resume state from the CBMEM saved state using acpe_get_sleep_type() function helps cross verify the system previous state at the later part of ramstage. localhost ~ # cbmem -c | grep ERROR [ERROR] EC returned error result code 3 [ERROR] PMC IPC timeout after 1000 ms [ERROR] PMC IPC command 0x200a7 failed [ERROR] pmc_send_ipc_cmd failed [ERROR] Failed to setup port:0 to initial state [ERROR] PMC IPC timeout after 1000 ms [ERROR] PMC IPC command 0x200a7 failed [ERROR] pmc_send_ipc_cmd failed [ERROR] Failed to setup port:1 to initial state [ERROR] GENERIC: 0.0 missing read_resources [ERROR] PMC IPC timeout after 1000 ms [ERROR] PMC IPC command 0xd0 failed [ERROR] PMC: Failed sending PCI Enumeration Done Command BUG=b:227289581 TEST=Verified system boots to OS and verified below tests on Redrix (ADL-P) and Nivviks (ADL-N) 1. coreboot doesn't send the DISCONNECT during S3 resume 2. suspend S3 passes with both suzyq and servoV4 connected 3. After S3 resume, system detects the pen drive with Superspeed 4. After system resumes from S3, hot-plug the pen drive, system detects the pen drive Signed-off-by: Harsha B R <harsha.b.r@intel.com> Change-Id: I353ab49073bc4b5288943e19a75efa04bd809227 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66126 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Reviewed-by: Krishna P Bhat D <krishna.p.bhat.d@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/common/block/pmc/pmclib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c
index 1662451a185a..ea365d06d144 100644
--- a/src/soc/intel/common/block/pmc/pmclib.c
+++ b/src/soc/intel/common/block/pmc/pmclib.c
@@ -475,6 +475,11 @@ void pmc_global_reset_enable(bool enable)
int platform_is_resuming(void)
{
+ /* Read power state from PMC data structure */
+ if (ENV_RAMSTAGE)
+ return acpi_get_sleep_type() == ACPI_S3;
+
+ /* Read power state from PMC ABASE */
if (!(inw(ACPI_BASE_ADDRESS + PM1_STS) & WAK_STS))
return 0;