SDVX-TN-001: Fast boot time

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box
SDVX.png Applies to SDVX
AXEL ULite-top.png Applies to AXEL ULite

History[edit | edit source]

Version Date Notes
1.0.0 October 2018 First public release
1.1.0 April 2020 Added iMX6UL cases

Introduction[edit | edit source]

When using Linux embedded platforms, boot time is an important performance to take into account. Many indications or examples can be found on Internet but when a real case where an industrial platform is used, those techniques cannot be easily adopted.

This Technical Note describes which performances can be reached using a well-designed board architecture, like DAVE's SDV03 or SDV04 platforms.

It should be taken into account that boot time results strongly depends on the overall system configuration and involves - mainly - the following parameters:

  • u-boot storage device, i.e. from which device the internal iMX6 bootrom fetch the u-boot code
  • linux binaries storage device: i.e. where the kernel and dtb binaries are loaded from for copying them on DDR memory
  • u-boot startup configuration
    • console bootdelay parameter
    • verify binaries
    • loading binaries optimization
  • root file system storage device: i.e. where the rfs is stored (where the INIT process starts from)
  • root file system INIT process optimization: i.e. which daemons are loaded at the beginning

and many other more configuration steps.

In any case, the main involved technical decision is which type of storage device is used for the boot phase. It should be considered that, typically, there are three storage device that can be used and they are:

  • NOR SPI flash: the most reliable one (declared as 0 ppm fault) but the slower one
  • NAND SLC raw flash: a good and cheap device that can be populated on the DAVE's SOMs (depending on the order code) starting from 128MB to 2GB (SLC type)
  • SD or eMMC device: this is the cheaper one (compared to its size respect a similar NAND device) and the fastest one. This kind of device is mounted on the carrier board using an SDIO bus for the communication to the AXEL SOM. Despite its speed, it is the less reliable one compared to NOR or NAND

Serial terminal configuration[edit | edit source]

To verify the boot time achieved, a serial port terminal with timestamping capabilities has been used, like Teraterm

Select from Teraterm the menu: File / Log...

Teraterm-log-menu.png

Select the filename for the log file and enable the timestamp

Teraterm-log-timestamp.png

Use case #1[edit | edit source]

System configuration[edit | edit source]

As stated in the introduction, the solution has been tested on a DAVE's Embedded platform: here below the main characteristics

  • Board: SDV03 equipped with AxelLite SOM
  • SOC: NXP i.MX6 DualLite
  • Flash storage: eMMC
  • U-boot: 2016.03
  • Linux Version: 4.1.15 ( BSP).

The SDV03 boot from an eMMC device on the Carrier board. U-boot is properly configured to reduce the waiting time and just boot loading the binary images from the storage device.

Boot time measure[edit | edit source]

The serial terminal collects all the string from u-boot and linux kernel: at the beginning of each raw the related timestamp is printend before the message

