From d93f7f01a6a1c6d703e3972155b09c87466bf022 Mon Sep 17 00:00:00 2001 From: Alicja Michalska Date: Tue, 13 May 2025 00:44:08 +0200 Subject: [PATCH] mb/topton/adl: Use CFR setup menu to manage options Much like ongoing CFR work, this patch adds support for configuring certain options (such as iGPU memory allocation, ASPM, S3/s0ix, VT-d) at runtime, using EDK2 payload. TEST=Build/boot/toggle coreboot+edk2 on the firewall, test results by booting Linux. Change-Id: Id51e704750fd9aa4a8df72804d9205974747d708 Signed-off-by: Alicja Michalska Reviewed-on: https://review.coreboot.org/c/coreboot/+/87652 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/topton/adl/Kconfig | 1 + src/mainboard/topton/adl/Makefile.mk | 3 ++ src/mainboard/topton/adl/cfr.c | 43 ++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 src/mainboard/topton/adl/cfr.c diff --git a/src/mainboard/topton/adl/Kconfig b/src/mainboard/topton/adl/Kconfig index df8a513725..ffdfae1eee 100644 --- a/src/mainboard/topton/adl/Kconfig +++ b/src/mainboard/topton/adl/Kconfig @@ -5,6 +5,7 @@ if BOARD_TOPTON_X2F_N100 config BOARD_SPECIFIC_OPTIONS def_bool y select BOARD_ROMSIZE_KB_16384 + select DRIVERS_OPTION_CFR_ENABLED if PAYLOAD_EDK2 && SMMSTORE select FSP_TYPE_IOT select HAVE_ACPI_TABLES select HAVE_ACPI_RESUME diff --git a/src/mainboard/topton/adl/Makefile.mk b/src/mainboard/topton/adl/Makefile.mk index 62d07cd369..e419baa665 100644 --- a/src/mainboard/topton/adl/Makefile.mk +++ b/src/mainboard/topton/adl/Makefile.mk @@ -1,5 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ bootblock-y += bootblock.c + romstage-y += romstage_fsp_params.c + ramstage-y += mainboard.c +ramstage-$(CONFIG_DRIVERS_OPTION_CFR) += cfr.c diff --git a/src/mainboard/topton/adl/cfr.c b/src/mainboard/topton/adl/cfr.c new file mode 100644 index 0000000000..d7cb7ba436 --- /dev/null +++ b/src/mainboard/topton/adl/cfr.c @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +static struct sm_obj_form system = { + .ui_name = "System", + .obj_list = (const struct sm_object *[]) { + &igd_dvmt, + &igd_aperture, + &legacy_8254_timer, + &me_state, + &me_state_counter, + &pciexp_aspm, + &pciexp_clk_pm, + &pciexp_l1ss, + &pciexp_speed, + &s0ix_enable, + &vtd, + 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); +}