Skip to main content

Boot times

Summary

The table below lists the boot times measured for the Embedded Artists iMX 6/7/8 COM boards. The value is the number of milliseconds since the processor starts executing after a reset. Each row represents a time point / measurement point during boot and the Time points explained section explains these in more detail.

Please note that this is the times measured during one test run for one specific build for the specific target. The boot time can naturally change between different runs as well as for different builds. Only one boot time optimization has been applied and that is the U-Boot boot delay set to zero. This optimization was applied to be able to better compare the boot times between the different boards since the default boot delay can be different for different boards.

Build details:

  • Date: 2020-09-17
  • Linux: 5.4.24
  • U-Boot: 2020.04
  • meta-ea commit: d5dcc59ee673ad99e99da892f79ce0966f1c3b61
Time pointiMX8M MiniiMX8M NanoiMX8MiMX6 QuadiMX6 DualLiteiMX6 SoloXiMX6 UltraLiteiMX7 Dual COMiMX7 Dual uCOMiMX7ULP
SPL: board_init_f15316827540210312711510293-
U-Boot: board_ early_init_f136410301250851534504447419418-
U-Boot: board_init1597124315181024632590529484485889
U-Boot: Starting kernel2959268228462044162715701485141914181697
Linux: Init process6084579260346434550258205235462255435447
Linux: Basic service8021776079251080910595126641723594191080817728
Linux: Login prompt10459124791064313419134701596122532120441296523509

Time points explained

SPL: board_init_f

This is the time when entering into the board_init_f function in SPL (Secondary Program Loader). This is basically the first board specific code being executed after a reset. If you need to do really early initialization of your hardware this is where you can add that code.

U-Boot: board_early_init_f

This is the time when entering into the board_early_init_f function in U-Boot. This function is located in the board specific code, for example, board/embeddedartists/mx8mmea-ucom/mx8mmea-ucom.c for the iMX8M Mini uCOM board.

U-Boot: Starting kernel...

This is the time point where U-Boot begins to prepare for booting the Linux kernel. In the console you will see the output Starting kernel .... This output is available in the function announce_and_cleanup in the file arch/arm/lib/bootm.c.

Linux: Init process

This is the time point where the user-space process init is started. In the console you can look for the message Freeing unused kernel since this is the last message before the init process is started.

This is basically the earliest time where you could have your application started. If you know what you are doing and your application is independent of the rest of the system you could start your application here. In general, it is however not recommended to exchange the init process with your application.

Linux: Basic service

This is the time point where a systemd service is started that have been configured to start after the basic target.

For more information about systemd see: https://www.freedesktop.org/wiki/Software/systemd/.

[Unit]
Description=EA after basic.target
After=basic.target

[Service]
StandardOutput=tty
Type=oneshot
ExecStart=/home/root/myoutput.sh "after basic.target"

[Install]
WantedBy=basic.target

Linux: Login prompt

This is the time point where the login prompt is available and you can login to the console.

NXP i.MX Release Distro 5.4-zeus imx8mmea-ucom ttymxc1

imx8mmea-ucom login:

How was it measured

U-Boot

A logic analyzer was used to detect when a GPIO (pin) was toggled to measure the elapsed time to a specific point in the U-Boot code. The RESET_OUT signal was used as a starting point for the measurement. The signals were measured on the expansion board connected to the COM Carrier board V2.

Logic Analyzer

The table below specifies which GPIO has been used for a specific board when measuring elapsed time.

ProcessorCarrier boardExpansion board
iMX8M Mini uCOMGPIO 2.10GPIO_AJJ48-9
iMX8M Nano uCOMGPIO 2.10GPIO_AJJ48-9
iMX8M Quad COMGPIO 3.15GPIO_AFJ48-84
iMX6 Quad COMGPIO 4.08GPIO_AJJ48-9
iMX6 DualLite COMGPIO 4.08GPIO_AJJ48-9
iMX6 SoloX COMGPIO 4.27GPIO_PJ48-91
iMX6 UltraLite COMGPIO 4.11GPIO_PJ48-91
iMX7 Dual COMGPIO 2.18GPIO_AJJ48-9
iMX7 Dual uCOMGPIO 2.18GPIO_AJJ48-9
iMX7ULP uCOMPTE6GPIO_AJJ48-9

Linux

In Linux, elapsed time has been measured using timestamps in the console application Tera Term.

Below is part of a log captured by Tera Term. Each line begins with a timestamp that can be used to calculate elapsed time between different events. For example, the output Starting kernel (which comes from U-Boot) is at timestamp 16922 ms and Freeing unused... is at 20047 ms meaning that the elapsed time between these two events is 3125 ms. We also know the time from reset to Starting kernel from the measurement in U-Boot, for example, 2959 ms for iMX8M Mini as shown in the table in section Summary above. We can now calculate time from reset to Freeing unused... by taking 3125 + 2959 = 6084 ms.

[0 00:00:16.0750] 39710 bytes read in 11 ms (3.4 MiB/s)
[0 00:00:16.0922] 28293632 bytes read in 143 ms (188.7 MiB/s)
[0 00:00:16.0922] ## Flattened Device Tree blob at 43000000
[0 00:00:16.0922] Booting using the fdt blob at 0x43000000
[0 00:00:16.0922] Loading Device Tree to 000000007d514000, end
[0 00:00:16.0922]
[0 00:00:16.0922] Starting kernel ...
[0 00:00:16.0922]
...
[0 00:00:20.0047] [ 2.801712] Freeing unused kernel memory: 2944K
[0 00:00:20.0047] [ 2.823429] Run /sbin/init as init process
...
[0 00:00:24.0422] imx8mmea-ucom login:

Capturing a log with timestamps in Tera Term

In Tera Term go to the File menu and then click Log as shown in the figure below.

Log option in Tera Term

In the Log Dialog select where to save the log, click Timestamp in the Option section and also select Elapsed Time (Logging) in the drop-down menu. This is shown in the figure below.

Log dialog in Tera Term