coreboot-kgpe-d16/src
Subrata Banik ea0c91fdc9 soc/intel/elkhartlake: Fix incorrect `prev_sleep_state` issue
The patch fixes indication of incorrect `prev_sleep_state` on the next
boot after global reset trigger. The existing code misses an important check about `if PCH doesn't set the WAK_STS` while checking power
failure. As a result, every early warm/global reset is considered
as power failure after looking into the PMC MMIO CON-A register
alone (as ignoring the ACPI PM_CTRL.WAK_STS bit).

As per the code comment this code logic is expected to check the power
failure reason if PCH doesn't set the WAK_STS while waking from G3
state.

Without this patch:

Observation: Resuming after a warm reset is considered as
`prev_sleep_state 5` although the SLP_TYP is zero and WAK_STS bit
is set.

    pm1_sts: 8100 pm1_en: 0000 pm1_cnt: 00000000
    GEN_PMCON: d1215238 00002200
    ....
    prev_sleep_state 5

With this patch:

Observation: Resuming after a warm reset is considered as
`prev_sleep_state 0`. It matches with the SLP_TYP is zero and
WAK_STS bit is set.

    pm1_sts: 8100 pm1_en: 0000 pm1_cnt: 00000000
    GEN_PMCON: d1215238 00002200
    ....
    prev_sleep_state 0


Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: Ib43d3402f94f47dc576fb99a6b2a7acf6f0af220
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71982
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-18 11:51:37 +00:00
..
acpi tree/acpi: Replace constant "Zero" with actual number 2022-12-27 09:06:47 +00:00
arch treewide: stop calling custom TPM log "TCPA" 2023-01-11 16:00:55 +00:00
commonlib commonlib/storage: Add common eMMC functions 2023-01-16 00:33:11 +00:00
console lib: Hook up libhwbase in romstage 2022-12-17 20:51:38 +00:00
cpu treewide: Remove unused <cpu/amd/msr.h> 2023-01-09 21:17:08 +00:00
device device/Kconfig: Fix selection of software connection manager 2023-01-11 16:53:59 +00:00
drivers treewide: Fix old-style declarations 2023-01-17 04:23:49 +00:00
ec ec/google/chromeec: Add retimer flag for mux device 2023-01-11 16:37:38 +00:00
include treewide: stop calling custom TPM log "TCPA" 2023-01-11 16:00:55 +00:00
lib treewide: stop calling custom TPM log "TCPA" 2023-01-11 16:00:55 +00:00
mainboard mb/google/skyrim: Set winterhold SPI fast read speed to 100MHz 2023-01-17 15:02:21 +00:00
northbridge nb/intel/haswell: Specify supported memory type 2023-01-05 05:32:47 +00:00
sbom src/sbom/Makefile.inc: Remove quotes on CONFIG_SBOM_ paths 2023-01-11 18:58:25 +00:00
security security/vboot: Check RW_NVRAM at buildtime 2023-01-13 08:25:33 +00:00
soc soc/intel/elkhartlake: Fix incorrect `prev_sleep_state` issue 2023-01-18 11:51:37 +00:00
southbridge treewide: Remove unused <cpu/x86/smm.h> 2023-01-12 05:07:30 +00:00
superio {superio,ec}/acpi: Replace constant "Zero" with actual number 2022-12-27 09:06:29 +00:00
vendorcode treewide: Fix old-style declarations 2023-01-17 04:23:49 +00:00
Kconfig Kconfig: Add option to compress ramstage with LZ4 2023-01-08 01:20:15 +00:00