Skip to content

Commit

Permalink
armv8: spl: Call spl_relocate_stack_gd for ARMv8
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Philipp Tomsich authored and trini committed Mar 2, 2017
1 parent 6b4e942 commit 7a70c99
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions arch/arm/lib/crt0_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7a70c99

Please sign in to comment.