public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tixy <tixy@yxit.co.uk>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Stephen Warren <swarren@nvidia.com>,
	Erik Gilling <konkers@android.com>, Arnd Bergmann <arnd@arndb.de>,
	Nicolas Pitre <nico@fluxnic.net>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"Colin Cross (ccross@android.com)" <ccross@android.com>,
	Olof Johansson <olof@lixom.net>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm/tegra: select AUTO_ZRELADDR by default
Date: Sat, 15 Oct 2011 16:29:12 +0100	[thread overview]
Message-ID: <1318692552.2241.47.camel@computer2> (raw)
In-Reply-To: <20111014201953.GX21648@n2100.arm.linux.org.uk>

On Fri, 2011-10-14 at 21:19 +0100, Russell King - ARM Linux wrote:
> On Fri, Oct 14, 2011 at 01:16:27PM -0700, Stephen Warren wrote:
> > Russell King wrote at Friday, October 14, 2011 2:12 PM:
> > > I don't think that's so with the various flavours of platform specific
> > > uboot which float around.  For instance, on the OMAP4430 SDP, the
> > > following commands were used as supplied to load a uImage off the SD
> > > card into RAM at a different address to which it was built for, and
> > > execute it at that address:
> > > 
> > > mmcinit 0
> > > fatload mmc 0 0x80300000 uImage
> > > bootm 80300000
> > > 
> > > Whether the 'bootm' command then copied the image and called it there,
> > > or whether it executed it at 0x80300000 I've no idea - but why then
> > > load the image at a different address in the first place?
> > 
> > Yes, U-Boot's image handling looks at the image at 80300000, extracts the
> > "load address" from the image header, memcpy()'s the image to that address,
> > then jumps to the "entry address" in the image header.
> 
> Ah, so specifying that address is just a total waste of space then,
> because you might as well specify an address which results in the
> copy not being necessary.
> 
> However, I'd expect that uboot is dumb enough to still do the copy
> irrespective of whether its already in the right place.

U-Boot doesn't do an unnecessary copy if the body of the image is
already at the load address specified in the image header.

Unfortunately, it also doesn't do a copy if the header of the image is
at the load address, (I guess to support images constructed with an
embedded header). This means that

  fatload mmc 0 0x80300000 uImage
  bootm 0x80300000

will crash as it will attempt to boot Linux by executing the image
header. To successfully boot without requiring a relocation we would
need:

  fatload mmc 0 0x80300000-sizeof(header) uImage
  bootm 0x80300000

-- 
Tixy



  reply	other threads:[~2011-10-15 15:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28  1:07 [PATCH] arm/tegra: select AUTO_ZRELADDR by default Peter De Schrijver
2011-09-28 17:50 ` Stephen Warren
2011-10-13 23:38   ` Olof Johansson
2011-10-14  7:15     ` Russell King - ARM Linux
2011-10-14 14:45       ` Stephen Warren
2011-10-14 15:29         ` Arnd Bergmann
2011-10-14 16:12           ` Stephen Warren
2011-10-14 16:27             ` Arnd Bergmann
2011-10-14 16:44               ` Olof Johansson
2011-10-14 18:03                 ` Nicolas Pitre
2011-10-14 19:20                 ` Russell King - ARM Linux
2011-10-14 20:06                   ` Nicolas Pitre
2011-10-14 20:12                     ` Russell King - ARM Linux
2011-10-14 20:16                       ` Stephen Warren
2011-10-14 20:19                         ` Russell King - ARM Linux
2011-10-15 15:29                           ` Tixy [this message]
2011-10-14 20:26                       ` Nicolas Pitre
2011-10-14 20:14                     ` Stephen Warren
2011-10-14 20:45                       ` Nicolas Pitre
2011-10-14 21:01                         ` Stephen Warren
2011-10-14 21:28                           ` Nicolas Pitre
2011-10-14 22:06                           ` Rob Herring
2011-10-14 18:01               ` Nicolas Pitre
2011-10-14 19:20                 ` Russell King - ARM Linux
2011-10-14 20:14                   ` Nicolas Pitre
2011-10-14 20:17                     ` Russell King - ARM Linux
2011-10-14 20:31                       ` Nicolas Pitre
2011-10-14 21:13                         ` Russell King - ARM Linux
2011-10-14 22:26                           ` Nicolas Pitre
2011-10-14 17:53             ` Nicolas Pitre
2011-10-14 17:58               ` Olof Johansson
2011-10-14 18:00                 ` Olof Johansson
2011-10-14 15:59       ` [PATCH] ARM: mutually exclude ZBOOT_ROM and AUTO_ZRELADDR Olof Johansson
2011-10-14 16:29         ` Arnd Bergmann
2011-10-14 18:07           ` Nicolas Pitre
2011-10-14 18:04         ` Nicolas Pitre
  -- strict thread matches above, loose matches on Subject: below --
2011-10-03 13:06 [PATCH v6 0/3] Add support for tegra2 based ventana board Peter De Schrijver
2011-10-03 13:06 ` [PATCH] arm/tegra: select AUTO_ZRELADDR by default Peter De Schrijver
2011-10-03 13:13   ` Peter De Schrijver
2011-10-03 16:22     ` Stephen Warren
2011-10-04  8:51       ` Peter De Schrijver

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=1318692552.2241.47.camel@computer2 \
    --to=tixy@yxit.co.uk \
    --cc=arnd@arndb.de \
    --cc=ccross@android.com \
    --cc=konkers@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nico@fluxnic.net \
    --cc=olof@lixom.net \
    --cc=pdeschrijver@nvidia.com \
    --cc=swarren@nvidia.com \
    /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