From 445575525c4b33b813aa08aec960d8cd1279e28a Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Sun, 20 Apr 2025 14:54:59 -0500 Subject: [PATCH] mb/google/beltino: Use CFR setup menu to manage options Enable support for managing system options via CFR, and select it by default when using edk2 with SMMSTORE. TEST=build/boot panther w/edk2 payload Change-Id: Ic5dff1f046de2b477361822772dd1add64d608af Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/87561 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/google/beltino/Kconfig | 1 + src/mainboard/google/beltino/Makefile.mk | 1 + src/mainboard/google/beltino/cfr.c | 33 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/mainboard/google/beltino/cfr.c diff --git a/src/mainboard/google/beltino/Kconfig b/src/mainboard/google/beltino/Kconfig index 8bde8e6d1c..2d5c3e9637 100644 --- a/src/mainboard/google/beltino/Kconfig +++ b/src/mainboard/google/beltino/Kconfig @@ -3,6 +3,7 @@ config BOARD_GOOGLE_BASEBOARD_BELTINO def_bool n select BOARD_ROMSIZE_KB_8192 + select DRIVERS_OPTION_CFR_ENABLED if PAYLOAD_EDK2 && SMMSTORE select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select HAVE_OPTION_TABLE diff --git a/src/mainboard/google/beltino/Makefile.mk b/src/mainboard/google/beltino/Makefile.mk index 77edc30b8e..21a5825f29 100644 --- a/src/mainboard/google/beltino/Makefile.mk +++ b/src/mainboard/google/beltino/Makefile.mk @@ -14,6 +14,7 @@ romstage-y += variants/$(VARIANT_DIR)/gpio.c bootblock-y += variants/$(VARIANT_DIR)/led.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads +ramstage-$(CONFIG_DRIVERS_OPTION_CFR) += cfr.c subdirs-y += variants/$(VARIANT_DIR) CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include diff --git a/src/mainboard/google/beltino/cfr.c b/src/mainboard/google/beltino/cfr.c new file mode 100644 index 0000000000..0ff1433e57 --- /dev/null +++ b/src/mainboard/google/beltino/cfr.c @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include + +static struct sm_obj_form system = { + .ui_name = "System", + .obj_list = (const struct sm_object *[]) { + &me_disable, + &nmi, + NULL + }, +}; + +static struct sm_obj_form power = { + .ui_name = "Power", + .obj_list = (const struct sm_object *[]) { + &power_on_after_fail, + NULL + }, +}; + +static struct sm_obj_form *sm_root[] = { + &system, + &power, + NULL +}; + +void mb_cfr_setup_menu(struct lb_cfr *cfr_root) +{ + cfr_write_setup_menu(cfr_root, sm_root); +}