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 <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70899
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Matt DeVillier 2022-12-16 17:25:01 -06:00 committed by Felix Held
parent 1fbc1123d7
commit bcb67ed3c5
1 changed files with 11 additions and 0 deletions

View File

@ -4,12 +4,23 @@
#include <acpi/acpi.h>
#include <amdblocks/apob_cache.h>
#include <amdblocks/vbios_cache.h>
#include <console/console.h>
#include <device/pci.h>
#include <fsp/api.h>
#include <program_loading.h>
#include <security/vboot/vboot_common.h>
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;
}