[Thu Oct 04 15:22:30.038 2018] 
[Thu Oct 04 15:22:30.038 2018] U-Boot 2016.03-sdvx-1.0.1 (Oct 03 2018 - 23:08:31 +0200), Build: jenkins-SDVX_U-Boot-5
[Thu Oct 04 15:22:30.038 2018] 
[Thu Oct 04 15:22:30.038 2018] CPU:   Freescale i.MX6DL rev1.3 at 792MHz
[Thu Oct 04 15:22:30.038 2018] CPU:   Industrial temperature grade (-40C to 105C) at 50C
[Thu Oct 04 15:22:30.038 2018] Reset cause: POR
[Thu Oct 04 15:22:30.038 2018] Environment: MMC
[Thu Oct 04 15:22:30.038 2018] I2C:   ready
[Thu Oct 04 15:22:30.038 2018] DRAM:  1 GiB
[Thu Oct 04 15:22:30.038 2018] Relocating to 4ff0c000, new gd at 4df09eb8, sp at 4df09e90
[Thu Oct 04 15:22:30.114 2018] PMIC:  PFUZE100 ID=0x10
[Thu Oct 04 15:22:30.131 2018] NAND:  Board NAND skip
[Thu Oct 04 15:22:30.131 2018] MMC:   WARNING: CB ConfigID on block 0 is UNLOCKED
[Thu Oct 04 15:22:30.209 2018] FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
[Thu Oct 04 15:22:30.334 2018] Display: LDB-AM-800480STMQW-TA1-SDV03 (800x480)
[Thu Oct 04 15:22:30.383 2018] reading splash_image.bmp
[Thu Oct 04 15:22:30.447 2018] 1152054 bytes read in 59 ms (18.6 MiB/s)
[Thu Oct 04 15:22:30.669 2018] In:    serial
[Thu Oct 04 15:22:30.704 2018] Out:   serial
[Thu Oct 04 15:22:30.704 2018] Err:   serial
[Thu Oct 04 15:22:30.704 2018] SOM ConfigID#: 00000001
[Thu Oct 04 15:22:30.704 2018] SOM UniqueID#: e317d7c9:1a0151d4
[Thu Oct 04 15:22:30.704 2018] CB ConfigID#: 0000002a
[Thu Oct 04 15:22:30.704 2018] CB UniqueID#: b100001a:baed182d
[Thu Oct 04 15:22:30.704 2018] Board: MX6DL-AxelLite on SDV03
[Thu Oct 04 15:22:30.858 2018] switch to partitions #0, OK
[Thu Oct 04 15:22:30.858 2018] mmc2(part 0) is current device (eMMC)
[Thu Oct 04 15:22:30.858 2018] flash target is MMC:2
[Thu Oct 04 15:22:30.858 2018] Bad partition index:5 for partition:system
[Thu Oct 04 15:22:30.858 2018] Bad partition index:4 for partition:data
[Thu Oct 04 15:22:30.858 2018] Net:   FEC [PRIME]
[Thu Oct 04 15:22:31.369 2018] Warning: FEC (eth0) using random MAC address - de:b6:b3:f6:69:b5
[Thu Oct 04 15:22:31.403 2018] 
[Thu Oct 04 15:22:31.403 2018] Normal Boot
[Thu Oct 04 15:22:31.403 2018] Hit ENTER within 0 seconds to stop autoboot
[Thu Oct 04 15:22:31.403 2018] reading sdvx-1.0.1_lite_uImage
[Thu Oct 04 15:22:31.642 2018] 6695408 bytes read in 245 ms (26.1 MiB/s)
[Thu Oct 04 15:22:31.661 2018] reading imx6dl-sdv03-cb002a.dtb
[Thu Oct 04 15:22:31.724 2018] 43187 bytes read in 20 ms (2.1 MiB/s)
[Thu Oct 04 15:22:31.724 2018] FDT: override 'som_uniqueid' with 'e317d7c9:1a0151d4'
[Thu Oct 04 15:22:31.724 2018] FDT: override 'cb_uniqueid' with 'b100001a:baed182d'
[Thu Oct 04 15:22:31.724 2018] ## Booting kernel from Legacy Image at 12000000 ...
[Thu Oct 04 15:22:31.724 2018]    Image Name:   Linux-4.1.15-sdvx-1.0.1
[Thu Oct 04 15:22:31.725 2018]    Image Type:   ARM Linux Kernel Image (uncompressed)
[Thu Oct 04 15:22:31.725 2018]    Data Size:    6695344 Bytes = 6.4 MiB
[Thu Oct 04 15:22:31.725 2018]    Load Address: 10008000
[Thu Oct 04 15:22:31.725 2018]    Entry Point:  10008000
[Thu Oct 04 15:22:31.725 2018] ## Flattened Device Tree blob at 18000000
[Thu Oct 04 15:22:31.725 2018]    Booting using the fdt blob at 0x18000000
[Thu Oct 04 15:22:31.725 2018]    Loading Kernel Image ... OK
[Thu Oct 04 15:22:31.756 2018]    reserving fdt memory region: addr=18000000 size=b000
[Thu Oct 04 15:22:31.756 2018]    Using Device Tree in place at 18000000, end 1800dfff
[Thu Oct 04 15:22:31.783 2018] switch to ldo_bypass mode!
[Thu Oct 04 15:22:33.214 2018] Frame buffer: configure splashscreen reserved memory to 0x4e000000 (2 MiB)
[Thu Oct 04 15:22:33.214 2018] WARNING: could not find 2nd splashscreen reserved memory path
[Thu Oct 04 15:22:33.214 2018] 
[Thu Oct 04 15:22:33.214 2018] Starting kernel ...
[Thu Oct 04 15:22:33.214 2018] 
[Thu Oct 04 15:22:34.694 2018] [    1.086794] snvs-secvio 20cc000.caam-snvs: can't get snvs clock
[Thu Oct 04 15:22:34.819 2018] INIT: version 2.88 booting
[Thu Oct 04 15:22:35.140 2018] Starting udev
[Thu Oct 04 15:22:37.105 2018] ALSA: Restoring mixer settings...
[Thu Oct 04 15:22:37.249 2018] INIT: Entering runlevel: 5
[Thu Oct 04 15:22:37.279 2018] Configuring network interfaces... done.
[Thu Oct 04 15:22:37.550 2018] Starting Dropbear SSH server: dropbear.
[Thu Oct 04 15:22:37.598 2018] Starting rpcbind daemon...done.
[Thu Oct 04 15:22:37.678 2018] Starting crond: OK
[Thu Oct 04 15:22:37.712 2018] Running local boot scripts (/etc/rc.local).
[Thu Oct 04 15:22:37.742 2018] Starting tcf-agent: OK
[Thu Oct 04 15:22:37.945 2018] 
[Thu Oct 04 15:22:37.945 2018] Freescale i.MX Release Distro 4.1.15-2.0.1 sdv03-lite /dev/ttymxc2
[Thu Oct 04 15:22:37.945 2018] 
[Thu Oct 04 15:22:37.945 2018] sdv03-lite login: 

