]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: Support virtio devices with the splash screen
authorSimon Glass <sjg@chromium.org>
Fri, 19 Nov 2021 20:24:05 +0000 (13:24 -0700)
committerAnatolij Gustschin <agust@denx.de>
Sun, 26 Dec 2021 22:33:24 +0000 (23:33 +0100)
This is useful for showing a logo when booting from qemu.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/splash_source.c
include/splash.h
include/virtio.h

index d05670f5ee8768f1a04ce18a1502e18e41265b7e..2c03cbdf928b30ba35f806a0f17239394542d029 100644 (file)
@@ -20,6 +20,7 @@
 #include <spi_flash.h>
 #include <splash.h>
 #include <usb.h>
+#include <virtio.h>
 #include <asm/global_data.h>
 
 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);
 
index 7fd2de8fea1dd582f5b6f9e936d86b764bde6ec4..33e45e6941632dcbc93c663d53de6d18426b41b7 100644 (file)
@@ -30,6 +30,7 @@ enum splash_storage {
        SPLASH_STORAGE_MMC,
        SPLASH_STORAGE_USB,
        SPLASH_STORAGE_SATA,
+       SPLASH_STORAGE_VIRTIO,
 };
 
 enum splash_flags {
index a42bdad6b871799fe1aa8b03668ad3c88221d36c..34e2bfdcdd38083053121639e3e2ac443c526fe7 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __VIRTIO_H__
 #define __VIRTIO_H__
 
+#include <virtio_types.h>
 #include <linux/bitops.h>
 #include <linux/bug.h>
 #define VIRTIO_ID_NET          1 /* virtio net */