FASTBOOT REFERENCE


1. Overview

The main principle of fastboot is to put the necessary modules related to panel lighting up and the user app to the ramdisk to start in advance to realize the function of fast panel brightening.

  • Advantage

    Realize fast panel brightening.

  • Disadvantage

    Making a ramdisk requires additional memory. The larger the app size, the larger the ramdisk and the larger the memory. Before using fastboot, please evaluate whether the memory is sufficient.

    Note: If the user app is very large, fastboot is not recommended.


2. Public Version Fastboot Memory Statistics

Take zk_mini_fastboot as an example to count the memory usage of the public version fastboot.

  • Memory occupied by ramdisk

    The size generated by ramdisk is 6.49M.

    The corresponding memory occupied is 0x67ffff = 6.66M.

    Linux available memory = MemTotal-Ramdisk Memory

    Note:DDR SIZE = MMA SIZE + MemTotal  + kernel txt + MMAP IP


3. Enable Fastboot Config

Takoyaki nand and nor flash in public version share a set of apps for demo. The app path is as follows:

sdk\verify\application\zk_mini_fastboot

Click to open the source path

The default released config has packaged this app into image:

project\release\customer_tailor\nvr_i2m_display_fastboot_glibc_tailor.mk

Only the kernel and project need to be configured separately for the compilation config of fastboot, and the boot is the same as the normal startup config.


3.1. Nand flash

project: 

configs/nvr/i2m/8.2.1/spinand.ram-glibc-squashfs.011a.128           //ssd202

configs/nvr/i2m/8.2.1/spinand.ram-glibc-squashfs.011a.64            //ssd201

kernel:

infinity2m_spinand_ssc011a_s01a_minigui_fastboot_defconfig

3.2. Nor flash

project:

configs/nvr/i2m/8.2.1/nor.glibc-ramfs.011a.64                  //ssd201

configs/nvr/i2m/8.2.1/nor.glibc-ramfs.011a.128                //ssd202

kernel:

infinity2m_ssc011a_s01a_fastboot_defconfig

**Note: After compiling the kernel, release the lib corresponding to the kernel to the project, and then compile the project. **

The release steps are as follows:

Enter project/kbuild/4.9.84

nand flash

./release.sh -k ${RELEASEDIR}/kernel -b 011A-fastboot -p nvr -f spinand -c i2m -l glibc -v 8.2.1

nor flash

./release.sh -k ${RELEASEDIR}/kernel -b 011A-fastboot -p nvr -f nor -c i2m -l glibc -v 8.2.1

4. Main Implementation Process Of Fastboot

The fastboot implementation method is mainly in the makefile of project\image\configs\i2m\rootfs_fastboot.mk, which puts all the boot behaviors under /etc/profile. The process is as follows:

  1. Put the modules that must be used to boot into /etc/init.sh

  2. Start the app in init.sh, sdk\verify\application\zk_mini_fastboot\image.mk

    Note: The required res for the first displayed picture when the app starts is placed in the customer_app of the rootfs, and the rest is placed in customer. This can reduce the size of the rootfs and speed up the startup.

  3. After the app is running, install non-essential partitions and mounts


5. Note For Fastboot Customization

When importing fastboot, users mainly need to consider the followings:

  1. The user app size is different from the public version

    The larger the app, the larger the ramdisk produced, the larger the rootfs partition, the larger the memory used, and the longer it takes to decompress the ramdisk. If the user app is large, fastboot cannot take advantage.

    Currently the app is placed in rootfs. If the size of the user app is different from the public version, you can change the size of the rootfs partition by modifying the following partition files:

    nand:

    project\image\configs\i2m\spinand.ramfs-squashfs.p2.partition.config
    

    nor:

    project\image\configs\i2m\nor.ramfs.partition.config
    

    Note: The total size of the partition cannot exceed the flash. After increasing the rootfs, you need to reduce other partitions accordingly; the partition size must be 64kb aligned.

  2. The user app memory usage is different from the public version

    DDR memory is mainly composed of mma and linux memory: DDR SIZE ~= MMA SIZE + linux MemTotal

    Users can increase or decrease the size of mma to adjust the memory according to the actual usage of mma. The actual usage of mma can be dumped in the maximum usage scenario with the following command:

  3. The user app behavior is different from the public version

The difference between fastboot and normal startup is that the non-essential fastboot modules are delayed to start, so you can’t use unstarted modules such as usb or wifi as soon as the screen comes out. You need to wait for processing in the UI.


6. Enable Bootlogo With Fastboot

You must run uboot to open bootlogo. The changes are as follows:

  1. setenv ota_upgrade_status 1, through ota_upgrade_status control whether to run uboot;

  2. setenv autoestart 0, disable uboot network function to speed up booting;

  3. Enable quadmode read in boot\drivers\mstar\spinand\inc\config\infinity2m\drvSPINAND_uboot.h to improve the speed of loading img #define SUPPORT_SPINAND_QUAD (1)


Booting phase Time(ms)
IPL~UBOOT
IPL gbf78c2e - runUBOOT()
65
UBOOT~KERNEL
runUBOOT() - Starting kernel
1168
KERNEL~KO INSMOD FINISH
Starting kernel - mknod: /dev/mi_poll: File exists
2061
INSMOD FINISH - APP START DONE 667
mknod: /dev/mi_poll: File exists -
FB_AllocHWSurface 1303
Total: 3961
test environment:
flash model:MX35LF1GE4AB128M
Software version:TAKOYAKI_DLS00V008
Test Conditions:
1. Open the bootlogo: setenv ota_upgrade_status 1
2. Open quadmode with uboot: #define SUPPORT_SPINAND_QUAD (1)
3. Close uart eth:setenv autoestart 0