How to define the booting time?
The booting time we defined here is from the board be powered up to the main application working and main application be showed directly to the end user, for example: for the media play purpose board, the booting time count to the first video frame be shown on the screen.
For minimizing the booting time, some methods be tried.
- Optimizing for performance.
- Remove unnecessary modules at boot time.
- Start main application at the first time after the kernel be boot up.
Optimizing for performance:
U-Boot:
1:Enable MMU and L2-Cache.
2:Optimizing memset and memcpy.
3:Implementation of SDMA, accelerate copying data from NOR flash to memory.
4:Implementation of uSDHC’s ADMA, improve performance for SD card read.
Kernel:
1:Optimizing _memcpy_fromio function at arch/arm/kernel/io.c
- Remove unnecessary modules:
U-Boot:
1: Disable uart output at u-boot procedure and add quiet parameter to Kernel boot.
2: Remove boot up delay at u-boot.
3: Disable I2C, SPI, SPLASH_SCREEN at u-boot.
Kernel:
Below removing unnecessary modules just for Sabresd board boot up through SD card and MIPI camera overlay on LVDS screen application, for other special board and special board usage application please don’t use below directly.
1: Modify arch/arm/mach-mx6/board-mx6q_sabresd.c
just
keep necessary module initialization at mx6_sabresd_board_init
:
iomux configuration, uart0, voda, ipu, ldb, v4l2, mipi-csi, i2c1, uSDHC1, pwm0, dvfs, mipi camera clock.
2: Update Linux kernel configuration file. Try to just keep necessary module and configuration to keep minim size. Build necessary modules from external to Kernel itself. Create uImage from Image instead of zImage to reduce Kernel self extraction time. Use ext4 file system on SD card to accelerate rootfs mounting.
Notice: Kernel configuration remove NETWORK support, it includes Unix Domain Socket, the udev mechanism need it, so this kernel configuration can't support rootfs udev dynamic /dev/ nodes and all /dev/ nodes must be created before boot up at rootfs.
- Start main application at the first time after the kernel boots up.
As normal boot up procedure, the init process will handle sysinit script firstly, this script will do some initialization and preparation for most of the user process, But this script normally will be executed for about 1~5 seconds, so now try do main application before the sysinit, while the necessary preparation of main application will be handle by this application internally.
See below example for MIPI camera overly on LVDS screen:
/etc/inittab
::once:/unit_tests/mxc_v4l2_overlay.out
-iw 640 -ih 480 -it 0 -il 0 -ow 1024 -oh 768 -ot 0 -ol 0 -r 0 -t -1 -d 0 -fg -fr 30
::once:/etc/rc.d/rcS
::once:/sbin/getty
-L ttymxc0 115200 vt100 # GENERIC_SERIAL
-
Test result of fast boot on Sabresd board for MIPI camera overly on LVDS screen:
The main application be executed from the board be powered up is about 958ms.