From d1fb655d0dbf4feb0117c02bcc4c4817c02118b1 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 16 Feb 2023 09:50:54 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73046 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/amd/common/block/graphics/graphics.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/soc/amd/common/block/graphics/graphics.c') diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c index 70e3758b08..cc52053104 100644 --- a/src/soc/amd/common/block/graphics/graphics.c +++ b/src/soc/amd/common/block/graphics/graphics.c @@ -4,13 +4,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include @@ -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) -- cgit v1.2.3