soc/amd/mendocino: Generalize check for selective GOP init

Rather than explicitly checking for Recovery or Developer mode via
vboot, use display_init_required() so that vboot is not required, and
other instances where the display is needed pre-OS (such as when
applying a critical system update) are covered as well.

Select VBOOT_MUST_REQUEST_DISPLAY in order for display_init_required()
to function properly (and not assert on compilation).

BUG=b:255812886
TEST=build/boot skyrim

Change-Id: If2fee71bcc11468fd2db0abaafe4ea35e2953993
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73047
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
This commit is contained in:
Matt DeVillier 2023-02-16 09:57:40 -06:00 committed by Felix Held
parent 3271ea513d
commit 65a444572e
2 changed files with 8 additions and 7 deletions

View File

@ -83,6 +83,7 @@ config SOC_AMD_REMBRANDT_BASE
select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT
select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE
select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK select VBOOT_DEFINE_WIDEVINE_COUNTERS if VBOOT_STARTS_BEFORE_BOOTBLOCK
select VBOOT_MUST_REQUEST_DISPLAY if VBOOT
select VBOOT_X86_SHA256_ACCELERATION if VBOOT select VBOOT_X86_SHA256_ACCELERATION if VBOOT
select X86_AMD_FIXED_MTRRS select X86_AMD_FIXED_MTRRS
select X86_INIT_NEED_1_SIPI select X86_INIT_NEED_1_SIPI

View File

@ -5,20 +5,20 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <amdblocks/apob_cache.h> #include <amdblocks/apob_cache.h>
#include <amdblocks/vbios_cache.h> #include <amdblocks/vbios_cache.h>
#include <bootmode.h>
#include <console/console.h> #include <console/console.h>
#include <device/pci.h> #include <device/pci.h>
#include <fsp/api.h> #include <fsp/api.h>
#include <program_loading.h> #include <program_loading.h>
#include <security/vboot/vboot_common.h>
static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg) static void fsp_assign_vbios_upds(FSP_S_CONFIG *scfg)
{ {
if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid()) { if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid() &&
if (!vboot_recovery_mode_enabled() && !vboot_developer_mode_enabled()) { !display_init_required()) {
scfg->vbios_buffer = 0; scfg->vbios_buffer = 0;
printk(BIOS_SPEW, "%s: using VBIOS cache; skipping GOP driver.\n", __func__); printk(BIOS_SPEW, "%s: using VBIOS cache; skipping GOP driver.\n", __func__);
return; return;
}
} }
printk(BIOS_SPEW, "%s: not using VBIOS cache; running GOP driver.\n", __func__); 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; scfg->vbios_buffer = CONFIG(RUN_FSP_GOP) ? PCI_VGA_RAM_IMAGE_START : 0;