[U-Boot] [PATCH v2 1/2] arm: move C runtime setup code in crt0.S

Albert ARIBAUD albert.u.boot at aribaud.net
Sat Nov 10 17:53:03 CET 2012


Reviewing myself:

On Sun,  4 Nov 2012 12:32:04 +0100, Albert ARIBAUD
<albert.u.boot at aribaud.net> wrote:

> diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
> new file mode 100644
> index 0000000..fd6bd92
> --- /dev/null
> +++ b/arch/arm/lib/crt0.S

> +clbss_l:cmp	r0, r1			/* while not at end of BSS */
> +	strlo	r2, [r0]		/* clear 32-bit BSS word */
> +	addlo	r0, r0, #4		/* move to next

Unclosed comment here. This causes the following code to be ignored:

> +	bhs	clbss_l
> +
> +#ifdef CONFIG_SPL_BUILD
> +
> +	bl coloured_LED_init
> +	bl red_led_on
> +
> +#endif
> +
> +	/* call board_init_r(gd_t *id, ulong dest_addr) */

Which might explain why SPL builds did not complain about LED calls and
why some boards failed.

Also:

> +#if defined(CONFIG_NAND_SPL)
> +	ldr     pc, _nand_boot
> +
> +#elif ! defined(CONFIG_SPL_BUILD)
> +
> +	/* setup parameters for board_init_r */
> +	mov	r0, r8			/* gd_t */
> +	ldr	r1, [r8, #GD_RELOCADDR]	/* dest_addr */
> +	/* call board_init_r */
> +	ldr	pc, _board_init_r	/* this is auto-relocated! */
> +
> +#endif

The #elif is wrong, as it causes CONFIG_SPL_BUILD builds to not call
board_init_f() at all; actually, they overrun into whatever follows.
This might have been what Sughosh (Cc:) hit with the hawkboard.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list