[U-Boot] [PATCH] davinci: spl: Create board_init_f for explicit initialization

Sekhar Nori nsekhar at ti.com
Tue May 21 12:52:36 UTC 2019


On 21/05/19 1:05 AM, Adam Ford wrote:
> The arch_cpu_init() and preloader_console_init() functions
> were not getting called until board_init_r() as part of the
> spl_board_init() functions.  This patch explicitly moves these
> initialization sequences earlier in startup, and now clears BSS
> per the suggested workflow in the README. This also means that
> CONFIG_SPL_BOARD_INIT can be removed from the defconfig
> 
> Suggested-by: Sekhar Nori <nsekhar at ti.com>
> Signed-off-by: Adam Ford <aford173 at gmail.com>
> 
> diff --git a/arch/arm/mach-davinci/spl.c b/arch/arm/mach-davinci/spl.c
> index 103639e347..05c78f1801 100644
> --- a/arch/arm/mach-davinci/spl.c
> +++ b/arch/arm/mach-davinci/spl.c
> @@ -37,6 +37,33 @@ void spl_board_init(void)
>  	preloader_console_init();
>  }
>  
> +void board_init_f(ulong boot_flags)
> +{
> +	gd->flags = boot_flags;
> +	gd->have_console = 0;
> +
> +	if (!(gd->flags & GD_FLG_SPL_INIT)) {
> +		if (spl_init())
> +			hang();
> +	}
> +
> +	arch_cpu_init();
> +
> +	board_early_init_f();
> +
> +	/* setup GP timer */
> +	timer_init();
> +
> +	/* UART clocks enabled and gd valid - init serial console */
> +	preloader_console_init();
> +
> +	/* Clear the BSS. */
> +	memset(__bss_start, 0, __bss_end - __bss_start);
> +
> +	/* load/boot image from boot device */
> +	board_init_r(NULL, 0);
> +}

This seems incorrect. board_init_r() is already called by
arch/arm/lib/crt0.S. A much simple fix should do. I was able to get back
to working on this today. Will send a patch soon.

Thanks,
Sekhar


More information about the U-Boot mailing list