From 319e3b4cce73c441de485e4569498f95ab114211 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 12 Oct 2017 19:38:21 +0530 Subject: soc/intel/cannonlake: Create acpi_get_sleep_type() to get previous sleep state This patch uses PMC common function to get previous sleep state using cbmem or chipset_power_state global structure. acpi_get_sleep_type is needed in PRE_RAM stage when soc selects CONFIG_EARLY_EBDA_INIT kconfig option. Change-Id: Ib9f8bdc1c682807450b6c01941b9a0927789b2d8 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/21988 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/intel/cannonlake/romstage/power_state.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/soc/intel/cannonlake/romstage/power_state.c b/src/soc/intel/cannonlake/romstage/power_state.c index 46048db75b..cd9a3bc76c 100644 --- a/src/soc/intel/cannonlake/romstage/power_state.c +++ b/src/soc/intel/cannonlake/romstage/power_state.c @@ -24,14 +24,20 @@ #include #include -static struct chipset_power_state power_state CAR_GLOBAL; +int acpi_get_sleep_type(void) +{ + struct chipset_power_state *ps; + + ps = pmc_get_power_state(); + return ps->prev_sleep_state; +} static void migrate_power_state(int is_recovery) { struct chipset_power_state *ps_cbmem; struct chipset_power_state *ps_car; - ps_car = car_get_var_ptr(&power_state); + ps_car = pmc_get_power_state(); ps_cbmem = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*ps_cbmem)); if (ps_cbmem == NULL) { -- cgit v1.2.3