linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Mark A. Greer" <mgreer@mvista.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 8/15] zImage: Cleanup and improve zImage entry point
Date: Fri, 16 Mar 2007 15:02:58 +1100	[thread overview]
Message-ID: <20070316040258.GD12325@localhost.localdomain> (raw)
In-Reply-To: <20070316034539.GB22233@mag.az.mvista.com>

On Thu, Mar 15, 2007 at 08:45:39PM -0700, Mark A. Greer wrote:
> On Fri, Mar 16, 2007 at 11:50:16AM +1100, David Gibson wrote:
> > On Thu, Mar 15, 2007 at 05:47:17PM -0700, Mark A. Greer wrote:
> > > On Fri, Mar 16, 2007 at 11:18:19AM +1100, David Gibson wrote:
> > > > On Thu, Mar 15, 2007 at 04:02:30PM -0700, Mark A. Greer wrote:
> > > > > On Mon, Mar 05, 2007 at 02:24:52PM +1100, David Gibson wrote:
> > > > > > In addition the wrapper script is rearranged to ensure that the
> > > > > > platform .o is always linked first.  This means that platforms where
> > > > > > the zImage entry point is at a fixed address or offset, rather than
> > > > > > being encoded in the binary header can be supported using option (1).
> > > > > 
> > > > > But now you don't have a fixed address for _zimage_start when you use
> > > > > option 2).  I don't know what address _zimage_start is at so I can't
> > > > > start it.  This is an issue for fw's that don't understand ELF and simply
> > > > > download a bucket of bits.  You have to tell the fw where to jump to
> > > > > (e.g., go 0x410010).
> > > > 
> > > > The patch already includes an example that deals with this case,
> > > > uImage.  The wrapper script pulls the ELF entry point information out
> > > > using objdump and puts it into uboot's structure.
> > > 
> > > Sure, you're putting the addr into a struct in the uimage that u-boot
> > > knows enough to get.
> > > 
> > > 'u-boot' == smart
> > > 'my firmware' == dumb
> > > 
> > > I'm talking about a fw that knows *nothing* about what its downloading/
> > > running--its just a bucket of bits/instructions.  It doesn't get an address
> > > out of the image.  It has to be told explicitly where to download the image
> > > to and where to jump to.  As in, by someone sitting at the console who went
> > > and dug out the start addr.  Or, more likely with a prestored jump cmd that
> > > someone figured out the right address for and stored.  But, when the start
> > > addr changes, suddenly it won't boot and someone has to figure out why,
> > > find the the new start addr, modify the prestored cmd(s), and its good
> > > until the next time the start addr changes.
> > 
> > Sorry, I misunderstood.  That sort of firmware - and the even dumber
> > sort where the start address isn't configurable at all - is exactly
> > what option (1) is for.  You'll need an asm platform file which
> > defines _zimage_start to a fixed offset.  In your case you could
> > probably just make it a jump to the generic _zimage_start.
> 
> Arg, I was afraid you were going to say that.  What I don't like is that
> I'll simply duplicate the functionality of crt0.S verbatim just so I know
> where the start addr is.  It really has nothing to do with crt0.S and
> everything to do with the link order.

You don't need to duplicate crt0.S verbatim, all you need is a single
branch instruction.  Well, and we'll need to define a second symbol
that's not weak at the same place as crt0.S's version of
_zimage_start, say _default_zimage_start.

Maybe we can come up with an easy way for each platform to generate
that instruction at the right address.

> /me still thinks there's a better way.

Well, if you figure out a better way, let me know.  

> <rant>
> Actually, I like it less than I'm letting on.  Basically, you changed
> something that has existed for a long time and worked fine for everyone.
> In the process, my stuff and others were broken.  All of this to support
> an option that there are no users of yet (AFAIK).  I think this needs to
> go back to the old link order and/or a better solution found.
> </rant>

