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>
diff --git a/src/soc/amd/mendocino/Kconfig b/src/soc/amd/mendocino/Kconfig
index 6fc73de..6300c03 100644
--- a/src/soc/amd/mendocino/Kconfig
+++ b/src/soc/amd/mendocino/Kconfig
@@ -83,6 +83,7 @@
 	select USE_FSP_NOTIFY_PHASE_READY_TO_BOOT
 	select USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE
 	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 X86_AMD_FIXED_MTRRS
 	select X86_INIT_NEED_1_SIPI
diff --git a/src/soc/amd/mendocino/fsp_s_params.c b/src/soc/amd/mendocino/fsp_s_params.c
index 6551e20..ce450e8 100644
--- a/src/soc/amd/mendocino/fsp_s_params.c
+++ b/src/soc/amd/mendocino/fsp_s_params.c
@@ -5,20 +5,20 @@
 #include <acpi/acpi.h>
 #include <amdblocks/apob_cache.h>
 #include <amdblocks/vbios_cache.h>
+#include <bootmode.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;
-		}
+	if (CONFIG(USE_SELECTIVE_GOP_INIT) && vbios_cache_is_valid() &&
+			!display_init_required()) {
+		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;