summaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/pmutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/apollolake/pmutil.c')
-rw-r--r--src/soc/intel/apollolake/pmutil.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c
index b799d0253e..1ed90c1519 100644
--- a/src/soc/intel/apollolake/pmutil.c
+++ b/src/soc/intel/apollolake/pmutil.c
@@ -223,15 +223,16 @@ 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)
{
- const uintptr_t gen_pmcon1 = soc_read_pmc_base() + GEN_PMCON1;
- uint32_t reg32;
+ uint8_t reg8;
+ uint8_t *const pmcbase = pmc_mmio_regs();
- reg32 = read32p(gen_pmcon1);
+ reg8 = read8(pmcbase + GEN_PMCON_A);
if (on)
- reg32 &= ~SLEEP_AFTER_POWER_FAIL;
+ reg8 &= ~SLEEP_AFTER_POWER_FAIL;
else
- reg32 |= SLEEP_AFTER_POWER_FAIL;
- write32p(gen_pmcon1, reg32);
+ reg8 |= SLEEP_AFTER_POWER_FAIL;
+ write8(pmcbase + GEN_PMCON_A, reg8);
}