Skip to contentSkip to conversation

How to reduce the size of u-boot image file

U-Boot-Users Frank Young 2 participants 2 messages Jun 11, 2004

lore
Share & tools
lore
#0 lore raw

Hi Wolfgang,

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

1. Because of the size of the flash memory constraint, I need to strip

the

Quoted 1 line

u-boot to its minimum size. Right now by executing "make all" in the

u-boot

Quoted 1 line

directory, I got a image file u-boot at around 700K-800K. It's too big

for

Quoted 8 lines

You must be joking. I haven't seen any configuration yet which exceeds 256 kB.

Did you by any chance look at the ELF file which includes all the hewaders, symbol tables, debug informnation etc.?

Forget about this one. How big is your u-boot.bin file?

No kidding at all. I am extremely serious about this.

If I don't change anything, then I got a u-boot as big as 716,334 bytes. The u-boot.bin is about 500K if I don't change the TEXT_BASE in board/walnut/config.mk. If I change the CONFIG_COMMANDS to default value, it is reduced to 576,931. But how would you get it less than 256KB?

The command I used to build u-boot is very simple:
make distclean
make WALNUT405_config
make all

But before that I have to change a line in examples/Makefile $(OBJCOPY) -O binary $< $@ 2>/dev/null

to:
$(OBJCOPY) -O binary $<:.srec=) $@ 2>/dev/null

I don't think this change will affact the size of the image. Am I right?

Quoted 6 lines
Quoted 1 line

my target. So I am thinking about getting rid of some functionalities

which

Quoted 1 line

u-boot provides. I do need u-boot to initialize my hardware. But after

that,

Quoted 1 line

I only need to use tftp to get the linux image, decompress the image,

put

Quoted 9 lines
Quoted 1 line

the decompressed image in RAM and jump to the linux entry point to let

the

Quoted 1 line

linux take over the control. Is there any FAQ or manual explaining how

to

Quoted 1 line

strip down the u-boot size?

Yes. The README explains how to enable or disable commands or command groups.

Got it. Thanks!

Quoted 4 lines
Quoted 1 line

2. Since my flash memory address starts from 0xFFC00020 instead of

Please check again. I think it is IMPOSSIBLE to have a flash start address of 0xFFC00020. I guess you mean 0xFFC00000 ?

Yes, you are right, the flash begins from 0xFFC00000. But I need to reserve the first 0x20 for my special purpose, so the available flash is from 0xFFC00020. Can u-boot be aligned from this address?

Thanks!

Frank

_________________________________________________________________
Watch the online reality show Mixed Messages with a friend and enter to win a trip to NY
http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/

#1 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

If I don't change anything, then I got a u-boot as big as 716,334 bytes. The

The ELF file, ok. This doesn't matter at all.

Quoted 1 line

u-boot.bin is about 500K if I don't change the TEXT_BASE in

Not "about 500K". It's EXACTLY 512 kB, as TEXT_BASE = 0xFFF80000, which is 512 kB below the top of [32 bit] address space..

Quoted 2 lines

board/walnut/config.mk. If I change the CONFIG_COMMANDS to default value, it is reduced to 576,931. But how would you get it less than 256KB?

Move TEXT_BASE up. Or exclude .resetvec from your linker script (but make sure to have a valid reset vector installed).

Quoted 4 lines

But before that I have to change a line in examples/Makefile $(OBJCOPY) -O binary $< $@ 2>/dev/null
to:
$(OBJCOPY) -O binary $<:.srec=) $@ 2>/dev/null

Why do you have to do this?

Quoted 1 line

I don't think this change will affact the size of the image. Am I right?

Yes.

But I think you really should try to understand the structure of such an image, and that it includes a huge "gap" between the real u-boot image (starting at TEXT_BASE) and the reset vector (at 0xFFFFFFFC).

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Remember, there's a big difference between kneeling down and  bending
over.                                                   - Frank Zappa