[PATCH 22/23] x86: coreboot: Support getting a logo from virtio

Simon Glass sjg at chromium.org
Fri Nov 19 21:24:06 CET 2021


Enable this feature so that a splash screen can be provided.

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

 board/coreboot/coreboot/coreboot.c | 20 ++++++++++++++++++--
 include/configs/coreboot.h         |  3 +++
 include/configs/x86-common.h       |  6 +++++-
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/board/coreboot/coreboot/coreboot.c b/board/coreboot/coreboot/coreboot.c
index 11294d6e870..3b90ae75386 100644
--- a/board/coreboot/coreboot/coreboot.c
+++ b/board/coreboot/coreboot/coreboot.c
@@ -4,10 +4,11 @@
  */
 
 #include <common.h>
-#include <asm/cb_sysinfo.h>
-#include <asm/global_data.h>
+#include <splash.h>
 #include <init.h>
 #include <smbios.h>
+#include <asm/cb_sysinfo.h>
+#include <asm/global_data.h>
 
 int board_early_init_r(void)
 {
@@ -65,3 +66,18 @@ fallback:
 	return checkboard();
 }
 #endif
+
+static struct splash_location coreboot_splash_locations[] = {
+	{
+		.name = "virtio_fs",
+		.storage = SPLASH_STORAGE_VIRTIO,
+		.flags = SPLASH_STORAGE_RAW,
+		.devpart = "0",
+	},
+};
+
+int splash_screen_prepare(void)
+{
+	return splash_source_load(coreboot_splash_locations,
+				  ARRAY_SIZE(coreboot_splash_locations));
+}
diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
index 1cf5c037e85..d6d679fd7dd 100644
--- a/include/configs/coreboot.h
+++ b/include/configs/coreboot.h
@@ -10,6 +10,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define SPLASH_SETTINGS "splashsource=virtio_fs\0" \
+	"splashimage=0x1000000\0"
+
 #include <configs/x86-common.h>
 
 #define CONFIG_SYS_MONITOR_LEN		(1 << 20)
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 486b5ca7765..2d280d5df60 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -88,9 +88,14 @@
 #define DISTRO_BOOTENV
 #endif
 
+#ifndef SPLASH_SETTINGS
+#define SPLASH_SETTINGS
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS			\
 	DISTRO_BOOTENV					\
 	CONFIG_STD_DEVICES_SETTINGS			\
+	SPLASH_SETTINGS					\
 	"pciconfighost=1\0"				\
 	"netdev=eth0\0"					\
 	"consoledev=ttyS0\0"				\
@@ -100,7 +105,6 @@
 	"ramdisk_addr_r=0x4000000\0"			\
 	"ramdiskfile=initramfs.gz\0"
 
-
 #define RAMBOOTCOMMAND				\
 	"setenv bootargs root=/dev/ram rw "		\
 	"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
-- 
2.34.0.rc2.393.gf8c9666880-goog



More information about the U-Boot mailing list