[U-Boot] Memory test post relocation

Wolfgang Denk wd at denx.de
Fri Nov 14 17:15:54 CET 2014


Dear DaveKucharczyk,

In message <1415974738890-196181.post at n7.nabble.com> you wrote:
>
> If I set CONFIG_SYS_TEXT_BASE to a low address then I can't run a memory
> test starting at the lowest address because that's where the U-Boot code
> will be. 

If U-Boot is runnign from RAM there will always be areas where U-Boot
is sitting and which cannot be tested.

> I think the best thing would be to run a memory test on the full 2GB before
> relocation happens. Is that possible? 

Not when running from RAM.  This is only possible when running from
NOR flash or from some other memory region.  Once you loaded U-Boot to
RAM, the RAM will be, well, it will be used, and you cannot test all
of it.

> I erroneously thought that was the beginning of the stack. The stack expands
> down form that address, but how much?  I don't see a global data stack size
> variable.

The stack grows downward without bounds.  There is no limit on the
stack size.

> Before, we have #define CONFIG_STACKSIZE	(128 * 1024) set in the header
> file.     

This does not do what you think it might be doing.

> Basically what is the best way to run the memory test? If I can run it
> before relocation then it would make things very simple. 

You have to make sure to use the right terms.  "Before relocation" is
only useful here for example for systems booting from NOR flash, where
"before relocation" means that you are running from flash, and the
whole RAM is actually not used by U-Boot at all.  If you boot from
NAND or SDCard or similar, you will probably load U-Boot to RAM -
either though the ROM boot loader, or through SPL - and from this
moment the RAM is used, and certain areas cannot be tested any more.

If you use SPL, and the SPL is for example running from on-chip-memory
or other kind of static memory, then you could try adding the memory
test to SPL, i. e. perform the test before loading U-Boot to RAM at
all.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can only live once, but if you do it right, once is enough.


More information about the U-Boot mailing list