summaryrefslogtreecommitdiffstats
path: root/src/soc/amd/stoneyridge/southbridge.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-04-13 19:56:10 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-04-14 18:46:48 +0000
commitc0538d46130fe091c3e544eeb6fba7ffb5fc38f0 (patch)
tree2fe72924b5ecb0a47c2ab05d7fe8e613c1fd0508 /src/soc/amd/stoneyridge/southbridge.c
parentbbb8c042e4ee01cf55d9e19ecedc1bb0d65bf4b7 (diff)
downloadcoreboot-c0538d46130fe091c3e544eeb6fba7ffb5fc38f0.tar.gz
coreboot-c0538d46130fe091c3e544eeb6fba7ffb5fc38f0.tar.bz2
coreboot-c0538d46130fe091c3e544eeb6fba7ffb5fc38f0.zip
soc/amd/stoneyridge: use common pm_set_power_failure_state functionality
The functionality to restore the previous power state after power was lost that could previously be enabled by selecting MAINBOARD_POWER_RESTORE in the mainboard's Kconfig can now be achieved by selecting POWER_STATE_PREVIOUS_AFTER_FAILURE in the mainboard's Kconfig instead. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I49c4a44ca2c4fa937a823c4eddf1618739c15114 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52303 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/stoneyridge/southbridge.c')
-rw-r--r--src/soc/amd/stoneyridge/southbridge.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/soc/amd/stoneyridge/southbridge.c b/src/soc/amd/stoneyridge/southbridge.c
index 28310ce70905..b7d7b5e48651 100644
--- a/src/soc/amd/stoneyridge/southbridge.c
+++ b/src/soc/amd/stoneyridge/southbridge.c
@@ -17,6 +17,7 @@
#include <amdblocks/acpimmio.h>
#include <amdblocks/lpc.h>
#include <amdblocks/acpi.h>
+#include <amdblocks/pmlib.h>
#include <amdblocks/smbus.h>
#include <amdblocks/smi.h>
#include <soc/southbridge.h>
@@ -353,6 +354,7 @@ void bootblock_fch_early_init(void)
/* After console init */
void bootblock_fch_init(void)
{
+ pm_set_power_failure_state();
fch_print_pmxc0_status();
}
@@ -453,12 +455,6 @@ static void set_sb_gnvs(struct global_nvs *gnvs)
void fch_final(void *chip_info)
{
- uint8_t restored_power = PM_S5_AT_POWER_RECOVERY;
-
- if (CONFIG(MAINBOARD_POWER_RESTORE))
- restored_power = PM_RESTORE_S0_IF_PREV_S0;
- pm_write8(PM_RTC_SHADOW, restored_power);
-
struct global_nvs *gnvs = acpi_get_gnvs();
if (gnvs) {
set_sb_aoac(&gnvs->aoac);