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