[U-Boot] [PATCH 2/2] ARM: davinci: SPL: fix BSS initialization

Peter Howard pjh at northern-ridge.com.au
Tue May 21 23:39:09 UTC 2019


On Tue, 2019-05-21 at 20:39 +0530, Sekhar Nori wrote:
> U-Boot README recommends initializing SDRAM in board_init_f(). DA850
> was doing it as part of board_init_r() (through call to
> spl_board_init()
> which calls arch_cpu_init() which calls da850_ddr_setup())
> 
> This worked fine till commit 15b8c7505819 ("davinci:
> da850evm/omapl138-lcdk: Move BSS to SDRAM because SRAM is full")
> moved
> BSS to SDRAM.
> 
> Functions like mmc_initialize() called in board_init_r() assume BSS
> is
> available. Since SDRAM was not initialized when arch/arm/lib/crt0.S
> tried
> to initialize BSS to 0, BSS is not initialized correctly.
> 
> Fix this by simply calling arch_cpu_init() from board_init_f(). Since
> the
> README recommends calling preloader_console_init() from
> spl_board_init(),
> we keep it as-it-is.
> 
> Tested using MMC/SD boot on OMAP-L138 LCDK board.
> 
> Signed-off-by: Sekhar Nori <nsekhar at ti.com>

Tested-by: Peter Howard <phoward at gme.net.au>

> ---
>  arch/arm/mach-davinci/spl.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-davinci/spl.c b/arch/arm/mach-
> davinci/spl.c
> index 103639e34757..117b5ee836f8 100644
> --- a/arch/arm/mach-davinci/spl.c
> +++ b/arch/arm/mach-davinci/spl.c
> @@ -33,10 +33,14 @@ void putc(char c)
>  
>  void spl_board_init(void)
>  {
> -	arch_cpu_init();
>  	preloader_console_init();
>  }
>  
> +void board_init_f(ulong dummy)
> +{
> +	arch_cpu_init();
> +}
> +
>  u32 spl_boot_device(void)
>  {
>  	switch (davinci_syscfg_regs->bootcfg) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190522/5bd1644a/attachment.sig>


More information about the U-Boot mailing list