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 <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34729
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Nico Huber 2019-08-05 21:24:00 +02:00
parent 3e786b5546
commit 6bbabef388
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,9 @@
#include <intelblocks/pmclib.h>
#include <intelblocks/gpio.h>
#include <intelblocks/tco.h>
#include <pc80/mc146818rtc.h>
#include <soc/pm.h>
#include <stdint.h>
#include <string.h>
#include <timer.h>
#include <security/vboot/vboot_common.h>
@ -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");