From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Estevam Date: Wed, 11 Nov 2015 18:23:17 -0200 Subject: [U-Boot] [PATCH] ARM: crt0: Pass malloc base address Message-ID: <1447273397-22833-1-git-send-email-festevam@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Fabio Estevam Commit 5ba534d247d418 ("arm: Switch 32-bit ARM to using generic global_data setup") causes malloc() to fail in SPL. The reason is that the GD_MALLOC_BASE is not passed anymore. Restore the code that passes malloc base so that we can have malloc working in SPL code again. Signed-off-by: Fabio Estevam --- arch/arm/lib/crt0.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 80548eb..d620126 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -87,6 +87,10 @@ ENTRY(_main) mov sp, r0 mov r0, #0 +#if defined(CONFIG_SYS_MALLOC_F_LEN) + sub sp, sp, #CONFIG_SYS_MALLOC_F_LEN + str sp, [r9, #GD_MALLOC_BASE] +#endif bl board_init_f #if ! defined(CONFIG_SPL_BUILD) -- 1.9.1