[U-Boot] Some question about uboot

Dear all: While porting uboot, I find there are too many things I don't need at all, like net, i2c etc. How could I remove them from my uboot binary to minimize the size of uboot, my flash limitation is 6k? I try to edit Makefile to remove them by marking some library setting, but it compile error after I doing so. Is there any easier way to meet my requirement? Appreciate your help, miloody

-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de] On Behalf Of loody Sent: Tuesday, February 24, 2009 12:19 PM To: u-boot@lists.denx.de Subject: [U-Boot] Some question about uboot
Dear all: While porting uboot, I find there are too many things I don't need at all, like net, i2c etc. How could I remove them from my uboot binary to minimize the size of uboot, my flash limitation is 6k? I try to edit Makefile to remove them by marking some library setting, but it compile error after I doing so. Is there any easier way to meet my requirement?
Justr trim your board specific file in include/configs/ folder. Remove the CONFIGS you do not want.
Appreciate your help, miloody _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

loody wrote:
Dear all: While porting uboot, I find there are too many things I don't need at all, like net, i2c etc. How could I remove them from my uboot binary to minimize the size of uboot, my flash limitation is 6k?
If 6K is truly what you have, you aren't going to get there with u-boot. I don't know what the current minimum config results in (and it will vary depending on processor and the definition of "minimum"), but rule of thumb is that 128K is a fairly tight u-boot; under 128K and you will be cutting deeply. It may be possible to get it under 64K with a lot of work, but it may be easier to start with a different code base or start from scratch.
Can you do a two level bootstrap where you have a 6K minimal bootstrap program that loads u-boot from somewhere else that has 128K-256K available? Note that this is what NAND-booting systems (e.g. ARM) do - the NAND first stage boot fits in 4K, the rest gets copied from NAND to RAM and then run in RAM.
I try to edit Makefile to remove them by marking some library setting, but it compile error after I doing so.
Libraries are crack cocaine to programmers. Once you use them, it is really hard to give them up. :-)
Is there any easier way to meet my requirement?
Sorry, unless there is a really significant typo in your original email, u-boot has way too much functionality for your constraints. I don't know what the alternatives are (there are some), but you are looking at a very tight boot ROM probably written mostly/entirely in assembly or very constrained C (no libraries, very tightly written, max optimization).
Appreciate your help, miloody
Good luck, gvb

Hi Jerry:
2009/2/24 Jerry Van Baren gerald.vanbaren@ge.com:
loody wrote:
Dear all: While porting uboot, I find there are too many things I don't need at all, like net, i2c etc. How could I remove them from my uboot binary to minimize the size of uboot, my flash limitation is 6k?
If 6K is truly what you have, you aren't going to get there with u-boot. I don't know what the current minimum config results in (and it will vary depending on processor and the definition of "minimum"), but rule of thumb is that 128K is a fairly tight u-boot; under 128K and you will be cutting deeply. It may be possible to get it under 64K with a lot of work, but it may be easier to start with a different code base or start from scratch.
Can you do a two level bootstrap where you have a 6K minimal bootstrap program that loads u-boot from somewhere else that has 128K-256K available? Note that this is what NAND-booting systems (e.g. ARM) do - the NAND first stage boot fits in 4K, the rest gets copied from NAND to RAM and then run in RAM.
Thanks for your kind suggestion. If I only need uboot to do cpu basic setting with USB ehci and file system support, does it still need 128k at least? As you suggest, I can do the 2 levels bootstrap. But uboot has great features support. I am not sure it will be easier to make another wheel.
Sorry, unless there is a really significant typo in your original email, u-boot has way too much functionality for your constraints. I don't know what the alternatives are (there are some), but you are looking at a very tight boot ROM probably written mostly/entirely in assembly or very constrained C (no libraries, very tightly written, max optimization).
Would you please tell me how to add a new cpu and platform in uBoot? I know the first step I have to do is adding my cpu and platform folder. But I have no idea how to add setting in Makefile. why sometimes we use "@$(MKCONFIG) $(@:_config=)" ,sometimes we use "@$(MKCONFIG) -a" and sometimes we have to " @mkdir -p $(obj)include" before calling mkconfig?
I try to modify platform.h located at include/configs to remove unnecessary driver. But I have no idea which one I can remove such that the unnecessary driver will no compile my uboot. for example, I remove "CONFIG_DRIVER_CS8900" in smdk2410.h, and the error message while linking is "net/libnet.a(net.o): In function `NetSendPacket': /media/u-boot_20090224_snapshot/net/net.c:654: undefined reference to `eth_send'" Appreciate your kind help, miloody
I
I want to add my cpu and platform and find out where the bottle net is.

Dear loody,
In message 3a665c760902240521y768bead8x9bebc4a30ac04f2e@mail.gmail.com you wrote:
If I only need uboot to do cpu basic setting with USB ehci and file system support, does it still need 128k at least?
File system support is big (which file system(s) are we talking about?), and USB support is BIG.
You will most probably need more than 128 k.
Would you please tell me how to add a new cpu and platform in uBoot? I know the first step I have to do is adding my cpu and platform folder. But I have no idea how to add setting in Makefile. why sometimes we use "@$(MKCONFIG) $(@:_config=)" ,sometimes we use "@$(MKCONFIG) -a" and sometimes we have to " @mkdir -p $(obj)include" before calling mkconfig?
Well, read the source code. It's the best documentation we have - it is exact, and detailed.
I try to modify platform.h located at include/configs to remove unnecessary driver.
This is not the way to configure U-Boot.
But I have no idea which one I can remove such that the unnecessary driver will no compile my uboot.
As a first step you need an in depth understanding of your hardware. This will tell you exactly which drivers are needed for the operation of your system as you want to use it.
Note that nobody else can tell you that - we don't know your hardware, and we don;t know your requirements.
for example, I remove "CONFIG_DRIVER_CS8900" in smdk2410.h, and the error message while linking is "net/libnet.a(net.o): In function `NetSendPacket': /media/u-boot_20090224_snapshot/net/net.c:654: undefined reference to `eth_send'"
You are taking the wrong approach. If you rip out the network driver without disabling network support you will obviously get errors. Hoever, if you just disable network support, then the network driver may go out of way automagically.
Best regards,
Wolfgang Denk
participants (4)
-
Aggrwal Poonam-B10812
-
Jerry Van Baren
-
loody
-
Wolfgang Denk