Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73046 )
Change subject: soc/amd/commmon/gfx: Generalize check for selective GOP init ......................................................................
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 --- M src/soc/amd/common/block/graphics/graphics.c 1 file changed, 28 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/73046/1
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c index 70e3758..cc52053 100644 --- a/src/soc/amd/common/block/graphics/graphics.c +++ b/src/soc/amd/common/block/graphics/graphics.c @@ -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 @@ 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)