From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sat, 10 Nov 2012 17:53:03 +0100 Subject: [U-Boot] [PATCH v2 1/2] arm: move C runtime setup code in crt0.S In-Reply-To: <1352028725-26683-2-git-send-email-albert.u.boot@aribaud.net> References: <1352001421-25913-1-git-send-email-albert.u.boot@aribaud.net> <1352028725-26683-1-git-send-email-albert.u.boot@aribaud.net> <1352028725-26683-2-git-send-email-albert.u.boot@aribaud.net> Message-ID: <20121110175303.71bb0dc3@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Reviewing myself: On Sun, 4 Nov 2012 12:32:04 +0100, Albert ARIBAUD 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.