From d8bf49fa20bf1bf8b94e574a651e117da21a632c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 19 Nov 2021 13:24:05 -0700 Subject: video: Support virtio devices with the splash screen This is useful for showing a logo when booting from qemu. Signed-off-by: Simon Glass --- common/splash_source.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'common/splash_source.c') diff --git a/common/splash_source.c b/common/splash_source.c index d05670f5ee..2c03cbdf92 100644 --- a/common/splash_source.c +++ b/common/splash_source.c @@ -20,6 +20,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -179,6 +180,16 @@ static inline int splash_init_sata(void) } #endif +static int splash_init_virtio(void) +{ + if (!IS_ENABLED(CONFIG_VIRTIO)) { + printf("Cannot load splash image: no virtio support\n"); + return -ENOSYS; + } else { + return virtio_init(); + } +} + #ifdef CONFIG_CMD_UBIFS static int splash_mount_ubifs(struct splash_location *location) { @@ -233,6 +244,9 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr) if (location->storage == SPLASH_STORAGE_SATA) res = splash_init_sata(); + if (location->storage == SPLASH_STORAGE_VIRTIO) + res = splash_init_virtio(); + if (location->ubivol != NULL) res = splash_mount_ubifs(location); -- cgit v1.2.3