[U-Boot] [PATCH 12/26] ARM: add relocation support

Graeme Russ
2010-09-16T07:18:04Z

On Thu, Sep 16, 2010 at 5:06 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Alessandro Rubini,
>
> I agree that it would be nice to have U-Boot completely position-
> independent and completelky restartable, but this would be a new
> feature, which newer existed before.
>

x86 has a nice feature whereby I can build two images that differ only by
TEXT_BASE. I can build using TEXT_BASE somewhere in low memory, tftp the
image and the 'go' directly to the base address of the image

e.g.

> tftp 6000000 u-boot.bin
> go 6000000

This works because the x86 reset vector is at top of memory (0xfffffff0),
not bottom (0x00000000) so the very first bytes of u-boot.bin are not the
reset vector, but rather where the reset vector jumps to after performing
some very low-level hardware init

Both images, as a very first step, relocate to the highest available
memory location and adjust all the relocation offsets in the image and
jump into the relocated image.

As long as I do not mess with the low-level init code, I can be confident
that an image that 'boots' using the 'go' command will boot from Flash

No, it is not a 'fully relocatable' image, but it is so close as to not
make any real difference to me.

Regards,

Graeme