[PATCH v2 26/42] x86: Init video in SPL if enabled

Simon Glass sjg at chromium.org
Wed Apr 19 06:02:58 CEST 2023


When video is required in SPL, set this up ready for use. Ignore any
problems since it may be that video is not actually available and we
still want to continue on to U-Boot proper in that case.

Make sure that the SPL banner is only shown once.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 arch/x86/lib/spl.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c
index 7cf14f682da1..fc25771cb1f6 100644
--- a/arch/x86/lib/spl.c
+++ b/arch/x86/lib/spl.c
@@ -15,6 +15,7 @@
 #include <malloc.h>
 #include <spl.h>
 #include <syscon.h>
+#include <vesa.h>
 #include <asm/cpu.h>
 #include <asm/cpu_common.h>
 #include <asm/fsp2/fsp_api.h>
@@ -97,7 +98,8 @@ static int x86_spl_init(void)
 		return ret;
 	}
 #endif
-	preloader_console_init();
+	if (!IS_ENABLED(CONFIG_SPL_BOARD_INIT))
+		preloader_console_init();
 #if !defined(CONFIG_TPL) && !CONFIG_IS_ENABLED(CPU)
 	ret = print_cpuinfo();
 	if (ret) {
@@ -257,4 +259,12 @@ void spl_board_init(void)
 #ifndef CONFIG_TPL
 	preloader_console_init();
 #endif
+
+	if (CONFIG_IS_ENABLED(VIDEO)) {
+		struct udevice *dev;
+
+		/* Set up PCI video in SPL if required */
+		uclass_first_device_err(UCLASS_PCI, &dev);
+		uclass_first_device_err(UCLASS_VIDEO, &dev);
+	}
 }
-- 
2.40.0.634.g4ca3ef3211-goog



More information about the U-Boot mailing list