From 6bbabef388ba9a1c59ebc865c6d43e94000c1f14 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 5 Aug 2019 21:24:00 +0200 Subject: [PATCH] soc/intel/common: Set power-failure-state via option table Allow get_option() to override the Kconfig choice. Change-Id: Ie91b502a38d1a40a3dea3711b017b7a5b7edd2db Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/34729 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Furquan Shaikh --- src/soc/intel/common/block/pmc/pmclib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c index 7fb4d5e807..d7362b6dc4 100644 --- a/src/soc/intel/common/block/pmc/pmclib.c +++ b/src/soc/intel/common/block/pmc/pmclib.c @@ -21,7 +21,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -570,9 +572,11 @@ void pmc_gpe_init(void) void pmc_set_power_failure_state(const bool target_on) { - const int state = CONFIG_MAINBOARD_POWER_FAILURE_STATE; bool on; + uint8_t state = CONFIG_MAINBOARD_POWER_FAILURE_STATE; + get_option(&state, "power_on_after_fail"); + switch (state) { case MAINBOARD_POWER_STATE_OFF: printk(BIOS_INFO, "Set power off after power failure.\n");