aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2019-09-18 16:47:33 +0200
committerAnatolij Gustschin <agust@denx.de>2019-09-21 10:12:55 +0200
commit7600d62eafb2a0083f827a843fb277e3a561a237 (patch)
tree17666776a7342796fd828c5aef5bfd6c80b62533 /common
parentaa8c6294ed32b4fcf7a9a27526c7346325d8c928 (diff)
downloadu-boot-7600d62eafb2a0083f827a843fb277e3a561a237.zip
u-boot-7600d62eafb2a0083f827a843fb277e3a561a237.tar.gz
u-boot-7600d62eafb2a0083f827a843fb277e3a561a237.tar.bz2
splash: fix logo drawing if CONFIG_VIDEO_LOGO enabled
After mxc_ipuv3 DM_VIDEO conversion board configs with enabled CONFIG_VIDEO_LOGO do not show splash screen (previosly drawing splash screen worked via cfb_console driver with CONFIG_VIDEO_LOGO enabled). Use splash_source library for loading splash images when CONFIG_SPLASH_SOURCE is selected, otherwise prepare built-in video logo for drawing. Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'common')
-rw-r--r--common/splash.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/common/splash.c b/common/splash.c
index e15cc84..1a5db69 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -52,10 +52,41 @@ static struct splash_location default_splash_locations[] = {
},
};
+#if defined(CONFIG_DM_VIDEO) && defined(CONFIG_VIDEO_LOGO)
+
+#include <bmp_logo_data.h>
+
+static int splash_video_logo_load(void)
+{
+ char *splashimage;
+ u32 bmp_load_addr;
+
+ splashimage = env_get("splashimage");
+ if (!splashimage)
+ return -ENOENT;
+
+ bmp_load_addr = simple_strtoul(splashimage, 0, 16);
+ if (!bmp_load_addr) {
+ printf("Error: bad 'splashimage' address\n");
+ return -EFAULT;
+ }
+
+ memcpy((void *)bmp_load_addr, bmp_logo_bitmap,
+ ARRAY_SIZE(bmp_logo_bitmap));
+
+ return 0;
+}
+#else
+static inline int splash_video_logo_load(void) { return -ENOSYS; }
+#endif
+
__weak int splash_screen_prepare(void)
{
- return splash_source_load(default_splash_locations,
- ARRAY_SIZE(default_splash_locations));
+ if (CONFIG_IS_ENABLED(SPLASH_SOURCE))
+ return splash_source_load(default_splash_locations,
+ ARRAY_SIZE(default_splash_locations));
+
+ return splash_video_logo_load();
}
#ifdef CONFIG_SPLASH_SCREEN_ALIGN