[U-Boot] [PATCH] tegra20: add assembly wrapper for lowlevel_init()

Tom Rini trini at ti.com
Wed Aug 8 21:48:36 CEST 2012


On 08/08/2012 12:44 PM, Wolfgang Denk wrote:
> Dear Allen Martin,
> 
> In message <1344448286-14144-1-git-send-email-amartin at nvidia.com> you wrote:
>> lowlevel_init() is called before stack is initialized, so it's not
>> safe to call directly into C code.  Copy this wrapper from omap that
>> saves off the ip register and sets up a temporary stack.  This fixes a
>> hang using CodeSourcery toolchain.
> ...
>> +	/*
>> +	 * Setup a temporary stack
>> +	 */
>> +	ldr	sp, =LOW_LEVEL_SRAM_STACK
>> +
>> +	/*
>> +	 * Save the old lr(passed in ip) and the current lr to stack
>> +	 */
>> +	push	{ip, lr}
> 
> Are you sure this provides a valid stack frame? I think there are more
> requirements to that...
> 
> 
> BTW: this LOW_LEVEL_SRAM_STACK is really ugly; It is completely
> undocumented, and breaks naming conventions (it should be
> CONFIG_SYS_... instead).  I know that this was not introduced by this
> patch, but it should be fixed ASAP - it's mostly TI and Tegra that use
> that...

So I've been pondering this a little too.  TI and now Tegra are the ones
that use it, but based on the bug Allen ran into it seems like any of
the armv7 platforms could hit it and perhaps we should make this more
generic and live in arch/arm/cpu/armv7/lowlevel_init.S or be part of
start.S.

-- 
Tom


More information about the U-Boot mailing list