[U-Boot] [PATCH 6/6] powerpc: Add LINK_OFF calls in early C-code.

Scott Wood scottwood at freescale.com
Wed Nov 24 23:05:26 CET 2010


On Wed, 24 Nov 2010 22:50:21 +0100
Joakim Tjernlund <joakim.tjernlund at transmode.se> wrote:

> Scott Wood <scottwood at freescale.com> wrote on 2010/11/24 22:41:19:
> > > > > > > How about playing with BATs before entering C code, so that the image
> > > > > > > always appears at the same effective address?
> > > > > >
> > > > > > hmm, never thought of that. The extra bonus would be that LINK_OFF should
> > > > > > not be needed either.
> > > > >
> > > > > After sleeping on it I realize that all direct accesses to the flash
> > > > > such as getting the env. will need to be adjusted instead.
> > > >
> > > > You could have one small mapping for the U-Boot image, and another
> > > > larger unchanging mapping that covers the whole flash.
> > >
> > > Played a little with this but it seems like two BATs cannot overlap?
> >
> > They can't overlap in effective address space.  They can have
> > overlapping physical addresses (make sure the WIMG bits are the same).
> 
> hmm, now its starting to get a bit messy, I have flash over and under
> my boot area. In general it may be hard to match any random layout.

It shouldn't matter where in flash the boot area is.

E.g. if you have 64 MiB flash, with a 256 KiB boot image possibly
residing at offset zero or 0x3f00000, and the flash physical address
(after boot code is done with BR0/OR0 games) is 0xfc000000.  You could
have a 64 MiB mapping at, say, 0xe0000000 always poing to 0xfc000000,
and a 256 KiB mapping at 0xfff00000 pointing at either 0xfc000000 or
0xfff00000 depending on which you booted from.  If somehow you could
also boot from offset 0x2480000, then have 0xfff00000 point to
0xfe480000.  The mapping at 0xe0000000 is independent and always
points to 64 MiB at 0xfc000000.

-Scott



More information about the U-Boot mailing list