[U-Boot] [PATCH 1/2] mx51evk: support new relocation scheme

Heiko Schocher hs at denx.de
Tue Oct 26 10:39:13 CEST 2010


Hello Shawn,

Shawn Guo wrote:
> Hi Heiko,
> 
> On Tue, Oct 26, 2010 at 4:25 PM, Heiko Schocher <hs at denx.de> wrote:
>> Hello Stefano,
>>
>> Stefano Babic wrote:
>>> On 10/26/2010 10:05 AM, Shawn Guo wrote:
>>>> Hi Stefano,
>>>>
>>>> On Tue, Oct 26, 2010 at 3:59 PM, Stefano Babic <sbabic at denx.de> wrote:
>>>>> On 10/25/2010 05:14 PM, Shawn Guo wrote:
>>>>>
>>>>>> +#define CONFIG_SYS_SDRAM_BASE        PHYS_SDRAM_1
>>>>>> +#define CONFIG_SYS_INIT_SP_ADDR      (IRAM_BASE_ADDR + 0x1000)
>>>>> What is the meaning of the offset at 0x1000 ? Is there something at
>>>>> IRAM_BASE_ADDR ?
>>>>>
>>>> I thought CONFIG_SYS_INIT_SP_ADDR is assigned to stack pointer (sp)
>>>> which decrease the address.  Is it not the case?
>>>>
>>> Yes, my doubt is due to the fact that we do not set the SP at the end of
>>> the IRAM and we set it to an arbitrary address in between.
>> We should set the CONFIG_SYS_INIT_SP_ADDR @ (IRAM_BASE_ADDR + IRAM_BASE_SIZE
>> - CONFIG_SYS_GBL_DATA_SIZE)
>>
> Since u-boot is running in external memory, shouldn't
> CONFIG_SYS_GBL_DATA_SIZE be using the external memory space other than
> IRAM?

U-Boot uses only before relocation the sp @CONFIG_SYS_INIT_SP_ADDR.
This is for example for boards, which boots from NOR flash, and they
have no working RAM before relocation. So Stackpointer should be setup
in some none SDRAM. After relocation, Stackpointer is setup in SDRAM,
and CONFIG_SYS_INIT_SP_ADDR is not longer used.

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