1 Introduction
This document presents a possible approach to measure the boot time on the
i.MX 8M platforms using the GPIO pins.
The main objectives of this document are as follows:
Modifying the bootloader and system image for measuring
Setting up the board and the external logic analyzer tool
Achieving short boot times
1.1 Software environment
Linux BSP release 5.4.70_2.3.0 is used to perform all the measurements. The imx-image-core Yocto image is used during
the experiments.
1.2 Hardware setup and equipment
Development kits:
NXP i.MX 8MQ EVK LPDDR4
NXP i.MX 8MP EVK LPDDR4
NXP i.MX 8MM EVK LPDDR4
NXP i.MX 8MN EVK LPDDR4
Micro SD card. SanDisk Ultra 32 GB Micro SDHC I Class 10 is used for the current experiment.
Micro-USB cable for the debug port.
USB Type-C cable for data transfer.
Logic analyzer with the following minimum requirements to measure the times: 4 channels and 10 MS/s. Saleae Logic 8 is
used for the current experiment.
Breadboard and FPC to 60x0.5 Extension Board (only for i.MX8 MQ).
2 General description
This section describes the general procedure that must be performed to obtain a baseline measurement for a clean system (with
no startup optimizations).
2.1 Choosing the GPIO pin for measurement
Use a general-purpose pin to generate a pulse signal at different booting phases. The desired GPIO pin is ideally chosen from
those that are not used in either the bootloader or Linux; this can be checked in the associated device tree.
If this is not possible, disable the peripheral module that uses the pin in the next step. It is highly recommended to choose a pin
from the expansion connector on the board.
Contents
1 Introduction......................................1
2 General description......................... 1
3 Examples.........................................2
4 Further optimizations.....................37
5 References....................................47
6 Revision history.............................47
AN13369
i.MX 8M Family - Boot Time Measurements Methodology
Rev. 0 — 07 September 2021
Application Note
2.2 Updating the device tree at the bootloader and Linux level
After you choose the desired pin, make some modifications at the device-tree level.
Firstly, the functionalities of the desired pin are checked to find out the macros associated with the GPIO functionality. The header
files are at different location, depending on the board used.
Secondly, if a pin is used by some other peripheral modules, disable the respective module. This is done by setting the status
property to “disabled” in the configuration info for that peripheral module.
Thirdly, the adequate pin muxing is defined in the pinctrl_hog section, using the GPIO macro for the chosen pin and the
pad-configuration values (IOMUXC_SW_PAD_CTL_PAD_*).
2.3 Adding the first pulse generator
The first period measured is between the board POR and the execution of the board_init_f function of the SPL part of the
bootloader. To generate a pulse, configure the pin as the output. After this, you can drive the pin high for a short time and then
you can drive it low. You can do this without delay, because only the rising edge of the pulse is necessary.
2.4 Adding the second pulse generator
The second period measured is between the execution of the board_init_f function of the SPL part of the bootloader and before
loading the kernel image from the U-Boot console. You can toggle that here using the U-Boot GPIO commands, which can be
written in the board configuration file, located in the /include/configs folder.
2.5 Adding the third pulse generator
The third period measured is between loading the kernel image from the U-Boot console and starting the psplash program, which
uses the frame buffer to show the relevant content on the display. To change the GPIO output state, add the libgpiod package
to the psplash Yocto recipe. After adding the libgpiod package, the gpiod functions are added to the psplash code to generate
a pulse right before the program uses the frame buffer for the first time.
2.6 Measuring the total time with the logic analyzer
The measurement stage can begin after building and flashing both the bootloader and Linux image to the board.
The boot-time is measured by starting the recording mode on the logic analyzer software and applying the reset button on the
board. The recording stops after the third rising edge on the chosen GPIO pin. The elapsed boot time is the time between the rising
edge of the nRST signal and the third rising edge of the GPIO pin.
3 Examples
3.1 i.MX 8M Quad
Choosing the pins
The chosen pin is the 19
th
pin on the J1801 expansion connector on the specified board. In the schematics for the baseboard,
the pin is used for the SAI 1 peripheral with the SAI1_RXFS function. Searching the specified pad in the reference manual for the
associated pin returns an alternate function of GPIO4_IO[0].
NXP Semiconductors
Examples
i.MX 8M Family - Boot Time Measurements Methodology, Rev. 0, 07 September 2021
Application Note 2 / 48