From eeea6e298dc83b4a93a18c846e8e567d9beb0c1f Mon Sep 17 00:00:00 2001 From: Nikhil M Jain Date: Wed, 21 Jun 2023 16:29:52 +0530 Subject: board: ti: am62x: evm: Include necessary header files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the time of compilation evm.c gives below warning for implicit declaration of enable_caches, to mitigate this include cpu_func.h. board/ti/am62x/evm.c: In function ‘spl_board_init’: board/ti/am62x/evm.c:90:9: warning: implicit declaration of function ‘enable_caches’ [-Wimplicit-function-declaration] 90 | enable_caches(); Signed-off-by: Nikhil M Jain --- board/ti/am62x/evm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'board') diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c index 34830f445f7..f7afd4f3785 100644 --- a/board/ti/am62x/evm.c +++ b/board/ti/am62x/evm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include -- cgit v1.3.1 From 12fdacea5a6608a9b77a3437e692b9e2ff5c807c Mon Sep 17 00:00:00 2001 From: Nikhil M Jain Date: Tue, 18 Jul 2023 14:27:29 +0530 Subject: board: ti: am62x: evm: Update function calls for splash screen Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set up pagetable, initialise DRAM and enable Dcache to avoid multiple function calls. Check for CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to prevent any build failure in case video config is not defined and video related functions are called. Check for CONFIG_SPL_SPLASH_SCREEN and CONFIG_SPL_BMP before calling splash_display to avoid compilation failure. Signed-off-by: Nikhil M Jain --- arch/arm/mach-k3/am625_init.c | 1 + board/ti/am62x/evm.c | 41 +++++++++++++++-------------------------- 2 files changed, 16 insertions(+), 26 deletions(-) (limited to 'board') diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c index 787fe922955..0e5d44269eb 100644 --- a/arch/arm/mach-k3/am625_init.c +++ b/arch/arm/mach-k3/am625_init.c @@ -214,6 +214,7 @@ void board_init_f(ulong dummy) if (ret) panic("DRAM init failed: %d\n", ret); #endif + spl_enable_dcache(); } u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c index f7afd4f3785..ad939088402 100644 --- a/board/ti/am62x/evm.c +++ b/board/ti/am62x/evm.c @@ -60,42 +60,31 @@ int dram_init_banksize(void) } #if defined(CONFIG_SPL_BUILD) -#ifdef CONFIG_SPL_VIDEO_TIDSS -static int setup_dram(void) -{ - dram_init(); - dram_init_banksize(); - gd->ram_base = CFG_SYS_SDRAM_BASE; - gd->ram_top = gd->ram_base + gd->ram_size; - gd->relocaddr = gd->ram_top; - return 0; -} - static int video_setup(void) { - ulong addr; - int ret; - addr = gd->relocaddr; + 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; + } - 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; } -#endif void spl_board_init(void) { -#if defined(CONFIG_SPL_VIDEO_TIDSS) - setup_dram(); - arch_reserve_mmu(); video_setup(); enable_caches(); - splash_display(); -#endif + if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP)) + splash_display(); + } #if defined(CONFIG_K3_AM64_DDRSS) -- cgit v1.3.1