Changes

Jump to: navigation, search

SDVX-TN-001: Fast boot time

12,287 bytes added, 13:17, 8 April 2020
no edit summary
|October 2018
|First public release
|-
|1.1.0
|April 2020
|Added iMX6UL cases
|}
==Introduction==
When using Linux embedded platforms, boot time is an important performance to take into account. Many indication indications or examples can be found on Internet but when a ''real case'' where an <code>industrial platform</code> 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 SDV03or SDV04''' platformplatforms.
==Testbed==It should be taken into account that <i>boot time</i> results strongly depends on the overall system configuration and involves - mainly - the following parameters:As stated in * u-boot storage device, i.e. from which device the internal iMX6 bootrom fetch the introduction, u-boot code* linux binaries storage device: i.e. where the solution has been tested kernel and dtb binaries are loaded from for copying them on a DAVEDDR memory* u-boot startup configuration** console ''bootdelay'' parameter** 's Embedded platform'verify'' binaries** loading binaries optimization* root file system storage device: here below i.e. where the rfs is stored (where the main characteristicsINIT process starts from)* root file system INIT process optimization: i.e. which daemons are loaded at the beginning and many other more configuration steps.
* Board: [[SDV03|SDV03]] equipped with [[:Category:AxelLite|AxelLite]] SOM* SOC: NXP i.MX6 DualLite* Flash In any case, the main involved technical decision is which type of storage: eMMC* U-device is used for the boot: 2016phase.03* Linux VersionIt should be considered that, typically, there are three storage device that can be used and they are: 4.1.15 ([[SDV04_Embedded_Linux_Kit_(SDVX)#SDVX_software_components | BSP]]).
To verify * '''NOR''' SPI flash: the boot time achieved, most reliable one (declared as 0 ppm fault) but the slower one* '''NAND''' SLC raw flash: a serial port terminal with timestamping capabilities has been used, like [httpsgood 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://ttssh2this is the cheaper one (compared to its size respect a similar NAND device) and the fastest one.osdnThis kind of device is mounted on the carrier board using an SDIO bus for the communication to the AXEL SOM.jp/index.html.en Teraterm]Despite its speed, it is the less reliable one compared to NOR or NAND
== Serial terminal configuration ==
To verify the boot time achieved, a serial port terminal with timestamping capabilities has been used, like [https://ttssh2.osdn.jp/index.html.en Teraterm] Select form from Teraterm the menu: File / Log...
[[File:Teraterm-log-menu.png |thumb|center|600px]]
[[File:Teraterm-log-timestamp.png |thumb|center|600px]]
==Use case #1 ===== System configuration ===As stated in the introduction, the solution has been tested on a DAVE's Embedded platform: here below the main characteristics * Board: [[SDV03|SDV03]] equipped with [[:Category:AxelLite|AxelLite]] SOM* SOC: NXP i.MX6 DualLite* Flash storage: eMMC* U-boot: 2016.03* Linux Version: 4.1.15 ([[SDV04_Embedded_Linux_Kit_(SDVX)#SDVX_software_components | BSP]]). The [[SDV03|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 ===
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
<pre class="boardworkstation-terminal">
[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
</pre>
=== Results ===
* u-boot starts at
and finally the <code>login:</code> is processed after '''less then 8 s''' from the boot
 
==Use case #2 ==
 
=== System configuration ===
 
* Board: [[SDV04|SDV04]] equipped with [[:Category:AXEL_ULite|AXEL ULite]] SOM
* SOC: NXP i.MX6 UL
* Flash storage: SD
* U-boot: 2016.03
* Linux Version: 4.1.15 ([[SDV04_Embedded_Linux_Kit_(SDVX)#SDVX_software_components | BSP]]).
 
The [[SDV04|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 ===
 
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
<pre class="workstation-terminal">
[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:
</pre>
 
=== Results ===
 
* u-boot starts at
 
13:28:00.246
 
* linux kernel starts <b>1.4 s</b> from the boot
 
13:28:01.665
 
* INIT: runlevel 5 is executed after <b>7s</b> from the boot
 
13:28:07.405
 
and finally the <code>login:</code> is processed after '''10 s''' from the boot
 
==Use case #3 ==
 
=== System configuration ===
 
* Board: [[SDV04|SDV04]] equipped with [[:Category:AXEL_ULite|AXEL ULite]] SOM
* SOC: NXP i.MX6 UL
* Flash storage: 128 MB SLC NAND
**
* U-boot: 2016.03
* Linux Version: 4.1.15 ([[SDV04_Embedded_Linux_Kit_(SDVX)#SDVX_software_components | BSP]]).
 
The [[SDV04|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 ===
 
<pre class="workstation-terminal">
[2020-04-08 15:03:00.206]
[2020-04-08 15:03:00.206]
[2020-04-08 15:03:00.206] U-Boot 2016.03-sdvx-1.0.5 (Mar 11 2020 - 00:01:49 +0100), Build: sdvx-1.0.5
[2020-04-08 15:03:00.206]
[2020-04-08 15:03:00.206] CPU: Freescale i.MX6UL rev1.2 528 MHz (running at 396 MHz)
[2020-04-08 15:03:00.206] CPU: Industrial temperature grade (-40C to 105C) at 50C
[2020-04-08 15:03:00.206] Reset cause: POR
[2020-04-08 15:03:00.206] Environment: MMC
[2020-04-08 15:03:00.206] I2C: ready
[2020-04-08 15:03:00.225] DRAM: 256 MiB
[2020-04-08 15:03:00.225] Relocating to 8ff1b000, new gd at 8ef18eb8, sp at 8ef18e90
[2020-04-08 15:03:00.320] PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
[2020-04-08 15:03:00.320] NAND: 128 MiB
[2020-04-08 15:03:00.320] MMC: FSL_SDHC: 0
[2020-04-08 15:03:00.414] Display: DSAM-07X0ETX07TG1I05 (1024x600)
[2020-04-08 15:03:00.414] Video: 1024x600x18
[2020-04-08 15:03:00.438] reading splash_image.bmp
[2020-04-08 15:03:00.526] 1843254 bytes read in 95 ms (18.5 MiB/s)
[2020-04-08 15:03:00.606] In: serial
[2020-04-08 15:03:00.621] Out: serial
[2020-04-08 15:03:00.621] Err: serial
[2020-04-08 15:03:00.725] switch to partitions #0, OK
[2020-04-08 15:03:00.725] mmc0 is current device (SD)
[2020-04-08 15:03:00.725] SOM ConfigID#: 00000014
[2020-04-08 15:03:00.725] SOM UniqueID#: ea9b89dd:113249d4
[2020-04-08 15:03:00.725] CB ConfigID#: 00000042
[2020-04-08 15:03:00.725] CB UniqueID#: 00000000:00000000
[2020-04-08 15:03:00.725] Board: MX6UL AXEL ULite rev.A on SFCZG
[2020-04-08 15:03:00.916] Net: FEC0
[2020-04-08 15:03:00.916] Warning: FEC0 (eth0) using random MAC address - 8a:54:02:e5:1f:1a
[2020-04-08 15:03:00.943]
[2020-04-08 15:03:00.943] Normal Boot
[2020-04-08 15:03:00.943] Hit any key to stop autoboot: 0
[2020-04-08 15:03:00.943]
[2020-04-08 15:03:00.943] NAND read: device 0 offset 0xc00000, size 0x800000
[2020-04-08 15:03:01.528] 8388608 bytes read: OK
[2020-04-08 15:03:01.528]
[2020-04-08 15:03:01.528] NAND read: device 0 offset 0xa00000, size 0x100000
[2020-04-08 15:03:01.630] 1048576 bytes read: OK
[2020-04-08 15:03:01.630] FDT: override 'som_uniqueid' with 'ea9b89dd:113249d4'
[2020-04-08 15:03:01.630] FDT: override 'cb_uniqueid' with '00000000:00000000'
[2020-04-08 15:03:01.630] ## Booting kernel from Legacy Image at 80800000 ...
[2020-04-08 15:03:01.630] Image Name: Linux-4.1.15-sdvx-1.0.5
[2020-04-08 15:03:01.630] Image Type: ARM Linux Kernel Image (uncompressed)
[2020-04-08 15:03:01.630] Data Size: 7124304 Bytes = 6.8 MiB
[2020-04-08 15:03:01.630] Load Address: 80008000
[2020-04-08 15:03:01.630] Entry Point: 80008000
[2020-04-08 15:03:01.630] Verifying Checksum ... OK
[2020-04-08 15:03:01.759] ## Flattened Device Tree blob at 83000000
[2020-04-08 15:03:01.780] Booting using the fdt blob at 0x83000000
[2020-04-08 15:03:01.780] Loading Kernel Image ... OK
[2020-04-08 15:03:01.842] reserving fdt memory region: addr=83000000 size=9000
[2020-04-08 15:03:01.876] Using Device Tree in place at 83000000, end 8300bfff
[2020-04-08 15:03:01.876] Modify /soc/aips-bus@02000000/bee@02044000:status disabled
[2020-04-08 15:03:01.876] ft_system_setup for mx6
[2020-04-08 15:03:01.876]
[2020-04-08 15:03:01.876] Starting kernel ...
[2020-04-08 15:03:01.876]
[2020-04-08 15:03:02.747] [ 0.495057] gpmi-nand 1806000.gpmi-nand: mode:4 ,failed in set feature.
[2020-04-08 15:03:06.204] INIT: version 2.88 booting
[2020-04-08 15:03:07.180] Starting udev
[2020-04-08 15:03:08.731] bootlogd: cannot allocate pseudo tty: No such file or directory
[2020-04-08 15:03:10.036] INIT: Entering runlevel: 5
[2020-04-08 15:03:10.160] Configuring network interfaces... done.
[2020-04-08 15:03:10.638] Starting system message bus: dbus.
[2020-04-08 15:03:11.205] Starting OpenBSD Secure Shell server: sshd
[2020-04-08 15:03:11.584] done.
[2020-04-08 15:03:11.696] Starting ntpd: done
[2020-04-08 15:03:12.096] Starting syslogd/klogd: done
[2020-04-08 15:03:12.303] Starting crond: OK
[2020-04-08 15:03:12.570]
[2020-04-08 15:03:12.570] Freescale i.MX Release Distro 4.1.15-2.0.1 sfczg-ul /dev/ttymxc0
[2020-04-08 15:03:12.570]
[2020-04-08 15:03:12.570] sfczg-ul login:
</pre>
 
=== Results ===
 
* u-boot starts at
 
15:03:00.206
 
* linux kernel starts <b>1.6s</b> from the boot
 
15:03:01.876
 
* INIT: runlevel 5 is executed after <b>7s</b> from the boot
 
15:03:10.036
 
and finally the <code>login:</code> is processed after '''12.5 s''' from the boot
8,146
edits

Navigation menu