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 point | iMX8M Mini | iMX8M Nano | iMX8M | iMX6 Quad | iMX6 DualLite | iMX6 SoloX | iMX6 UltraLite | iMX7 Dual COM | iMX7 Dual uCOM | iMX7ULP |
---|---|---|---|---|---|---|---|---|---|---|
SPL: board_init_f | 153 | 168 | 275 | 402 | 103 | 127 | 115 | 102 | 93 | - |
U-Boot: board_ early_init_f | 1364 | 1030 | 1250 | 851 | 534 | 504 | 447 | 419 | 418 | - |
U-Boot: board_init | 1597 | 1243 | 1518 | 1024 | 632 | 590 | 529 | 484 | 485 | 889 |
U-Boot: Starting kernel | 2959 | 2682 | 2846 | 2044 | 1627 | 1570 | 1485 | 1419 | 1418 | 1697 |
Linux: Init process | 6084 | 5792 | 6034 | 6434 | 5502 | 5820 | 5235 | 4622 | 5543 | 5447 |
Linux: Basic service | 8021 | 7760 | 7925 | 10809 | 10595 | 12664 | 17235 | 9419 | 10808 | 17728 |
Linux: Login prompt | 10459 | 12479 | 10643 | 13419 | 13470 | 15961 | 22532 | 12044 | 12965 | 23509 |
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.
The table below specifies which GPIO has been used for a specific board when measuring elapsed time.
Processor | Carrier board | Expansion board | |
---|---|---|---|
iMX8M Mini uCOM | GPIO 2.10 | GPIO_AJ | J48-9 |
iMX8M Nano uCOM | GPIO 2.10 | GPIO_AJ | J48-9 |
iMX8M Quad COM | GPIO 3.15 | GPIO_AF | J48-84 |
iMX6 Quad COM | GPIO 4.08 | GPIO_AJ | J48-9 |
iMX6 DualLite COM | GPIO 4.08 | GPIO_AJ | J48-9 |
iMX6 SoloX COM | GPIO 4.27 | GPIO_P | J48-91 |
iMX6 UltraLite COM | GPIO 4.11 | GPIO_P | J48-91 |
iMX7 Dual COM | GPIO 2.18 | GPIO_AJ | J48-9 |
iMX7 Dual uCOM | GPIO 2.18 | GPIO_AJ | J48-9 |
iMX7ULP uCOM | PTE6 | GPIO_AJ | J48-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.
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.