From dcbae7772d563cf7bfc1c7b8ed5eb32e5af5c86e Mon Sep 17 00:00:00 2001 From: Devarsh Thakkar Date: Wed, 24 Jan 2024 20:33:46 +0530 Subject: board: ti: am62p: Add splash screen support Add MMC and OSPI NOR flash as storage locations for splash screen Enable video memory reservation and splash display by calling board specific routine for splash screen. Signed-off-by: Devarsh Thakkar --- board/ti/am62px/evm.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'board') diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c index 60b5606dea..23716ed99a 100644 --- a/board/ti/am62px/evm.c +++ b/board/ti/am62px/evm.c @@ -13,9 +13,34 @@ #include #include #include +#include +#include #include "../common/rtc.c" +#if CONFIG_IS_ENABLED(SPLASH_SCREEN) +static struct splash_location default_splash_locations[] = { + { + .name = "sf", + .storage = SPLASH_STORAGE_SF, + .flags = SPLASH_STORAGE_RAW, + .offset = 0x700000, + }, + { + .name = "mmc", + .storage = SPLASH_STORAGE_MMC, + .flags = SPLASH_STORAGE_FS, + .devpart = "1:1", + }, +}; + +int splash_screen_prepare(void) +{ + return splash_source_load(default_splash_locations, + ARRAY_SIZE(default_splash_locations)); +} +#endif + int board_init(void) { if (IS_ENABLED(CONFIG_BOARD_HAS_32K_RTC_CRYSTAL)) @@ -33,3 +58,31 @@ int dram_init_banksize(void) { return fdtdec_setup_memory_banksize(); } + +#if defined(CONFIG_SPL_BUILD) +static int video_setup(void) +{ + if (CONFIG_IS_ENABLED(VIDEO)) { + ulong addr; + int ret; + + addr = gd->relocaddr; + ret = video_reserve(&addr); + if (ret) + return ret; + debug("Reserving %luk for video at: %08lx\n", + ((unsigned long)gd->relocaddr - addr) >> 10, addr); + gd->relocaddr = addr; + } + + return 0; +} + +void spl_board_init(void) +{ + video_setup(); + enable_caches(); + if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP)) + splash_display(); +} +#endif -- cgit v1.2.3