[U-Boot] kirkwood: CONFIG_SYS_INIT_SP_ADDR wrong?

Heiko Schocher hs at denx.de
Wed Nov 10 16:40:40 CET 2010


Hello Daniel,

Daniel Hobi wrote:
> On 10.11.2010 16:02, Heiko Schocher wrote:
>> Daniel Hobi wrote:
>>> Reading your patch, I noticed that we don't align the early stack
>>> pointer to an 8-byte boundary which may lead to the problem described here:
>>>
>>> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/69342
>> This article is from 2009-10-06 06:44:22 GMT (1 year, 5 weeks, 2 hours and 15 minutes ago)
>>
>>> Since you seem to be the author of the relevant assembly code, could you
>>> please prepare a fix (adding "bic sp, sp, #7")?
>> We do this, since relocation is introduced, now here:
>>
>> [link to arch/arm/lib/board.c]
> 
> Yes, I know.
> 
> But you also added assembly code to setup the initial stack pointer in
> arch/arm/cpu/*/start.S (ie commit ab86f72c for arm926ejf) which reads:
> 
> /* Set stackpointer in internal RAM to call board_init_f */
> call_board_init_f:
> 	ldr	sp, =(CONFIG_SYS_INIT_SP_ADDR)
> 
> CONFIG_SYS_INIT_SP_ADDR may not be aligned properly, especially with
> your latest patch to km_arm.h:
> 
> #define CONFIG_SYS_INIT_SP_ADDR	(0xC8012000 - GENERATED_GBL_DATA_SIZE)

Ah, good catch.

Then we should add this alignment into the generation of
GENERATED_GBL_DATA_SIZE.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list