video: Support virtio devices with the splash screen

This is useful for showing a logo when booting from qemu.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2021-11-19 13:24:05 -07:00 committed by Anatolij Gustschin
parent 7a8555d871
commit d8bf49fa20
3 changed files with 16 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include <spi_flash.h> #include <spi_flash.h>
#include <splash.h> #include <splash.h>
#include <usb.h> #include <usb.h>
#include <virtio.h>
#include <asm/global_data.h> #include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
@ -179,6 +180,16 @@ static inline int splash_init_sata(void)
} }
#endif #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 #ifdef CONFIG_CMD_UBIFS
static int splash_mount_ubifs(struct splash_location *location) 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) if (location->storage == SPLASH_STORAGE_SATA)
res = splash_init_sata(); res = splash_init_sata();
if (location->storage == SPLASH_STORAGE_VIRTIO)
res = splash_init_virtio();
if (location->ubivol != NULL) if (location->ubivol != NULL)
res = splash_mount_ubifs(location); res = splash_mount_ubifs(location);

View File

@ -30,6 +30,7 @@ enum splash_storage {
SPLASH_STORAGE_MMC, SPLASH_STORAGE_MMC,
SPLASH_STORAGE_USB, SPLASH_STORAGE_USB,
SPLASH_STORAGE_SATA, SPLASH_STORAGE_SATA,
SPLASH_STORAGE_VIRTIO,
}; };
enum splash_flags { enum splash_flags {

View File

@ -20,6 +20,7 @@
#ifndef __VIRTIO_H__ #ifndef __VIRTIO_H__
#define __VIRTIO_H__ #define __VIRTIO_H__
#include <virtio_types.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/bug.h> #include <linux/bug.h>
#define VIRTIO_ID_NET 1 /* virtio net */ #define VIRTIO_ID_NET 1 /* virtio net */