[U-Boot] Memory test post relocation

Albert ARIBAUD albert.u.boot at aribaud.net
Fri Nov 14 09:20:16 CET 2014


Hello Dave,

On Thu, 13 Nov 2014 15:19:20 -0700 (MST), DaveKucharczyk
<david.kucharczyk at gmail.com> wrote:
> We have 2GB’s of RAM starting at 0x70000000 on our Freescale MX53
> based board. 
> 
> With old U-Boot we defined TEXT_BASE at the bottom of RAM at
> 0x70600000 and CONFIG_SKIP_RELOCATE_UBOOT, presumably so that we can
> run memory tests all the way to the top of RAM (this was brought over
> from the mx53loco board and precedes me). Why else would
> CONFIG_SKIP_RELOCATE_UBOOT be set? 

CONFIG_SKIP_RELOCATE_UBOOT is not used in U-Boot nowadays [but is still
defined by target snapper9260, which means either that target is
utterly broken, or it does not actually need the option].

> In new U-Boot we are not skipping relocation. I define
> CONFIG_SYS_TEXT_BASE = 0xeff89000 so that relocation offset is
> 0x00000000.

Baaad, bad. The first time you change something in your code, your
relocation offset might change and this will make U-Boot crash and
burn in interesting ways.

Just define CONFIG_SYS_TEXT_BASE to some low address and let relocation
happen. You can find your actual relocation address in the global data
structure.

> I run with DEBUG on to doublecheck where things get setup…

(typically, builds with and without DEBUG will have differing relocation
addresses)

> I run a memory test from 0x70000000 to 0xefe88cb0, but I get a
> mismatch fail at 0xefe88aa4.
> 
> Shouldn’t I be able to run mem test all the way to the stack? I don’t
> see anything else being setup under the stack.

How do you know the lowest address used by your stack during your memory
test?

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list