X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Farm%2Flib%2Fcrt0_64.S;h=a181283e0fa9008162cfad63b5ddfd9adf98ed39;hb=c1c597e8a8abfe16938ce8a1d792c703c1a6c79b;hp=ccefce0b20a4658d383c61f7981009ca6855cd0f;hpb=29c49922561676854482f2133037c16f60fcfba8;p=oweals%2Fu-boot.git diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S index ccefce0b20..a181283e0f 100644 --- a/arch/arm/lib/crt0_64.S +++ b/arch/arm/lib/crt0_64.S @@ -73,6 +73,9 @@ ENTRY(_main) ldr x0, =(CONFIG_TPL_STACK) #elif defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK) ldr x0, =(CONFIG_SPL_STACK) +#elif defined(CONFIG_SYS_INIT_SP_BSS_OFFSET) + adr x0, __bss_start + add x0, x0, #CONFIG_SYS_INIT_SP_BSS_OFFSET #else ldr x0, =(CONFIG_SYS_INIT_SP_ADDR) #endif @@ -120,8 +123,9 @@ relocation_return: #endif /* !CONFIG_SPL_BUILD */ #if defined(CONFIG_SPL_BUILD) bl spl_relocate_stack_gd /* may return NULL */ - /* set up gd here, outside any C code */ - mov x18, x0 + /* set up gd here, outside any C code, if new stack is returned */ + cmp x0, #0 + csel x18, x0, x18, ne /* * Perform 'sp = (x0 != NULL) ? x0 : sp' while working * around the constraint that conditional moves can not