[PATCH 3/8] board: ti: am62x: evm: Update function calls for splash screen

Devarsh Thakkar devarsht at ti.com
Fri May 12 12:57:35 CEST 2023


Hi Nikhil,

Thanks for the patch.

On 11/05/23 15:29, Nikhil M Jain wrote:
> Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
> up pagetable, initialise DRAM and enable Dcache.
> 
> Signed-off-by: Nikhil M Jain <n-jain1 at ti.com>
> ---
>  arch/arm/mach-k3/am625_init.c |  1 +
>  board/ti/am62x/evm.c          | 46 ++++++++++++++---------------------
>  2 files changed, 19 insertions(+), 28 deletions(-)
> 
> diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
> index 026c4f9c02..9386d14558 100644
> --- a/arch/arm/mach-k3/am625_init.c
> +++ b/arch/arm/mach-k3/am625_init.c
> @@ -168,6 +168,7 @@ void board_init_f(ulong dummy)
>  	if (ret)
>  		panic("DRAM init failed: %d\n", ret);
>  #endif
> +	spl_enable_dcache();

I am not sure it was intentionally not called earlier.
Can you please confirm if it's also required for non-splash screen scenarios?

>  }
>  
>  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 34830f445f..f48a499059 100644
> --- a/board/ti/am62x/evm.c
> +++ b/board/ti/am62x/evm.c
> @@ -59,42 +59,32 @@ 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 (CONFIG_IS_ENABLED(VIDEO)) {

I think good to use weak functions or macros inside the body of function
instead of having them at multiple places.

Regards
Devarsh
> +		video_setup();
> +		enable_caches();
> +		if (CONFIG_IS_ENABLED(SPLASH_SCREEN))
> +			splash_display();
> +	}
>  }
>  
>  #if defined(CONFIG_K3_AM64_DDRSS)


More information about the U-Boot mailing list