Well, we'll have a user soon in ps3.  The thing is somewhere along the
line we will have to support platforms that have an absolutely fixed
entry point.  Almost certainly there will be more than one such
platform with a different magic entry point address.  Therefore we
*have* to give ultimate control of the low addresses and entry point
to the platform code; it can't be common.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2007-03-16  4:02 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05  3:23 [0/15] Ebony support, spin 3 David Gibson
2007-03-05  3:24 ` [PATCH 1/15] powerpc: Allow duplicate lmb_reserve() calls David Gibson
2007-03-05  3:24 ` [PATCH 3/15] Define FIXED_PORT flag for serial_core David Gibson
2007-03-05  3:24 ` [PATCH 2/15] Automatically lmb_reserve() initrd David Gibson
2007-04-18 11:43   ` Uytterhoeven, Geert
2007-03-05  3:24 ` [PATCH 9/15] Add arch/powerpc driver for UIC, PPC4xx interrupt controller David Gibson
2007-03-05  3:24 ` [PATCH 10/15] Add device tree for Ebony David Gibson
2007-03-05 14:23   ` Josh Boyer
2007-03-06  0:04     ` David Gibson
2007-03-05  3:24 ` [PATCH 6/15] zImage: Add more flexible gunzip convenience functions David Gibson
2007-03-16 16:24   ` Geoff Levand
2007-03-17 12:59     ` David Gibson
2007-03-05  3:24 ` [PATCH 7/15] zImage: Cleanup and improve prep_kernel() David Gibson
2007-03-05  3:24 ` [PATCH 11/15] zImage wrapper for Ebony David Gibson
2007-03-05 17:10   ` Mark A. Greer
2007-03-06  0:09     ` David Gibson
2007-03-07 19:47       ` Scott Wood
2007-03-08  0:24         ` David Gibson
2007-03-08  0:54           ` Mark A. Greer
2007-03-08  1:35             ` Josh Boyer
2007-03-09 17:50   ` Josh Boyer
2007-03-10  4:08     ` David Gibson
2007-03-05  3:24 ` [PATCH 8/15] zImage: Cleanup and improve zImage entry point David Gibson
2007-03-15 22:35   ` Mark A. Greer
2007-03-16  0:14     ` David Gibson
2007-03-16  1:01       ` Mark A. Greer
2007-03-16  1:50         ` David Gibson
2007-03-16  3:36           ` Mark A. Greer
2007-03-20 20:20             ` Mark A. Greer
2007-03-15 23:02   ` Mark A. Greer
2007-03-16  0:18     ` David Gibson
2007-03-16  0:47       ` Mark A. Greer
2007-03-16  0:50         ` David Gibson
2007-03-16  3:45           ` Mark A. Greer
2007-03-16  4:02             ` David Gibson [this message]
2007-03-16 16:21           ` Scott Wood
2007-03-17  1:38             ` David Gibson
2007-03-17  3:15               ` Geoff Levand
2007-03-19 15:06               ` Scott Wood
2007-03-20  0:45                 ` David Gibson
2007-03-05  3:24 ` [PATCH 4/15] Use resource_size_t for serial port IO addresses David Gibson
2007-03-05  3:24 ` [PATCH 5/15] Re-organize Kconfig code for 4xx in arch/powerpc David Gibson
2007-03-05  3:24 ` [PATCH 12/15] Support for Ebony " David Gibson
2007-03-05  3:24 ` [PATCH 14/15] Early serial debug support for PPC44x David Gibson
2007-03-08 19:44   ` Josh Boyer
2007-03-09 17:42     ` Josh Boyer
2007-03-09 23:43       ` David Gibson
2007-03-05  3:24 ` [PATCH 15/15] Add support for reset on Ebony David Gibson
2007-03-05  3:24 ` [PATCH 13/15] Port 44x MMU definitions to ARCH=powerpc David Gibson
2007-03-05  8:02 ` Real time clock support in arch/powerpc Zang Roy-r61911
2007-03-05 15:10   ` Kumar Gala
2007-03-05 17:04     ` Mark A. Greer
2007-03-05 13:57 ` [0/15] Ebony support, spin 3 Josh Boyer
     [not found] <20070317013859.GJ3969%40localhost.localdomain>
2007-03-19 21:16 ` [PATCH 8/15] zImage: Cleanup and improve zImage entry point Milton Miller

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=20070316040258.GD12325@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mgreer@mvista.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;
as well as URLs for NNTP newsgroup(s).