[U-Boot] [U-Boot, 1/5] spl: reorder the assignment of board info to global data

York Sun york.sun at nxp.com
Thu Aug 3 00:53:54 UTC 2017


On 04/18/2017 04:57 AM, B, Ravi wrote:
> From: Lokesh Vutla <lokeshvutla at ti.com>
> 
> Move the assignment of board info to global data a bit early which is
> safe,
> so that ram details can be used to enable caches.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla at ti.com>
> Signed-off-by: Ravi Babu <ravibabu at ti.com>
> Reviewed-by: Lukasz Majewski <lukma at denx.de>
> Reviewed-by: Tom Rini <trini at konsulko.com>
> ---
>   common/spl/spl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index a3e73b8..f11b370 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -322,6 +322,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>   	struct spl_image_info spl_image;
>   
>   	debug(">>spl:board_init_r()\n");
> +	gd->bd = &bdata;
>   
>   #if defined(CONFIG_SYS_SPL_MALLOC_START)
>   	mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
> @@ -383,7 +384,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>    */
>   void preloader_console_init(void)
>   {
> -	gd->bd = &bdata;
>   	gd->baudrate = CONFIG_BAUDRATE;
>   
>   	serial_init();		/* serial communications setup */
> 

Guys,

I have a crash for SPL boot on at least two platforms. Git bisect points 
to this change. I have confirmed reverting this commit fixes my crash.

I don't quite understand the change. The commit message says to move the 
assignment a bit early. However, the preloader_console_init() is called 
during board_init_f() for many boards. This change actually moves it 
much later. Do I get it backward?

York


More information about the U-Boot mailing list