Skip to contentSkip to conversation

Problems porting new u-boot

U-Boot Alemao 3 participants 6 messages Aug 6, 2009

lore
Share & tools
lore

Alemao

author
#0 lore raw

Hi all,

Im having problems porting u-boot-2009.03 to a MPC8541 board.

In u-boot-1.2.0, if I use TEXT_BASE = 0xfff00000, u-boot.bin is created with 1MB size.

But in u-boot-2009.03 it's created with only 516kB.

In cpu/mpc85xx/start.S says:

"The processor starts at 0xfffffffc and the code is first executed in the last 4K page(0xfffff000-0xffffffff) in flash/rom."

So I think there's nothing in 0xfffffffc, using u-boot.bin from u-boot-2009.03, cause it only has 516kB.

Do I have to set TEXT_BASE with the exact u-boot.bin size?

Or am I missing something?

Cheers,

--
Alemao

#1 lore raw

Dear Alemao,

Quoted 5 lines · In message <[email protected]> you…

Im having problems porting u-boot-2009.03 to a MPC8541 board.

In u-boot-1.2.0, if I use TEXT_BASE = 0xfff00000, u-boot.bin is created with 1MB size.

Sounds like a waste of flash memoory ?

Quoted 1 line

But in u-boot-2009.03 it's created with only 516kB.

Looks incorrect.

Quoted 1 line

Do I have to set TEXT_BASE with the exact u-boot.bin size?

No.

Quoted 1 line

Or am I missing something?

Obviously yes.

But as you share no relevant information, it's impossible even to guess what might be wrong in your configuration.

Best regards,

Wolfgang Denk

Signature · 6 lines
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
The moral of the story is: "Don't stop to  tighten  your  shoe  laces
during the Olympics 100m finals".
                             - Kevin Jones in <[email protected]>
#2 lore raw
In reply to Alemao

Hi Alemao,

Quoted 6 lines · Alemao

Hi all,

Im having problems porting u-boot-2009.03 to a MPC8541 board.

In u-boot-1.2.0, if I use TEXT_BASE = 0xfff00000, u-boot.bin is created with 1MB size.

The .bin file is a binary image from the first location 0xfff00000 *contiguously filled* to the last location (the start vector at 0xfffffffc). U-Boot isn't that big, most of it is empty space, but your creation of a 0xFF-filled .bin file fills in the empty spaces.

Quoted 1 line

But in u-boot-2009.03 it's created with only 516kB.

Your text base was probably 0xfff80000.

Quoted 11 lines

In cpu/mpc85xx/start.S says:

"The processor starts at 0xfffffffc and the code is first executed in the last 4K page(0xfffff000-0xffffffff) in flash/rom."

So I think there's nothing in 0xfffffffc, using u-boot.bin from u-boot-2009.03, cause it only has 516kB.

Do I have to set TEXT_BASE with the exact u-boot.bin size?

Or am I missing something?

* Don't use a .bin file (use the linker elf output directly)?
* Does it matter?

Do you need to set your text base to 0xfff00000? You are better off setting your text base so that your u-boot and reset vector are close together. You did not say what processor you are using, but it sounds like a MPC74xx or MPC86xx or MPC85xx? I played with a MPC8548 and reconfigured it so that my u-boot was the last two sectors of flash and the env variables were saved in the sector *preceding* the u-boot image.
That worked very nicely.

The typical u-boot places the env sector after the u-boot image, which works in most cases but doesn't work well where the top page/bytes of the memory are the reset vector. In those cases, it is better to have U-Boot and the reset vector/page at the top of memory and the env sector below U-Boot, otherwise you end up with the env taking a whole sector out of the middle plus waste another whole sector just to hold your reset vector/page.

Quoted 4 lines

Cheers,

--
Alemao

Best regards,
gvb

#3 lore raw
Quoted 6 lines · Jerry Van Baren

Hi Alemao,

Quoted 3 lines · Alemao

Hi all,

Im having problems porting u-boot-2009.03 to a MPC8541 board.

                                                   ^^^^^^^

[snip]

Quoted 2 lines

You did not say what processor you are using, but it sounds like a MPC74xx or MPC86xx or MPC85xx?

Argh, some days I read. Other days... <rolls eyes>

gvb

#4 lore raw

Dear Jerry Van Baren,

Quoted 2 lines · In message <[email protected]> you wrote:

Argh, some days I read. Other days... <rolls eyes>

With a little training you probably can learn to read _while_ rolling your eyes :-)

Best regards,

Wolfgang Denk

Signature · 5 lines
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
"If God had wanted us to use the metric system, Jesus would have  had
10 apostles."
author
#5 lore raw
In reply to Jerry Van Baren

Thanks for the quick responses.

Thanks for the quick responses.

Actually it doesn't need to be so big, to justify use TEXT_BASE 0xfff00000. Im really wasting flash memory.

The problem is that in U-Boot-1.2.0, u-boot.bin gets filled, and in U-Boot-2009.03 seems that objcopy doesn't fill the right size.

I tried just change TEXT_BASE for MPC8541CDS board, setting it to 0xfff00000. In U-Boot-1.2.0 was ok, but in U-Boot-2009.03 u-boot.bin was only 512kB, and it should be 1MB

Then I tried TEXT_BASE = 0xffb00000:

U-Boot-1.2.0 -> u-boot.bin 5MB
U-Boot-2009.03 -> u-boot.bin 512kB

It seems that another variable is limiting the size to 512kB.

Cheers,

--
Alemao