[U-Boot] [PATCH 3/5 v1] integrator: do not test first part of the memory

Linus Walleij linus.walleij at linaro.org
Mon Oct 17 13:57:32 CEST 2011


Hi Arnaud,

On Sun, Oct 16, 2011 at 5:51 PM, Albert ARIBAUD
<albert.u.boot at aribaud.net> wrote:
> Le 18/09/2011 09:52, Linus Walleij a écrit :
>>
>> When booting from Flash, the Integrator remaps its flash memory
>> from 0x24000000 to 0x00000000, and starts executing it at
>> 0x00000000. This ROM thus hides the RAM underneath and first
>> 0x40000 bytes of the memory cannot be tested by get_ram_size().
>> So let's test from 0x40000 to the end of detected memory
>> instead.
>
> Is this masking of RAM by FLASH a hardware thing that cannot be avoided?
> Can't the U-Boot startup code somehow remap the FLASH elsewhere, and then
> proceed to really test the whole RAM?

Well, it is unmapped in board_init() but that is post-RAM-test.

The reason I cannot unmapp it in dram_init() is that at this point
U-Boot is running from flash and has not relocated itself (it wants to test
RAM before relocating of course) and the flash it is running from is
exactly that which is in the way of the RAM test.

So on integrator, the flash memory remaps itself to address 0x00000000
when booting from flash, and U-Boot has text base 0x00000000 in
this case, and is running in flash relative 0x00000000.

If it would remap the flash at this point it would unmap itself,
and crash.

This way of having the flash containing U-Boot remap itself over the
system RAM seems to be uncommon, but I'd share the problem with
anyone else trying to do something similar I guess.

Yours,
Linus Walleij


More information about the U-Boot mailing list