Skip to contentSkip to conversation

armv8: spl: Call spl_relocate_stack_gd for ARMv8

PATCH New Philipp Tomsich 2 participants 2 messages Mar 1, 2017 – Mar 3, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 armv8: spl: Call spl_relocate_stack_gd for ARMv8

As part of the startup process for boards using the SPL, we need to call spl_relocate_stack_gd. This is needed to set up malloc with its DRAM buffer.

---
 arch/arm/lib/crt0_64.S | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
arch/arm/lib/crt0_64.S +12 -2
index 19c6a98..57e728f 100644
@@ -109,8 +109,18 @@ relocation_return:
  */
 	bl	c_runtime_cpu_setup		/* still call old routine */
 #endif /* !CONFIG_SPL_BUILD */
-
-/* TODO: For SPL, call spl_relocate_stack_gd() to alloc stack relocation */
+#if defined(CONFIG_SPL_BUILD)
+	bl	spl_relocate_stack_gd           /* may return NULL */
+	/*
+	 * Perform 'sp = (x0 != NULL) ? x0 : sp' while working
+	 * around the constraint that conditional moves can not
+	 * have 'sp' as an operand
+	 */
+	mov	x1, sp
+	cmp	x0, #0
+	csel	x0, x0, x1, ne
+	mov	sp, x0
+#endif
 
 /*
  * Clear BSS section
Signature · 1 line
1.9.1
#1 lore raw

PATCH v4 1/1 armv8: spl: Call spl_relocate_stack_gd for ARMv8

Quoted 7 lines · Philipp Tomsich

As part of the startup process for boards using the SPL, we need to call spl_relocate_stack_gd. This is needed to set up malloc with its DRAM buffer.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170303/b3d725d8/attachment.sig>