soc/amd/commmon/gfx: 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.

With this change, SoCs implementing selective GOP init will need to
select VBOOT_MUST_REQUEST_DISPLAY in order for display_init_required()
to not assert on compilation.

BUG=b:255812886
TEST=build/boot skyrim

Change-Id: Iac7e06863764a9f21c8a50fc19050cb5a6627df2
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73046
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:50:54 -06:00 committed by Felix Held
parent 65a444572e
commit d1fb655d0d
1 changed files with 6 additions and 7 deletions

View File

@ -4,13 +4,13 @@
#include <acpi/acpigen.h>
#include <amdblocks/vbios_cache.h>
#include <boot/coreboot_tables.h>
#include <bootmode.h>
#include <bootstate.h>
#include <console/console.h>
#include <device/pci.h>
#include <fmap.h>
#include <fsp/graphics.h>
#include <security/vboot/vbios_cache_hash_tpm.h>
#include <security/vboot/vboot_common.h>
#include <soc/intel/common/vbt.h>
#include <timestamp.h>
@ -150,12 +150,11 @@ static void graphics_set_resources(struct device *const dev)
return;
timestamp_add_now(TS_OPROM_INITIALIZE);
if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid()) {
if (!vboot_recovery_mode_enabled() && !vboot_developer_mode_enabled()) {
vbios_load_from_cache();
timestamp_add_now(TS_OPROM_COPY_END);
return;
}
if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid() &&
!display_init_required()) {
vbios_load_from_cache();
timestamp_add_now(TS_OPROM_COPY_END);
return;
}
rom = pci_rom_probe(dev);
if (rom == NULL)