diff --git a/common/splash.c b/common/splash.c index e15cc847b68c0fdfc61615a87ab271582fa9098a..0bcedbb0bad9804e957916c6825c56f344504741 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 @@ -81,6 +112,42 @@ void splash_get_pos(int *x, int *y) } #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ +#if defined(CONFIG_DM_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION) + +#ifdef CONFIG_VIDEO_LOGO +#include <bmp_logo.h> +#endif +#include <dm.h> +#include <video_console.h> +#include <video_font.h> + +void splash_display_banner(void) +{ + struct udevice *dev; + char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; + int col, row, ret; + + ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &dev); + if (ret) + return; + +#ifdef CONFIG_VIDEO_LOGO + col = BMP_LOGO_WIDTH / VIDEO_FONT_WIDTH + 1; + row = BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT + 1; +#else + col = 0; + row = 0; +#endif + + display_options_get_banner(false, buf, sizeof(buf)); + vidconsole_position_cursor(dev, col, 1); + vidconsole_put_string(dev, buf); + vidconsole_position_cursor(dev, 0, row); +} +#else +static inline void splash_display_banner(void) { } +#endif /* CONFIG_DM_VIDEO && !CONFIG_HIDE_LOGO_VERSION */ + /* * Common function to show a splash image if env("splashimage") is set. * Is used for both dm_video and lcd video stacks. For additional @@ -104,6 +171,14 @@ int splash_display(void) splash_get_pos(&x, &y); - return bmp_display(addr, x, y); + ret = bmp_display(addr, x, y); + + /* Skip banner output on video console if the logo is not at 0,0 */ + if (x || y) + goto end; + + splash_display_banner(); +end: + return ret; } #endif diff --git a/configs/imx6dl_icore_nand_defconfig b/configs/imx6dl_icore_nand_defconfig index 6eb7c7ab3aa3750b621d86363fcaf6f69e7be75e..65c540275b17816f64ce75e76c998445c48d1a2b 100644 --- a/configs/imx6dl_icore_nand_defconfig +++ b/configs/imx6dl_icore_nand_defconfig @@ -27,6 +27,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -51,4 +52,5 @@ CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/imx6q_icore_nand_defconfig b/configs/imx6q_icore_nand_defconfig index fc990a8add4b4cb27be57308d1a1450d332da32e..5671b9a518d224a58a8ec75e4516560dbb56f529 100644 --- a/configs/imx6q_icore_nand_defconfig +++ b/configs/imx6q_icore_nand_defconfig @@ -28,6 +28,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -52,4 +53,5 @@ CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig index c7544c68c8d37f2d8cd5bc7c9b92be74eea01308..f7e2a7e0fbe099621239444efb10c57b47615a51 100644 --- a/configs/imx6qdl_icore_mmc_defconfig +++ b/configs/imx6qdl_icore_mmc_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -67,5 +68,6 @@ CONFIG_DEBUG_UART_MXC=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y CONFIG_IMX_WATCHDOG=y diff --git a/configs/imx6qdl_icore_nand_defconfig b/configs/imx6qdl_icore_nand_defconfig index fc990a8add4b4cb27be57308d1a1450d332da32e..5671b9a518d224a58a8ec75e4516560dbb56f529 100644 --- a/configs/imx6qdl_icore_nand_defconfig +++ b/configs/imx6qdl_icore_nand_defconfig @@ -28,6 +28,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -52,4 +53,5 @@ CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig index 516aac1f142fb57bd97ff8b30345b4c53643c4f2..aabba4de14a55c92a1abdb03df4a5df63b55e3a3 100644 --- a/configs/mx6sabreauto_defconfig +++ b/configs/mx6sabreauto_defconfig @@ -44,6 +44,7 @@ CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -90,4 +91,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index 2c88fe67c2190af2e8c5b856a1b7c066a625d9f5..a0a6f40583c6ee44045f6571bcf50b5ab6617d4b 100644 --- a/configs/mx6sabresd_defconfig +++ b/configs/mx6sabresd_defconfig @@ -47,6 +47,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y @@ -99,4 +100,5 @@ CONFIG_CI_UDC=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index f07ec5f651b9517a33eeeb8f5560aafe12c71ba2..421f80697e5d89732e2d58c56ad3fe338566dfd6 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_SATA=y CONFIG_CMD_USB=y +CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y @@ -66,4 +67,5 @@ CONFIG_DM_THERMAL=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_VIDEO=y +CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_VIDEO_IPUV3=y diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index cec23295b5cb2069437b30ee731233e69ceddb14..66a319187c291854c6dc0633e7a1bf05485a1379 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -254,7 +254,7 @@ static void sunxi_dw_hdmi_lcdc_init(int mux, const struct display_timing *edid, { struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; - int div = clock_get_pll3() / edid->pixelclock.typ; + int div = DIV_ROUND_UP(clock_get_pll3(), edid->pixelclock.typ); struct sunxi_lcdc_reg *lcdc; if (mux == 0) { diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h index 4eceb10e8fc21bbf619e2b6d0481434bc79473c0..c3bc3943f40d56b0ae557abd71c1c23d7d8114e8 100644 --- a/include/configs/apalis_imx6.h +++ b/include/configs/apalis_imx6.h @@ -213,6 +213,7 @@ "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ "source ${loadaddr}\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "vidargs=mxc_hdmi.only_cea=1 " \ "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 " \ "video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off " \ diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h index aee9f2f1d074f57ea713bcc5d3dabbbb7893bf68..fa4dc498f58d86aac2ed95b4d7853b4086f3d4d6 100644 --- a/include/configs/colibri_imx6.h +++ b/include/configs/colibri_imx6.h @@ -195,6 +195,7 @@ "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ "source ${loadaddr}\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "vidargs=video=mxcfb0:dev=lcd,640x480M@60,if=RGB666 " \ "video=mxcfb1:off fbmem=8M\0 " diff --git a/include/configs/imx6-engicam.h b/include/configs/imx6-engicam.h index 56b3c7503eb6121dfcd7f2b63577c08da40810aa..0826195f4838c80476bcfa185db278d10cc0fa88 100644 --- a/include/configs/imx6-engicam.h +++ b/include/configs/imx6-engicam.h @@ -37,6 +37,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "image=uImage\0" \ "fit_image=fit.itb\0" \ "fdt_high=0xffffffff\0" \ diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index c137612b01c3aab550e5f4f06e453a395083888a..d704cda2a6c908c232012d0a8d7ad87340b12f99 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -62,6 +62,7 @@ "dfu_alt_info=spl raw 0x400\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ "mmcpart=1\0" \ "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index bdcd5e9db3fd49e6fadcf554611017104a4f0ac5..8faf5f0f789d6e58a356eb213743b33c708bed50 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -61,6 +61,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "console=ttymxc0\0" \ "splashpos=m,m\0" \ + "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ "fdtfile=undefined\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \