[U-Boot] [PATCH 0/4] Convert MPC85xx platforms to a single linker script

Wolfgang Denk wd at denx.de
Wed Oct 15 00:10:32 CEST 2008


Dear Trent,

In message <Pine.LNX.4.64.0810141231490.3705 at t2.domain.actdsltmp> you wrote:
>
> All the mpc85xx platforms hard code the size of the flash via the local bus

No, they don't.

> controller settings.  For example, if you look in include/configs/MPC8572DS.h
> you will find these lines:
> 
> #define CFG_BR0_PRELIM          0xe8001001
> #define CFG_OR0_PRELIM          0xf8000ff7

Mind the "PRELIM" part in that names. PRELIM as in PRELIMINARY.

> Those two lines encode the location of the flash bank at 0xe800_0000 and the
> size of the bank at 128MB.  Also the port width and the timing parameters. 
> Determining the value of these registers at run time would be somewhat of a
> challenge.  You can't query the size of the flash chip with CFI until the chip
> is mapped.  And you can't map the chip until you know its size, which creates
> a certain chicken and egg problem.

You think you have to tell me that? Umm...

> I think what you would have to do is create a huge initial mapping, big enough
> to cover the chip with the most address lines.  I suppose you could map 4 GB
> to the flash and be assured of getting all 32 address lines on the eLBC.  But

Not really. You just have to map a small part, just big enough to be
able to read the CFI information.

> you'd be running from the flash you just re-mapped, that makes things a little
> more interesting.  Then you could do a CFI query to the base of that mapping
> to get the bank size, then resize the mapping to the correct value.  I'm not
> sure how to figure out the port size.  Maybe one could try 8, 16 and 32 bit
> ports and see which one worked, but that sounds a little iffy.  Actually, I

You might want to have a look at the CFI driver, then.

> think this must be in the cpu reset strapping somewhere, otherwise how would
> it boot?
> 
> But again, this has nothing to do with my patch.  I'm just improving the way
> the linker script works.  If you want to talk about how the local bus
> controller is programmed, can we have another thread please?  Something like
> "TODO: dynamically determine Freescale eLBC parameters at run time".

We are talking about your patches here, which claim to cover "all
MPC85xx" boards.

> > But in the patch you submit you hard-wire certain flash  bank  sizes
> > into the linker scriopts, don't you?
> 
> Not really.  I'm calculating the boot page location in a better way.

Now what. First you say you do, then you say you don't?

> The expression from tqm85xx will let you change the image size without being
> edited.  Why not use that one then?  Suppose you decide to change the location

He. Funny that you come up with that example.

> of the flash bank?  Then it won't work, unless you edit the linker script. 

"Change the location of the flash bank" - what exactly do you mean by
that?

> create a broken image (that is 8MB+ in size).  If you want to support a board
> with a 2 MB flash bank with the mpc8540eval style script, you need to copy the
> entire linker script and edit it.  With my method method, you can create a two
> line script:
> __flash_mask = 2M - 1;
> INCLUDE cpu/mpc85xx/u-boot.lds

And what do I do with a board that can have 2, 4, 8, 16, 32 or 64  MB
of flash?

> This is what my patch is for.  Letting all existing 85xx boards use one
> script.  And if a board is created that can't use the script alone, it can be
> handled easily, re-using the common script without duplicating any code. 
> Clearly this is an improvement over how things work now, is it not?

I'd be happy if that works, but somehow you don't add the missing
pieces of explanation I'm looking for.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Fascinating, a totally parochial attitude.
	-- Spock, "Metamorphosis", stardate 3219.8


More information about the U-Boot mailing list