
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