After following the guide in chapter “U-Boot Customization” of the Development Guide 28.2, I can only decrease the total boot time from about 30s to 25s, it is too long to me, Is there any other introductions about optimizing U-Boot boot time?
I couldn’t tell you specifically, but your best tool to start with is to log boot via serial console. The log contains timestamps. If something is short, then you don’t need to look at it. Find the greatest slowdowns. Often this will be a timer while searching for options, e.g., perhaps U-Boot has checked for different boot media in order, but you know there is only one boot media you need…and you could eliminate the test for others.
NOTE: Often the actual Linux boot time is slowed down waiting for networking, e.g., for a DHCP server to reply, and then to see if WiFi can be started…one would want to completely eliminate any test for WiFi if it isn’t needed, and wired could be sped up via using a static IP address.
It does work when I check eMMC as the only boot media.
Does TBoot or CBoot can be customized?
TBoot source is not available and cannot be customized. I think CBoot is available, and probably can be customized (however, I’ve not done so and thus cannot give details).
Are your 25s only for U-boot or is it the total boot time till file system? If you are including the kernel boot time on this, then there is a lot more tuning you can perform: disable device drivers, disable unused features, remove unnecessary start up applications, etc.
Total boot time is about 25s after optimizing U-Boot. The stages before booting kernel is about 10s.
Should i leave tboot and cboot unchanged, and customize the kernel?
Thanks a lot.
TBoot cannot be edited. CBoot could be edited, but it is not advisable since it implies editing the source code, compiling it, and putting the replacement back in. Customizing the kernel and editing what startup apps run is far easier (although it might not really be “trivial”, I would say that in comparison to the effort to edit and rebuild CBoot that kernel changes and init changes are indeed “trivial”).