summaryrefslogtreecommitdiff
path: root/src/soc/intel/tigerlake/pmutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/tigerlake/pmutil.c')
-rw-r--r--src/soc/intel/tigerlake/pmutil.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/intel/tigerlake/pmutil.c b/src/soc/intel/tigerlake/pmutil.c
index bd6a46c788..befc4fc48b 100644
--- a/src/soc/intel/tigerlake/pmutil.c
+++ b/src/soc/intel/tigerlake/pmutil.c
@@ -275,3 +275,20 @@ uint16_t get_pmbase(void)
{
return (uint16_t) ACPI_BASE_ADDRESS;
}
+
+/*
+ * Set which power state system will be after reapplying
+ * the power (from G3 State)
+ */
+void pmc_soc_set_afterg3_en(const bool on)
+{
+ uint8_t reg8;
+ uint8_t *const pmcbase = pmc_mmio_regs();
+
+ reg8 = read8(pmcbase + GEN_PMCON_A);
+ if (on)
+ reg8 &= ~SLEEP_AFTER_POWER_FAIL;
+ else
+ reg8 |= SLEEP_AFTER_POWER_FAIL;
+ write8(pmcbase + GEN_PMCON_A, reg8);
+}