From a3caa2d3bbe791c39af2b56ae6f94ec83c4e09e2 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 24 Mar 2019 14:59:45 +0100 Subject: sb/intel/lynxpoint: Use SOUTHBRIDGE_INTEL_COMMON_PMCLIB Use common code to detect ACPI S3. Untested. Change-Id: I87ac56e4ba1fb83761786d5f32a0fc308ee9718a Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/32039 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/southbridge/intel/lynxpoint/early_pch.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/southbridge/intel/lynxpoint/early_pch.c') diff --git a/src/southbridge/intel/lynxpoint/early_pch.c b/src/southbridge/intel/lynxpoint/early_pch.c index 994021c6b0..3d2d2c48fa 100644 --- a/src/southbridge/intel/lynxpoint/early_pch.c +++ b/src/southbridge/intel/lynxpoint/early_pch.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "pch.h" #include "chip.h" @@ -67,26 +68,6 @@ static void pch_generic_setup(void) printk(BIOS_DEBUG, " done.\n"); } -static int sleep_type_s3(void) -{ - u32 pm1_cnt; - u16 pm1_sts; - int is_s3 = 0; - - /* Check PM1_STS[15] to see if we are waking from Sx */ - pm1_sts = inw(DEFAULT_PMBASE + PM1_STS); - if (pm1_sts & WAK_STS) { - /* Read PM1_CNT[12:10] to determine which Sx state */ - pm1_cnt = inl(DEFAULT_PMBASE + PM1_CNT); - if (((pm1_cnt >> 10) & 7) == SLP_TYP_S3) { - /* Clear SLP_TYPE. */ - outl(pm1_cnt & ~(7 << 10), DEFAULT_PMBASE + PM1_CNT); - is_s3 = 1; - } - } - return is_s3; -} - void pch_enable_lpc(void) { const struct device *dev = pcidev_on_root(0x1f, 0); @@ -148,7 +129,7 @@ int early_pch_init(const void *gpio_map, /* Mainboard RCBA settings */ pch_config_rcba(rcba_config); - wake_from_s3 = sleep_type_s3(); + wake_from_s3 = southbridge_detect_s3_resume(); #if CONFIG(ELOG_BOOT_COUNT) if (!wake_from_s3) -- cgit v1.2.3