armv8: spl: Call spl_relocate_stack_gd for ARMv8
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.
Signed-off-by Philipp Tomsich <[email protected]>
Reviewed-by Andre Przywara <[email protected]>
Reviewed-by Simon Glass <[email protected]>
--- arch/arm/lib/crt0_64.S | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
arch/arm/lib/crt0_64.S +12 -2
@@ -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
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.Signed-off-by Philipp Tomsich <[email protected]>Reviewed-by Andre Przywara <[email protected]>Reviewed-by Simon Glass <[email protected]>
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>