Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61651 )
Change subject: soc/intel/apollolake: Add function to clear PMCON status bits ......................................................................
soc/intel/apollolake: Add function to clear PMCON status bits
This patch adds function to `clear PMCON status bits` into SoC directory to align with other IA coreboot implementation.
BUG=b:211954778 TEST=None.
Signed-off-by: Subrata Banik subratabanik@google.com Change-Id: I982f669b13f25d1d0e6dfaec2fbf50d3200f74fe --- M src/soc/intel/apollolake/include/soc/pm.h M src/soc/intel/apollolake/pmutil.c 2 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/61651/1
diff --git a/src/soc/intel/apollolake/include/soc/pm.h b/src/soc/intel/apollolake/include/soc/pm.h index 01efaff..aec5e2c 100644 --- a/src/soc/intel/apollolake/include/soc/pm.h +++ b/src/soc/intel/apollolake/include/soc/pm.h @@ -241,4 +241,7 @@ /* STM Support */ uint16_t get_pmbase(void);
+/* Clear PMCON status bits */ +void pmc_clear_pmcon_sts(void); + #endif diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c index fbb2345..79ece4b 100644 --- a/src/soc/intel/apollolake/pmutil.c +++ b/src/soc/intel/apollolake/pmutil.c @@ -237,3 +237,17 @@ reg32 |= SLEEP_AFTER_POWER_FAIL; write32p(gen_pmcon1, reg32); } + +void pmc_clear_pmcon_sts(void) +{ + uint32_t reg_val; + uint8_t *addr; + addr = pmc_mmio_regs(); + + reg_val = read32(addr + GEN_PMCON1); + /* Clear SUS_PWR_FLR, GBL_RST_STS, HOST_RST_STS, PWR_FLR bits + * while retaining MS4V write-1-to-clear bit */ + reg_val &= ~(MS4V); + + write32((addr + GEN_PMCON1), reg_val); +}