toradex: common: show boot logo
authorIgor Opaniuk <igor.opaniuk@toradex.com>
Wed, 15 Jul 2020 10:31:01 +0000 (13:31 +0300)
committerStefano Babic <sbabic@denx.de>
Mon, 27 Jul 2020 12:01:32 +0000 (14:01 +0200)
Add function for showing boot logo, embed into u-boot blob.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
board/toradex/common/tdx-common.c
board/toradex/common/tdx-common.h

index afe07be..fe5295f 100644 (file)
@@ -9,6 +9,13 @@
 #include <init.h>
 #include <linux/libfdt.h>
 
+#ifdef CONFIG_DM_VIDEO
+#include <bmp_logo.h>
+#include <dm.h>
+#include <splash.h>
+#include <video.h>
+#endif
+
 #include "tdx-cfg-block.h"
 #include <asm/setup.h>
 #include "tdx-common.h"
@@ -196,3 +203,22 @@ int ft_common_board_setup(void *blob, struct bd_info *bd)
 }
 
 #endif /* CONFIG_TDX_CFG_BLOCK */
+
+#if defined(CONFIG_DM_VIDEO)
+int show_boot_logo(void)
+{
+       struct udevice *dev;
+       int ret;
+       int xpos, ypos;
+
+       splash_get_pos(&xpos, &ypos);
+
+       ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
+       if (ret)
+               return ret;
+
+       ret = video_bmp_display(dev, (ulong)bmp_logo_bitmap, xpos, ypos, true);
+
+       return ret;
+}
+#endif /* CONFIG_DM_VIDEO */
index 81375de..8020df5 100644 (file)
@@ -11,4 +11,8 @@
 
 int ft_common_board_setup(void *blob, struct bd_info *bd);
 
+#if defined(CONFIG_DM_VIDEO)
+int show_boot_logo(void);
+#endif
+
 #endif /* _TDX_COMMON_H */