
On Tue, 10 Nov 2015 19:30:47 +0100, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
board_init_f_mem() alters the C runtime environment's stack it ls actually already using. This is not a valid C runtime environment.
Split board_init_f_mem into C functions which do not alter their own stack and therefore run in a valid C runtime environment.
Additional note: tested with current u-boot/master (commit cad04990) on an OpenRD-Client board (which builds Thumb-1 code) using gcc 5.2.1 (which saves and restores r9 in just about any C function, causing arch_setup_gd to fail setting GD):
- without this patch, the board fails to boot with an undefined instruction exception.
- with this patch, the board boots and functions normally (at least dhcp, tftp, go are working as expected).
Amicalement,