summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/skylake/romstage/power_state.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/soc/intel/skylake/romstage/power_state.c b/src/soc/intel/skylake/romstage/power_state.c
index 61851a587d..19f43c3a93 100644
--- a/src/soc/intel/skylake/romstage/power_state.c
+++ b/src/soc/intel/skylake/romstage/power_state.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <arch/acpi.h>
#include <arch/early_variables.h>
#include <arch/io.h>
#include <cbmem.h>
@@ -35,12 +36,17 @@
static struct chipset_power_state power_state CAR_GLOBAL;
+static struct chipset_power_state *get_power_state(void)
+{
+ return car_get_var_ptr(&power_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 = get_power_state();
ps_cbmem = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*ps_cbmem));
if (ps_cbmem == NULL) {
@@ -129,7 +135,7 @@ struct chipset_power_state *fill_power_state(void)
{
uint16_t tcobase;
uint8_t *pmc;
- struct chipset_power_state *ps = car_get_var_ptr(&power_state);
+ struct chipset_power_state *ps = get_power_state();
tcobase = smbus_tco_regs();
@@ -161,6 +167,14 @@ struct chipset_power_state *fill_power_state(void)
return ps;
}
+int acpi_get_sleep_type(void)
+{
+ struct chipset_power_state *ps;
+
+ ps = get_power_state();
+ return ps->prev_sleep_state;
+}
+
int vboot_platform_is_resuming(void)
{
return acpi_sleep_from_pm1(inl(ACPI_BASE_ADDRESS + PM1_CNT)) == ACPI_S3;