[U-Boot] Problems porting new u-boot

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

Dear Alemao,
In message d970ff420908060500j77fb4ea3kcd93f611269208b2@mail.gmail.com you wrote:
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 ?
But in u-boot-2009.03 it's created with only 516kB.
Looks incorrect.
Do I have to set TEXT_BASE with the exact u-boot.bin size?
No.
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

Hi Alemao,
Alemao wrote:
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.
But in u-boot-2009.03 it's created with only 516kB.
Your text base was probably 0xfff80000.
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.
Cheers,
-- Alemao
Best regards, gvb

Jerry Van Baren wrote:
Hi Alemao,
Alemao wrote:
Hi all,
Im having problems porting u-boot-2009.03 to a MPC8541 board.
^^^^^^^ [snip]
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

Dear Jerry Van Baren,
In message 4A7ADCC8.9040308@ge.com 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

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
participants (3)
-
Alemao
-
Jerry Van Baren
-
Wolfgang Denk