public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Max Krummenacher <max.oss.09@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] arm: use $loadaddr as the standalone entry point
Date: Tue, 15 Aug 2017 14:22:26 +0200	[thread overview]
Message-ID: <1502799746.3076.16.camel@gmail.com> (raw)
In-Reply-To: <20170815113952.GE20467@bill-the-cat>

Hello all

Am Dienstag, den 15.08.2017, 07:39 -0400 schrieb Tom Rini:
> On Tue, Aug 15, 2017 at 09:32:30AM +0200, Wolfgang Denk wrote:
> > 
> > Dear Tom,
> > 
> > In message <20170814211300.GM20467@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.

Wolfgang says that a board needs to decide on what image type to
use for the standalone application and then from that set an
appropriate CONFIG_STANDALONE_LOAD_ADDR in its board configuration.
Without that the standalone binaries are useless anyway and setting
a default in arch/arm/config.mk only purpose is that the build succeeds.

My motivation to write the patch in the first place (and Tom seems to
agree) is that for boards who define nothing at least the plain binary
is linked to a memory address where one can load something.

I can live with both views.

Note that I sent a v2 of the patchset addressing Wolfgang's first
emails. v2 hopefully dropped the wrong connection of load/link
address with entry point.

Max

> 

  reply	other threads:[~2017-08-15 12:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-12  9:03 [U-Boot] [PATCH 0/2] improve hello_world standalone application for arm Max Krummenacher
2017-08-12  9:03 ` [U-Boot] [PATCH 1/2] arm: use $loadaddr as the standalone entry point Max Krummenacher
2017-08-12 18:29   ` Wolfgang Denk
2017-08-12 21:21     ` Max Krummenacher
2017-08-14 19:36       ` Wolfgang Denk
2017-08-14 21:13         ` Tom Rini
2017-08-15  7:32           ` Wolfgang Denk
2017-08-15 11:39             ` Tom Rini
2017-08-15 12:22               ` Max Krummenacher [this message]
2017-08-15 13:31                 ` Wolfgang Denk
2017-08-15 13:21               ` Wolfgang Denk
2017-08-19  1:35                 ` Tom Rini
2017-08-12  9:03 ` [U-Boot] [PATCH 2/2] hello_world.c: fix entry point in case of arm thumb binary Max Krummenacher
2017-08-12 18:39   ` Wolfgang Denk
2017-08-12 21:31     ` Max Krummenacher
2017-08-14 19:46       ` Wolfgang Denk
2017-08-14 21:15   ` Tom Rini
2017-08-15 12:24     ` Max Krummenacher
2017-08-12 18:32 ` [U-Boot] [PATCH 0/2] improve hello_world standalone application for arm Wolfgang Denk
2017-08-12 21:21   ` Max Krummenacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502799746.3076.16.camel@gmail.com \
    --to=max.oss.09@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox