From bcb67ed3c51cf83716247bbe26d5477e2cbe1f84 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Fri, 16 Dec 2022 17:25:01 -0600 Subject: soc/amd/mendocino: Add support for selective GOP driver init Add support for the selective GOP init feature by only running the FSP GOP driver when necessary: if the FMAP cache is invalid, or if the board is booted in either recovery or developer mode. BUG=b:255812886 TEST=tested with rest of patch train Change-Id: I7ddadc254e05aca0fdd7a9567160a9329cb0e15c Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/70899 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- src/soc/amd/mendocino/fsp_s_params.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/soc/amd/mendocino/fsp_s_params.c b/src/soc/amd/mendocino/fsp_s_params.c index 3f7aa9f854..6551e202c7 100644 --- a/src/soc/amd/mendocino/fsp_s_params.c +++ b/src/soc/amd/mendocino/fsp_s_params.c @@ -4,12 +4,23 @@ #include #include +#include +#include #include #include #include +#include static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg) { + if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid()) { + if (!vboot_recovery_mode_enabled() && !vboot_developer_mode_enabled()) { + scfg->vbios_buffer = 0; + printk(BIOS_SPEW, "%s: using VBIOS cache; skipping GOP driver.\n", __func__); + return; + } + } + printk(BIOS_SPEW, "%s: not using VBIOS cache; running GOP driver.\n", __func__); scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0; } -- cgit v1.2.3