[U-Boot-Users] mpc8641hpcn linker script and the bootpg section
Chris Fester
cfester at iphase.com
Mon Jun 4 22:54:58 CEST 2007
Hi all,
Our company is currently building a board with several mpc8641
processors, each using u-boot for their bootloader. We're basing our
u-boot off of the mpc8641hpcn eval platform u-boot code (anywhere you
see inav74k_ap below you can effectively replace it with mpc8641hpcn).
We've known for quite a long while that our u-boot images were almost
twice as big as the u-boot images for our products with mpc83xx chips
(~400K vs 256K). It wasn't until today that I had some time to
investigate. Here's what I found strange at the end of System.map for
the 8641:
u-boot:fff35f68 B os_data_header
u-boot:fff35f88 B send_parms
u-boot:fff35f9c A _end
u-boot:fff37cac D _SDA_BASE_
u-boot:fff37cd4 D _SDA2_BASE_
u-boot:fff70000 T law_entry /---/u-boot/board/inav74k_ap/init.S:86
Our System.map file for our 83xx based products doesn't have a "hole" in
it like above:
u-boot:fff456d0 D _SDA_BASE_
u-boot:fff45700 D _SDA2_BASE_
u-boot:fff45744 B console_buffer
u-boot:fff45844 B header
u-boot:fff45884 B os_data_header
u-boot:fff458a4 B send_parms
u-boot:fff458b8 B super
u-boot:fff45904 A _end
So I looked further into the linker script and found this section:
.bootpg 0xFFF70000 :
{
cpu/mpc86xx/start.o (.bootpg)
board/inav74k_ap/init.o (.bootpg)
} = 0xffff
I thought it was awful weird to have it hardcoded at that particular
address, so I changed it to be like this:
/* .bootpg 0xFFF70000 : */
.bootpg :
{
cpu/mpc86xx/start.o (.bootpg)
board/inav74k_ap/init.o (.bootpg)
} = 0xffff
The resulting image is much smaller at 200K. After flashing that u-boot
image to my board, it appears to work just fine. But I'm concerned that
maybe this isn't the most intelligent thing to do. I'm about the
farthest thing from a linker script expert. Plus it appears that now
law_entry is at the top of my System.map file:
u-boot:00000000 A __fixup_entries
u-boot:0000046f A __got2_entries
u-boot:fff00104 T law_entry /---/u-boot/board/inav74k_ap/init.S:86
u-boot:fff01004 T version_string
I thought that area was reserved for exception vectors and whatnot, so
I'm concerned that next time I hit an exception it's just going to start
re-programming the LAWBAR registers. :)
Oh, and on a somewhat related note... why do we have to start
programming the image at 0xfff00100 for the 8641? All our 83xx boards
we start programming at 0xfff00000. I thought it was a little odd to
break the convention, but I'm not going to complain given that it works
for us. I'm just curious.
Thanks in advance for any ideas or advice!
Chris Fester
More information about the U-Boot
mailing list