From c3be703b717f2c9931b69480875cb6f3ef2e9827 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Fri, 9 May 2025 12:24:15 -0500 Subject: [PATCH] soc/intel/common/cfr: Add bool option for auto power on The tri-state power-on-after-failure options don't make sense for all boards, so add a CFR option which allows for a simple toggle for powering on after power loss Change-Id: I7624f16f74c46b7b487da00d0ff669ff4c187dd6 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/87982 Tested-by: build bot (Jenkins) Reviewed-by: Sean Rhodes --- .../common/block/include/intelblocks/cfr.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/soc/intel/common/block/include/intelblocks/cfr.h b/src/soc/intel/common/block/include/intelblocks/cfr.h index 24ddf47a65..7828e1f359 100644 --- a/src/soc/intel/common/block/include/intelblocks/cfr.h +++ b/src/soc/intel/common/block/include/intelblocks/cfr.h @@ -31,10 +31,13 @@ static const struct sm_object me_state_counter = SM_DECLARE_NUMBER({ .default_value = 0, }); -/* Power state after power loss */ +/* + * Power state after power loss + * Use this option or the one below, but not both + */ static const struct sm_object power_on_after_fail = SM_DECLARE_ENUM({ .opt_name = "power_on_after_fail", - .ui_name = "Restore AC Power Loss", + .ui_name = "Restore AC power after loss", .ui_helptext = "Specify what to do when power is re-applied after a power loss.", .default_value = CONFIG_MAINBOARD_POWER_FAILURE_STATE, .values = (const struct sm_enum_value[]) { @@ -44,6 +47,17 @@ static const struct sm_object power_on_after_fail = SM_DECLARE_ENUM({ SM_ENUM_VALUE_END }, }); +/* + * Automatic power-on toggle + * Use this option or the one above, but not both + */ +static const struct sm_object power_on_after_fail_bool = SM_DECLARE_BOOL({ + .opt_name = "power_on_after_fail", + .ui_name = "Power on after failure", + .ui_helptext = "Automatically turn on after a power failure", + .default_value = CONFIG_MAINBOARD_POWER_FAILURE_STATE, +}); + /* PCIe PCH RP ASPM */ static const struct sm_object pciexp_aspm = SM_DECLARE_ENUM({ .opt_name = "pciexp_aspm",