Linux Fastboot Methods

本文介绍了如何定义启动时间,并提供了一系列优化方法来减少从上电到应用程序完全可用的时间。包括提高性能、移除不必要的模块以及在内核启动后立即运行主应用等策略。

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.

  1. Optimizing for performance.
  2. Remove unnecessary modules at boot time.
  3. 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值