All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: crt0: Pass malloc base address
@ 2015-11-11 20:23 Fabio Estevam
  2015-11-11 20:26 ` Simon Glass
  2015-11-11 20:33 ` Albert ARIBAUD
  0 siblings, 2 replies; 15+ messages in thread
From: Fabio Estevam @ 2015-11-11 20:23 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@freescale.com>

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 <fabio.estevam@freescale.com>
---
 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-11-14 15:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 20:23 [U-Boot] [PATCH] ARM: crt0: Pass malloc base address Fabio Estevam
2015-11-11 20:26 ` Simon Glass
2015-11-11 20:41   ` Fabio Estevam
2015-11-11 21:00     ` Fabio Estevam
2015-11-11 21:08       ` Simon Glass
2015-11-11 21:24         ` Fabio Estevam
2015-11-11 21:49           ` Simon Glass
2015-11-12  6:57             ` Albert ARIBAUD
2015-11-12 12:48               ` Fabio Estevam
2015-11-12 15:59               ` Simon Glass
2015-11-12 16:13                 ` Albert ARIBAUD
2015-11-14  2:12                   ` Simon Glass
2015-11-14 15:23                     ` Albert ARIBAUD
2015-11-11 20:33 ` Albert ARIBAUD
2015-11-11 20:49   ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.