Results[edit | edit source]

  • u-boot starts at
15:22:30.038
  • linux kernel starts 3 s from the boot
15:22:33.214 
  • INIT: runlevel 5 is executed after 7s from the boot
15:22:37.249 

and finally the login: is processed after less then 8 s from the boot

Use case #2[edit | edit source]

System configuration[edit | edit source]

  • Board: SDV04 equipped with AXEL ULite SOM
  • SOC: NXP i.MX6 UL
  • Flash storage: SD
  • U-boot: 2016.03
  • Linux Version: 4.1.15 ( BSP).
  • root file system: development rfs (bz2 tarball to be extracted around 292MB)

The SDV04 boot from an microSD card inserted on the Carrier board slot. U-boot is properly configured to reduce the waiting time and just boot loading the binary images from the storage device.

Boot time measure[edit | edit source]

The serial terminal collects all the string from u-boot and linux kernel: at the beginning of each raw the related timestamp is printend before the message

[2020-04-08 13:28:00.246] 
[2020-04-08 13:28:00.246] 
[2020-04-08 13:28:00.246] U-Boot 2016.03-sdvx-1.0.5 (Mar 11 2020 - 00:01:49 +0100), Build: sdvx-1.0.5
[2020-04-08 13:28:00.271] 
[2020-04-08 13:28:00.271] CPU:   Freescale i.MX6UL rev1.2 528 MHz (running at 396 MHz)
[2020-04-08 13:28:00.271] CPU:   Industrial temperature grade (-40C to 105C) at 43C
[2020-04-08 13:28:00.271] Reset cause: POR
[2020-04-08 13:28:00.295] Environment: MMC
[2020-04-08 13:28:00.295] I2C:   ready
[2020-04-08 13:28:00.295] DRAM:  256 MiB
[2020-04-08 13:28:00.295] Relocating to 8ff1b000, new gd at 8ef18eb8, sp at 8ef18e90
[2020-04-08 13:28:00.375] PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
[2020-04-08 13:28:00.375] NAND:  128 MiB
[2020-04-08 13:28:00.393] MMC:   FSL_SDHC: 0
[2020-04-08 13:28:00.486] Display: DSAM-07X0ETX07TG1I05 (1024x600)
[2020-04-08 13:28:00.486] Video: 1024x600x18
[2020-04-08 13:28:00.509] reading splash_image.bmp
[2020-04-08 13:28:00.599] 1843254 bytes read in 95 ms (18.5 MiB/s)
[2020-04-08 13:28:00.679] In:    serial
[2020-04-08 13:28:00.695] Out:   serial
[2020-04-08 13:28:00.695] Err:   serial
[2020-04-08 13:28:00.797] switch to partitions #0, OK
[2020-04-08 13:28:00.797] mmc0 is current device (SD)
[2020-04-08 13:28:00.797] SOM ConfigID#: 00000014
[2020-04-08 13:28:00.797] SOM UniqueID#: ea9b89dd:113249d4
[2020-04-08 13:28:00.797] CB ConfigID#: 00000042
[2020-04-08 13:28:00.797] CB UniqueID#: 00000000:00000000
[2020-04-08 13:28:00.797] Board: MX6UL AXEL ULite rev.A on SFCZG
[2020-04-08 13:28:00.987] Net:   FEC0
[2020-04-08 13:28:00.987] Warning: FEC0 (eth0) using random MAC address - 6e:53:41:a0:e0:8e
[2020-04-08 13:28:01.009] 
[2020-04-08 13:28:01.009] Normal Boot
[2020-04-08 13:28:01.009] Hit any key to stop autoboot:  0 
[2020-04-08 13:28:01.009] reading sdvx-1.0.5_ul_uImage
[2020-04-08 13:28:01.331] 7124368 bytes read in 325 ms (20.9 MiB/s)
[2020-04-08 13:28:01.347] reading sdvx-1.0.5_ul_imx6ul-axelulite-cb0042.dtb
[2020-04-08 13:28:01.364] 33507 bytes read in 21 ms (1.5 MiB/s)
[2020-04-08 13:28:01.411] FDT: override 'som_uniqueid' with 'ea9b89dd:113249d4'
[2020-04-08 13:28:01.411] FDT: override 'cb_uniqueid' with '00000000:00000000'
[2020-04-08 13:28:01.411] ## Booting kernel from Legacy Image at 80800000 ...
[2020-04-08 13:28:01.411]    Image Name:   Linux-4.1.15-sdvx-1.0.5
[2020-04-08 13:28:01.411]    Image Type:   ARM Linux Kernel Image (uncompressed)
[2020-04-08 13:28:01.411]    Data Size:    7124304 Bytes = 6.8 MiB
[2020-04-08 13:28:01.411]    Load Address: 80008000
[2020-04-08 13:28:01.411]    Entry Point:  80008000
[2020-04-08 13:28:01.411]    Verifying Checksum ... OK
[2020-04-08 13:28:01.540] ## Flattened Device Tree blob at 83000000
[2020-04-08 13:28:01.563]    Booting using the fdt blob at 0x83000000
[2020-04-08 13:28:01.563]    Loading Kernel Image ... OK
[2020-04-08 13:28:01.624]    reserving fdt memory region: addr=83000000 size=9000
[2020-04-08 13:28:01.665]    Using Device Tree in place at 83000000, end 8300bfff
[2020-04-08 13:28:01.665] Modify /soc/aips-bus@02000000/bee@02044000:status disabled
[2020-04-08 13:28:01.665] ft_system_setup for mx6
[2020-04-08 13:28:01.665] 
[2020-04-08 13:28:01.665] Starting kernel ...
[2020-04-08 13:28:01.665] 
[2020-04-08 13:28:02.517] [    0.495677] gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in set feature.
[2020-04-08 13:28:04.370] INIT: version 2.88 booting
[2020-04-08 13:28:04.866] Starting udev
[2020-04-08 13:28:06.046] bootlogd: cannot allocate pseudo tty: No such file or directory
[2020-04-08 13:28:07.405] INIT: Entering runlevel: 5
[2020-04-08 13:28:07.533] Configuring network interfaces... done.
[2020-04-08 13:28:07.982] Starting system message bus: dbus.
[2020-04-08 13:28:08.125] Starting Dropbear SSH server: dropbear.
[2020-04-08 13:28:08.190] Starting rpcbind daemon...done.
[2020-04-08 13:28:08.303] starting statd: done
[2020-04-08 13:28:08.428] Starting system log daemon...0
[2020-04-08 13:28:08.492] Starting kernel log daemon...0
[2020-04-08 13:28:09.356] Starting internet superserver: xinetd.
[2020-04-08 13:28:09.469]  * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
[2020-04-08 13:28:09.758]  *[fail]
[2020-04-08 13:28:09.791] Starting crond: OK
[2020-04-08 13:28:09.936] Starting tcf-agent: OK
[2020-04-08 13:28:10.200] 
[2020-04-08 13:28:10.200] Freescale i.MX Release Distro 4.1.15-2.0.1 sdvx-ul /dev/ttymxc0
[2020-04-08 13:28:10.200] 
[2020-04-08 13:28:10.200] sdvx-ul login: 

