soc/intel: Move pmc_soc_set_afterg3_en() to pmutil.c

Commit 2c26108208 moved this function to
pmutil.c for Tiger Lake. Do this to all other platforms for consistency.
For Skylake, __SIMPLE_DEVICE__ preprocessor guards are no longer needed.

With this change, pmc.c is only needed in ramstage. Adjust Makefile.inc
accordingly, and drop ENV_RAMSTAGE guards from Skylake.

Change-Id: I424eb359c898f155659d085b888410b6bb58b9ed
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52464
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
This commit is contained in:
Angel Pons
2021-04-17 13:02:37 +02:00
committed by Patrick Georgi
parent f643b63c4d
commit 505e383ccb
18 changed files with 98 additions and 112 deletions

View File

@ -224,3 +224,16 @@ uint16_t get_pmbase(void)
{
return (uint16_t) ACPI_BASE_ADDRESS;
}
void pmc_soc_set_afterg3_en(const bool on)
{
void *const gen_pmcon1 = (void *)(soc_read_pmc_base() + GEN_PMCON1);
uint32_t reg32;
reg32 = read32(gen_pmcon1);
if (on)
reg32 &= ~SLEEP_AFTER_POWER_FAIL;
else
reg32 |= SLEEP_AFTER_POWER_FAIL;
write32(gen_pmcon1, reg32);
}