All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] How to reduce the size of u-boot image file
@ 2004-06-10 19:14 Frank Young
  2004-06-10 22:57 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Young @ 2004-06-10 19:14 UTC (permalink / raw)
  To: u-boot

Hi,

I have two questions here:

1. Because of the size of the flash memory constraint, I need to strip the 
u-boot to its minimum size. Right now by executing "make all" in the u-boot 
directory, I got a image file u-boot at around 700K-800K. It's too big for 
my target. So I am thinking about getting rid of some functionalities which 
u-boot provides. I do need u-boot to initialize my hardware. But after that, 
I only need to use tftp to get the linux image, decompress the image, put 
the decompressed image in RAM and jump to the linux entry point to let the 
linux take over the control. Is there any FAQ or manual explaining how to 
strip down the u-boot size?

2. Since my flash memory address starts from 0xFFC00020 instead of 
0xFFF80000, so I changed the TEXT_BASE in board/walnut405/config.mk to 
0xFFC00020. When I use "make u-boot", everything is fine. But if I use "make 
u-boot.bin", it ends up with a u-boot.bin more than 4MB. I think I didn't 
get the TEXT_BASE set correctly. Isn't TEXT_BASE the start point of the 
flash? If it isn't, what does TEXT_BASE mean? And where to indicate the 
start of the flash memory?

BTW, here is my environment:
CPU: PPC 405 200MHz
Flash: 4MB
SDRAM: 16MB
BOARD: walnut


Thanks a lot!

Frank

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar ? get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] How to reduce the size of u-boot image file
  2004-06-10 19:14 Frank Young
@ 2004-06-10 22:57 ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-06-10 22:57 UTC (permalink / raw)
  To: u-boot

Frank,

in message <BAY2-F84Hoouifm0Sx700057af6@hotmail.com> you wrote:
> 
> 1. Because of the size of the flash memory constraint, I need to strip the 
> u-boot to its minimum size. Right now by executing "make all" in the u-boot 
> directory, I got a image file u-boot at around 700K-800K. It's too big for 

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?

> my target. So I am thinking about getting rid of some functionalities which 
> u-boot provides. I do need u-boot to initialize my hardware. But after that, 
> I only need to use tftp to get the linux image, decompress the image, put 
> the decompressed image in RAM and jump to the linux entry point to let the 
> linux take over the control. Is there any FAQ or manual explaining how to 
> strip down the u-boot size?

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

> 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 ?

> 0xFFF80000, so I changed the TEXT_BASE in board/walnut405/config.mk to 
> 0xFFC00020. When I use "make u-boot", everything is fine. But if I use "make 
> u-boot.bin", it ends up with a u-boot.bin more than 4MB. I think I didn't 

This is normal. U-Boot includes  the  jump  statement  at  the  reset
vector, 0xFFFFFFFC.

> get the TEXT_BASE set correctly. Isn't TEXT_BASE the start point of the 
> flash? If it isn't, what does TEXT_BASE mean? And where to indicate the 

Yes, it is. And if you put U-Boot at the start of the flash, and  the
reset  vector  is  in  the  last word, then the U-Boot image needs to
cover your whole 4 MB of flash memory.

You just get what you ask for.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Men don't talk peace unless they're ready to back it up with war.
	-- Col. Green, "The Savage Curtain", stardate 5906.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] How to reduce the size of u-boot image file
@ 2004-06-11 22:45 Frank Young
  2004-06-11 23:10 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Young @ 2004-06-11 22:45 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

>in message <BAY2-F84Hoouifm0Sx700057af6@hotmail.com> you wrote:
> >
> > 1. Because of the size of the flash memory constraint, I need to strip 
>the
> > u-boot to its minimum size. Right now by executing "make all" in the 
>u-boot
> > directory, I got a image file u-boot at around 700K-800K. It's too big 
>for
>
>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?





> > my target. So I am thinking about getting rid of some functionalities 
>which
> > u-boot provides. I do need u-boot to initialize my hardware. But after 
>that,
> > I only need to use tftp to get the linux image, decompress the image, 
>put
> > the decompressed image in RAM and jump to the linux entry point to let 
>the
> > linux take over the control. Is there any FAQ or manual explaining how 
>to
> > strip down the u-boot size?
>
>Yes. The README explains how to enable or disable commands or command 
>groups.
>
Got it. Thanks!


> > 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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] How to reduce the size of u-boot image file
  2004-06-11 22:45 [U-Boot-Users] How to reduce the size of u-boot image file Frank Young
@ 2004-06-11 23:10 ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-06-11 23:10 UTC (permalink / raw)
  To: u-boot

In message <BAY2-F52p7vXee4fDGC0005ba2b@hotmail.com> 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.

> 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..

> 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).

> 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?

> 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

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-11 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-11 22:45 [U-Boot-Users] How to reduce the size of u-boot image file Frank Young
2004-06-11 23:10 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-06-10 19:14 Frank Young
2004-06-10 22:57 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.