From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Andr=c3=a9_Przywara?= Date: Fri, 17 Feb 2017 23:04:21 +0000 Subject: [U-Boot] [PATCH v1] armv8: spl: Call spl_relocate_stack_gd for ARMv8 In-Reply-To: <1487352995-2495-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1487352995-2495-1-git-send-email-philipp.tomsich@theobroma-systems.com> Message-ID: <37dcbdc9-9a12-c6f4-4df5-24438eb50862@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 17/02/17 17:36, Philipp Tomsich wrote: > 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 > --- > arch/arm/lib/crt0_64.S | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S > index 19c6a98..05a80ee 100644 > --- a/arch/arm/lib/crt0_64.S > +++ b/arch/arm/lib/crt0_64.S > @@ -105,15 +105,21 @@ ENTRY(_main) > relocation_return: > > /* > * Set up final (full) environment > */ > bl c_runtime_cpu_setup /* still call old routine */ > #endif /* !CONFIG_SPL_BUILD */ > - > +#if defined(CONFIG_SPL_BUILD) > + bl spl_relocate_stack_gd > + mov x1, sp > + adds x0, x0, xzr Wouldn't that be clearer? tst x0, x0 > + csel x0, x0, x1, ne > + mov sp, x0 > +#endif > /* TODO: For SPL, call spl_relocate_stack_gd() to alloc stack relocation */ I guess this comment can go then, right? Thanks, Andre. > > /* > * Clear BSS section > */ > ldr x0, =__bss_start /* this is auto-relocated! */ > ldr x1, =__bss_end /* this is auto-relocated! */ >