[U-Boot] [PATCH 1/2] arm: use $loadaddr as the standalone entry point

Tom Rini trini at konsulko.com
Tue Aug 15 11:39:52 UTC 2017


On Tue, Aug 15, 2017 at 09:32:30AM +0200, Wolfgang Denk wrote:
> Dear Tom,
> 
> In message <20170814211300.GM20467 at bill-the-cat> you wrote:
> > 
> > But we're talking about CONFIG_STANDALONE_LOAD_ADDR not
> > CONFIG_STANDALONE_ENTRY_POINT.  What we've been doing in
> > arch/arm/config.mk has been on my to fix list for a long time, because
> > it's been wrong for so many boards.  Setting this to CONFIG_LOADADDR is
> > a reasonable default value.
> 
> No, it is not.  It is fundamentally broken. If you need a default
> for the entry point address, then define one.  CONFIG_LOADADDR means
> where the image gets loaded to, and almost all image formats have a
> header in front of the payuload, so the entry point is somewhere
> else.  And even if you load raw binary images, there is no guarantee
> that the entry point is right at the start of the image,
> 
> Mixing things that are defined for different purposes (loading image
> versus start address of the code) is a really bad idea.

What CONFIG_STANDALONE_LOAD_ADDR is, is the location that we want
hello_world, or other example stand alone applications loaded into
memory at.  CONFIG_LOADADDR is the safe default location to load things
into memory at in order to run them.  At least on ARM, where there's a
good number of different default memory layouts, what arch/arm/config.mk
does today is broken for the majority of platforms.  We should be
providing at least a functional default value here, which we are not
today.  This in no way precludes a 'real' standalone application from
linking and running at whatever it wants within a platforms memory map.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170815/ca92fa54/attachment.sig>


More information about the U-Boot mailing list