Results[edit | edit source]

  • u-boot starts at
13:28:00.246
  • linux kernel starts 1.4 s from the boot
13:28:01.665
  • INIT: runlevel 5 is executed after 7s from the boot
13:28:07.405 

and finally the login: is processed after 10 s from the boot

Use case #3[edit | edit source]

System configuration[edit | edit source]

  • Board: SDV04 equipped with AXEL ULite SOM
  • SOC: NXP i.MX6 UL
  • Flash storage: 128 MB SLC NAND
  • U-boot: 2016.03
  • Linux Version: 4.1.15 ( BSP).
  • root file system: minimal Qt5 rfs (bz2 tarball to be extracted around 42MB)

The SDV04 boot from the SOM's onboard NAND flash . U-boot is properly configured to reduce the waiting time and just boot loading the binary images from the NAND device once the UBI fs parameters have been correctly passed to the kernel command line.

Boot time measure[edit | edit source]

[2020-04-08 17:00:00.354] 
[2020-04-08 17:00:00.354] U-Boot 2016.03-sdvx-1.0.5 (Apr 08 2020 - 16:52:44 +0200)
[2020-04-08 17:00:00.382] 
[2020-04-08 17:00:00.382] CPU:   Freescale i.MX6UL rev1.2 528 MHz (running at 396 MHz)
[2020-04-08 17:00:00.382] CPU:   Industrial temperature grade (-40C to 105C) at 45C
[2020-04-08 17:00:00.382] Reset cause: POR
[2020-04-08 17:00:00.416] Environment: NAND
[2020-04-08 17:00:00.416] I2C:   ready
[2020-04-08 17:00:00.416] DRAM:  256 MiB
[2020-04-08 17:00:00.416] Relocating to 8ff1a000, new gd at 8eef9eb8, sp at 8eef9e90
[2020-04-08 17:00:00.483] PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
[2020-04-08 17:00:00.483] NAND:  128 MiB
[2020-04-08 17:00:00.483] MMC:   FSL_SDHC: 0
[2020-04-08 17:00:00.654] Display: DSAM-07X0ETX07TG1I05 (1024x600)
[2020-04-08 17:00:00.654] Video: 1024x600x18
[2020-04-08 17:00:00.654] 
[2020-04-08 17:00:00.654] NAND read: device 0 offset 0x1400000, size 0x1c2036
[2020-04-08 17:00:00.768]  1843254 bytes read: OK
[2020-04-08 17:00:00.782] In:    serial
[2020-04-08 17:00:00.782] Out:   serial
[2020-04-08 17:00:00.782] Err:   serial
[2020-04-08 17:00:00.894] switch to partitions #0, OK
[2020-04-08 17:00:00.894] mmc0 is current device (SD)
[2020-04-08 17:00:00.894] SOM ConfigID#: 00000014
[2020-04-08 17:00:00.894] SOM UniqueID#: ea9b89dd:113249d4
[2020-04-08 17:00:00.894] CB ConfigID#: 00000042
[2020-04-08 17:00:00.894] CB UniqueID#: 00000000:00000000
[2020-04-08 17:00:00.894] Board: MX6UL AXEL ULite rev.A on SFCZG
[2020-04-08 17:00:01.088] Net:   FEC0
[2020-04-08 17:00:01.088] Warning: FEC0 (eth0) using random MAC address - 16:af:d1:f3:8a:cf
[2020-04-08 17:00:01.114] 
[2020-04-08 17:00:01.114] Normal Boot
[2020-04-08 17:00:01.114] Hit any key to stop autoboot:  0 
[2020-04-08 17:00:01.114] 
[2020-04-08 17:00:01.114] NAND read: device 0 offset 0xc00000, size 0x6cb590
[2020-04-08 17:00:01.497]  7124368 bytes read: OK
[2020-04-08 17:00:01.521] 
[2020-04-08 17:00:01.521] NAND read: device 0 offset 0xa00000, size 0x100000
[2020-04-08 17:00:01.622]  1048576 bytes read: OK
[2020-04-08 17:00:01.622] FDT: override 'som_uniqueid' with 'ea9b89dd:113249d4'
[2020-04-08 17:00:01.622] FDT: override 'cb_uniqueid' with '00000000:00000000'
[2020-04-08 17:00:01.622] ## Booting kernel from Legacy Image at 80800000 ...
[2020-04-08 17:00:01.622]    Image Name:   Linux-4.1.15-sdvx-1.0.5
[2020-04-08 17:00:01.622]    Image Type:   ARM Linux Kernel Image (uncompressed)
[2020-04-08 17:00:01.622]    Data Size:    7124304 Bytes = 6.8 MiB
[2020-04-08 17:00:01.622]    Load Address: 80008000
[2020-04-08 17:00:01.622]    Entry Point:  80008000
[2020-04-08 17:00:01.622]    Verifying Checksum ... OK
[2020-04-08 17:00:01.751] ## Flattened Device Tree blob at 83000000
[2020-04-08 17:00:01.783]    Booting using the fdt blob at 0x83000000
[2020-04-08 17:00:01.783]    Loading Kernel Image ... OK
[2020-04-08 17:00:01.836]    reserving fdt memory region: addr=83000000 size=9000
[2020-04-08 17:00:01.870]    Using Device Tree in place at 83000000, end 8300bfff
[2020-04-08 17:00:01.870] Modify /soc/aips-bus@02000000/bee@02044000:status disabled
[2020-04-08 17:00:01.870] ft_system_setup for mx6
[2020-04-08 17:00:01.870] 
[2020-04-08 17:00:01.870] Starting kernel ...
[2020-04-08 17:00:01.870] 
[2020-04-08 17:00:02.736] [    0.495967] gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in set feature.
[2020-04-08 17:00:06.258] INIT: version 2.88 booting
[2020-04-08 17:00:07.220] Starting udev
[2020-04-08 17:00:08.627] bootlogd: cannot allocate pseudo tty: No such file or directory
[2020-04-08 17:00:10.007] Wed Apr  8 16:39:50 UTC 2020
[2020-04-08 17:00:10.037] INIT: Entering runlevel: 5
[2020-04-08 17:00:10.163] Configuring network interfaces... done.
[2020-04-08 17:00:10.628] Starting system message bus: dbus.
[2020-04-08 17:00:11.193] Starting OpenBSD Secure Shell server: sshd
[2020-04-08 17:00:11.577] done.
[2020-04-08 17:00:11.668] Starting ntpd: done
[2020-04-08 17:00:12.116] Starting syslogd/klogd: done
[2020-04-08 17:00:12.277] Starting crond: OK
[2020-04-08 17:00:12.567] 
[2020-04-08 17:00:12.588] Freescale i.MX Release Distro 4.1.15-2.0.1 sfczg-ul /dev/ttymxc0
[2020-04-08 17:00:12.588] 
[2020-04-08 17:00:12.588] sfczg-ul login: 

Results[edit | edit source]

  • u-boot starts at
17:00:00.354
  • linux kernel starts 1.5s from the boot
17:00:01.870
  • INIT: runlevel 5 is executed after 9s from the boot
17:00:10.037 

and finally the login: is processed after 12.3 s from the boot