summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2017-10-12 19:38:21 +0530
committerAaron Durbin <adurbin@chromium.org>2017-10-18 01:10:37 +0000
commit319e3b4cce73c441de485e4569498f95ab114211 (patch)
tree9ed11e7e8dd0c920167ea65c9903a04d0dc65e86
parentc1ca65df3f3d4d98820f9431a2e41b446928d8dd (diff)
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 <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/21988 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/soc/intel/cannonlake/romstage/power_state.c10
1 files changed, 8 insertions, 2 deletions
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 <soc/pci_devs.h>
#include <soc/pm.h>
-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) {