Imx Linux Users Guide
Imx Linux Users Guide
Document information
Information Content
Keywords i.MX, Linux, LF6.1.1_1.0.0
Abstract This document describes how to build and install the i.MX Linux OS BSP, where BSP stands for
Board Support Package, on the i.MX platform. It also covers special i.MX features and how to use
them.
NXP Semiconductors
IMXLUG
i.MX Linux User's Guide
1 Overview
This document describes how to build and install the i.MX Linux OS BSP, where BSP stands for Board Support
Package, on the i.MX platform. It also covers special i.MX features and how to use them.
The document also provides the steps to run the i.MX platform, including board DIP switch settings, and
instructions on configuring and using the U-Boot bootloader.
The later chapters describe how to use some i.MX special features when running the Linux OS kernel.
Features covered in this guide may be specific to particular boards or SoCs. For the capabilities of a particular
board or SoC, see the i.MX Linux Release Notes (IMXLXRN).
1.1 Audience
This document is intended for software, hardware, and system engineers who are planning to use the product,
and for anyone who wants to know more about the product.
1.2 Conventions
This document uses the following conventions:
• Courier New font: This font is used to identify commands, explicit command parameters, code examples,
expressions, data types, and directives.
1.4 References
i.MX has multiple families supported in software. The following are the listed families and SoCs per family. The
i.MX Linux Release Notes describes which SoC is supported in the current release. Some previously released
SoCs might be buildable in the current release but not validated if they are at the previous validated level.
• i.MX 6 Family: 6QuadPlus, 6Quad, 6DualLite, 6SoloX, 6SLL, 6UltraLite, 6ULL, 6ULZ
• i.MX 7 Family: 7Dual, 7ULP
• i.MX 8 Family: 8QuadMax, 8ULP
• i.MX 8M Family: 8M Plus, 8M Quad, 8M Mini, 8M Nano
• i.MX 8X Family: 8QuadXPlus, 8DualXLite, 8DualX
• i.MX 9 Family: i.MX 93
This release includes the following references and additional information.
• i.MX Linux Release Notes (IMXLXRN) - Provides the release information.
• i.MX Linux User's Guide (IMXLUG) - Provides the information on installing U-Boot and Linux OS and using
i.MX-specific features.
• i.MX Yocto Project User's Guide (IMXLXYOCTOUG) - Describes the board support package for NXP
development systems using Yocto Project to set up host, install tool chain, and build source code to create
images.
• i.MX Machine Learning User's Guide (IMXMLUG) - Provides the machine learning information.
• i.MX Linux Reference Manual (IMXLXRM) - Provides the information on Linux drivers for i.MX.
• i.MX Graphics User's Guide (IMXGRAPHICUG) - Describes the graphics features.
• i.MX Porting Guide (IMXXBSPPG) - Provides the instructions on porting the BSP to a new board.
• i.MX VPU Application Programming Interface Linux Reference Manual (IMXVPUAPI) - Provides the reference
information on the VPU API on i.MX 6 VPU.
• Harpoon User's Guide (IMXHPUG) - Presents the Harpoon release for i.MX 8M device family.
• i.MX Digital Cockpit Hardware Partitioning Enablement for i.MX 8QuadMax (IMXDCHPE) - Provides the i.MX
Digital Cockpit hardware solution for i.MX 8QuadMax.
• i.MX DSP User's Guide (IMXDSPUG) - Provides the information on the DSP for i.MX 8.
• i.MX 8M Plus Camera and Display Guide (IMX8MPCDUG) - Provides the information on the ISP Independent
Sensor Interface API for the i.MX 8M Plus.
The quick start guides contain basic information on the board and setting it up. They are on the NXP website.
• SABRE Platform Quick Start Guide (IMX6QSDPQSG)
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
2 Introduction
The i.MX Linux BSP is a collection of binary files, source code, and support files that can be used to create a U-
Boot bootloader, a Linux kernel image, and a root file system for i.MX development systems. The Yocto Project
is the framework of choice to build the images described in this document, although other methods can be used.
All the information on how to set up the Linux OS host, how to run and configure a Yocto Project, generate an
image, and generate a rootfs, are covered in the i.MX Yocto Project User's Guide (IMXLXYOCTOUG).
When Linux OS is running, this guide provides information on how to use some special features that i.MX SoCs
provide. The release notes provide the features that are supported on a particular board.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The i.MX 8 board connects the host driver using the micro USB connector. The USB to serial driver can be
found under www.ftdichip.com/Drivers/VCP.htm. The FT4232 USB to serial converter provides four serial ports.
The i.MX 8 board uses the first port for the Arm Cortex-A cores console and the second port for SCU's console.
Users need to select the first port (COM) in the terminal setup. The i.MX 8DXL board uses the third and fourth
ports respectively for Arm Cortex-A cores console and SCU console.
4 Booting Linux OS
Before booting the Linux OS kernel on an i.MX board, copy the images (U-Boot, Linux kernel, device tree, and
rootfs) to a boot device and set the boot switches to boot that device. There are various ways to boot the Linux
OS for different boards, boot devices, and results desired. This section describes how to prepare a boot device,
where files need to be in the memory map, how to set switches for booting, and how to boot Linux OS from U-
Boot.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
On i.MX 8M Quad, i.MX 8M Mini, i.MX 8M Nano, and i.MX 8M Plus, multiple elements are needed:
• imx-boot (built by imx-mkimage), which includes SPL, U-Boot, Arm Trusted Firmware, DDR firmware
• HDMI firmware (only supported by i.MX 8M Quad)
• Linux kernel image
• A device tree file (.dtb) for the board being used.
• A root file system (rootfs) for the particular Linux image
On i.MX 8ULP, four elements are needed:
• imx-boot (built by imx-mkimage), which includes SPL, U-Boot, Arm Trusted Firmware, OP-TEE, uPower
Firmware, Sentinel Firmware, and Arm Cortex-M33 image
• Linux kernel image
• A device tree file (.dtb) for the board being used
• A root file system (rootfs) for the particular Linux image
On i.MX 93, multiple elements are needed:
• imx-boot (built by imx-mkimage), which includes SPL, U-Boot, Arm Trusted Firmware, OP-TEE, Sentinel
Firmware, DDR PHY Firmware
• Linux kernel image
• (Optional) Arm Cortex-M33 image
• A device tree file (.dtb) for the board being used
• A root file system (rootfs) for the particular Linux image
The system can be configured for a specific graphical backend. For i.MX 8, the graphical backend is XWayland.
For i.MX 7ULP, the default backend is XWayland.
4.1.1 Bootloader
U-Boot is the tool recommended as the bootloader for i.MX 6 and i.MX 7. i.MX 8 and i.MX 9 require a
bootloader that includes U-Boot as well as other components described below. U-Boot must be loaded onto a
device to be able to boot from it. U-Boot images are board-specific and can be configured to support booting
from different sources.
The pre-built or Yocto project default bootloader names start with the name of the bootloader followed by the
name of the platform and board and followed by the name of the device that this image is configured to boot
from: u-boot-[platform][board]_[machine_configuration].bin. If no boot device is specified, it
boots from SD/MMC.
The manufacturing tool can be used to load U-Boot onto all devices with i.MX 6 and i.MX 7. U-Boot can be
loaded directly onto an SD card using the Linux dd command. U-Boot can be used to load a U-Boot image onto
some other devices.
On i.MX 8, the U-Boot cannot boot the device by itself. The i.MX 8 pre-built images or Yocto Project default
bootloader is imx-boot for the SD card, which is created by the imx-mkimage. The imx-boot binary
includes the U-Boot, Arm trusted firmware, DCD file (8QuadMax/8QuadXPlus/8DXL), system controller
firmware (8QuadMax/8QuadXPlus/8DXL), SPL (8M SoC), DDR firmware (8M), HDMI firmware (8M Quad), and
SECO firmware (8QuadMax/8QuadXPlus/8DXL).
On i.MX 8M SoC, the second program loader (SPL) is enabled in U-Boot. SPL is implemented as the first-level
bootloader running on TCML (For i.MX 8M Nano and i.MX 8M Plus, the first-level bootloader runs in OCRAM).
It is used to initialize DDR and load U-Boot, U-Boot DTB, Arm trusted firmware, and TEE OS (optional) from
the boot device into the memory. After SPL completes loading the images, it jumps to the Arm trusted firmware
BL31 directly. The BL31 starts the optional BL32 (TEE OS) and BL33 (U-Boot) for continue booting kernel.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
In imx-boot, the SPL is packed with DDR Firmware together, so that ROM can load them into Arm Cortex-M4
TCML or OCRAM (only for i.MX 8M Nano and i.MX 8M Plus). The U-Boot, U-Boot DTB, Arm Trusted firmware,
and TEE OS (optional) are packed into a FIT image, which is finally built into imx-boot.
The Universal Update Utility (UUU) runs on a Windows or Linux OS host and is used to download images to
different devices on an i.MX board.
4. Set the boot pin to serial download mode mode. See Section "Section 4.5.11" in this document.
To use the UUU for i.MX 8ULP EVK, follow the instructions below:
• To burn single-boot image and rootfs to eMMC, run the following command:
uuu -b emmc_all imx-boot-imx8ulpevk-sd.bin-flash_singleboot_m33
<rootfs.wic.zst>
• To burn single-boot image to FlexSPI2 NOR flash, run the following command:
uuu -b qspi imx-boot-imx8ulpevk-fspi.bin-flash_singleboot_m33_flexspi
• To burn dual-boot image and rootfs to eMMC and FlexSPI0 NOR flash, perform the following steps:
1. Prepare imx-boot-imx8ulpevk-sd.bin-flash_singleboot_m33, imx-boot-imx8ulpevk-
sd.bin-flash_dualboot, imx-boot-imx8ulpevk-sd.bin-flash_dualboot_m33, and
<rootfs.wic>.
2. Update the UUU script file uuu_8ulp_dual.auto with the file path and name of the images above.
3. Run uuu mfgtools/scripts/samples/uuu_8ulp_dual.auto.
For detailed usage of UUU, see github.com/NXPmicro/mfgtools/wiki.
For example, the following command writes rootfs.wic into eMMC.
The following command decompresses zst file and writes into eMMC:
The following command executes downloading and bootloader (SPL and U-Boot) by USB:
The following command burns into eMMC (If only one board is supported in such a release package and the
board supports eMMC chip):
Note:
For i.MX 8QuadXPlus B0, UUU flashes the eMMC image to boot partition with 32 KB offset. It may not be
compatible with all eMMC devices. It is recommended to enable eMMC fastboot mode and use the UUU kernel
version script to flash the eMMC image to boot partition with 0 offset.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The Yocto Project build creates an SD card image that can be flashed directly. This is the simplest way to load
everything needed onto the card with one command.
A .wic image contains all four images properly configured for an SD card. The release contains a pre-built
.wic image that is built specifically for the one board configuration. It runs the Wayland graphical backend. It
does not run on other boards unless U-Boot, the device tree, and rootfs are changed.
When more flexibility is desired, the individual components can be loaded separately, and those instructions are
included here as well. An SD card can be loaded with the individual components one-by-one or the .wic image
can be loaded and the individual parts can be overwritten with the specific components.
The rootfs on the default .wic image is limited to a bit less than 4 GB, but re-partitioning and re-loading the
rootfs can increase that to the size of the card. The rootfs can also be changed to specify the graphical backend
that is used.
The device tree file (.dtb) contains board and configuration-specific changes to the kernel. Change the device
tree file to change the kernel for a different i.MX board or configuration.
By default, the release uses the following layout for the images on the SD card. The kernel image and DTB
move to use the FAT partition without a fixed raw address on the SD card. The users have to change the U-Boot
boot environment if the fixed raw address is required.
$ cat /proc/partitions
major minor #blocks name
8 0 78125000 sda
8 1 75095811 sda1
8 2 1 sda2
8 5 3028221 sda5
8 32 488386584 sdc
8 33 488386552 sdc1
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
8 16 3921920 sdb
8 18 3905535 sdb1
In this example, the device node assigned is /dev/sdb (a block is 1024 Bytes).
Note: Make sure that the device node is correct for the SD/MMC card. Otherwise, it may damage your
operating system or data on your computer.
The entire contents of the SD card are replaced. If the SD card is larger than 4 GB, the additional space is not
accessible.
<enter> [using the default value will create a partition that extends to
the last sector of the media]
p [to check the partitions]
w [this writes the partition table to the media and fdisk exits]
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Each of them copies the kernel to the media at offset 1 MB (bs x seek = 512 x 2048 = 1 MB). The file
zImage_imx_v7_defconfig refers to the zImage file created when using the imx_v7_defconfig
configuration file, which supports both i.MX 6 and i.MX 7 SoCs.
The i.MX DTB image can be copied by using the copy command and copying the file to the 2nd partition or the
following commands copy an i.MX DTB image to the SD/MMC card by using dd command.
Choose a command for your board:
For i.MX 6 and i.MX 7, the following command can be used to copy the kernel image to the boards, such as the
i.MX 6UltraLite EVK board and i.MX 6ULL EVK board:
For i.MX 6 and i.MX 7, this copies the board-specific .dtb file to the media at offset 10 MB (bs x seek = 512 x
20480 = 10 MB).
$ mkdir /home/user/mountpoint
$ sudo mount /dev/sdx2 /home/user/mountpoint
$ cd /home/user/rootfs
$ tar -jxvf imx-image-multimedia-imx7ulpevk.tar.zst
$ cd /home/user/rootfs
$ sudo cp -a * /home/user/mountpoint
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Images can be downloaded to a device using a U-Boot image that is already loaded on the boot device or by
using the Manufacturing Tool UUU. Use a terminal program to communicate with the i.MX boards.
Alternatively, users can flash the Arm Cortex-M4 image from TFTP by performing the following steps:
1. Boot from the SD card.
2. TFTP the Arm Cortex-M4 image.
U-Boot > tftp ${loadaddr} m4_qspi.bin
3. Select the NOR flash on QuadSPI2 PortB CS0 on the i.MX 6SoloX SABRE-SD board.
U-Boot > sf probe 1:0
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Select the NOR flash on QuadSPI1 PortA CS0 on the i.MX 7Dual SABRE-SD board and i.MX 7ULP EVK
board.
U-Boot > sf probe 0:0
4. Flash the Arm Cortex-M4 image to the selected NOR flash. The erase size is ${filesize}, around 64
Kbytes. This example assumes that it is 128 Kbytes.
U-Boot > sf erase 0x0 0x20000
U-Boot > sf write ${loadaddr} 0x0 ${filesize}
i.MX 7Dual SABRE-SD needs to program the Arm Cortex-M4 images to 1 MB offset, because the first 1 MB
is used by the U-Boot image in QuadSPI.
U-Boot > sf erase 0x100000 0x20000
U-Boot > sf write ${loadaddr} 0x100000 ${filesize}
Note:
On i.MX 7Dual SABRE-SD, the Arm Cortex-M4 image on QuadSPI is supported only when the U-Boot image is
built by the target mx7dsabresd_qspi1_defconfig booted by U-Boot from QuadSPI.
The default U-Boot for the i.MX 7Dual SABRESD board uses the Cortex-M4 image from the SD card and runs it
on OCRAM.
On i.MX 7ULP EVK, the Arm Cortex-M4 image needs to be programmed. Otherwise, it will not boot.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The U-Boot bootloader is able to download images from a TFTP server into RAM and to write from RAM to an
SD card. For this operation, the Ethernet interface is used and U-Boot environment variables are initialized for
network communications.
The boot media contains U-Boot, which is executed upon power-on. Press any key before the value of the U-
Boot environment variable, bootdelay, decreases and before it times out. The default setting is 3 seconds to
display the U-Boot prompt.
1. To clean up the environment variables stored on MMC/SD to their defaults, execute the following command
in the U-Boot console:
U-Boot > env default -f -a U-Boot > saveenv U-Boot > reset
2. Configure the U-Boot environment for network communications. The following is an example. The lines
preceded by the "#" character are comments and have no effect.
U-Boot > setenv serverip <your TFTPserver ip>
U-Boot > setenv bootfile <your kernel zImage/Image name on the TFTP server>
U-Boot > setenv fdtfile <your dtb image name on the TFTP server>
The user can set a fake MAC address through ethaddr environment if the MAC address is not fused.
U-Boot > setenv ethaddr 00:01:02:03:04:05
U-Boot > save
3. Copy zImage/Image to the TFTP server. Then download it to RAM:
U-Boot > dhcp
4. Query the information about the MMC/SD card.
U-Boot > mmc devU-Boot > mmcinfo
5. Check the usage of the mmc command. The blk# is equal to <the offset of read/write>/<block
length of the card>. The cnt is equal to <the size of read/write>/<block length of
the card>.
U-Boot > help mmc
mmc - MMC sub system
Usage:
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
6. Program the kernel zImage/Image located in RAM at ${loadaddr} into the SD card. For example, the
command to write the image with the size 0x800000 from ${loadaddr} to the offset of 0x100000 of the
microSD card. See the following examples for the definition of the MMC parameters.
blk# = (microSD Offset)/(SD block length) = 0x100000/0x200 = 0x800
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5. Check the usage of the mmc command. blk# is equal to <the offset of read/write>/<block
length of the card>. cnt is equal to <the size of read/write>/<block length of the
card>.
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
6. Program the kernel zImage/Image into eMMC. For example, the command below writes the image with
the size 0x800000 from ${loadaddr} to the offset 0x100000 of the eMMC chip. Here, the following
equations are used: 0x800 =0x100000/0x200, 0x4000=0x800000/0x200. The block size of this card is
0x200. This example assumes that the kernel image is less than 0x800000 bytes. If the kernel image
exceeds 0x800000, enlarge the image length.
### Select mmc dev 2 (USDHC4) on the i.MX 6 SABRESD board:
U-Boot > mmc dev 2 0
### Select mmc dev 1 (USDHC3) on the i.MX 7Dual SABRESD board:
U-Boot > mmc dev 1 0
### Select mmc dev 1 (USDHC2) on the i.MX 6UltraLite EVK board:
U-Boot > mmc dev 1 0
### Select mmc dev 0 (USDHC1) on the i.MX 7ULP EVK board:
U-Boot > mmc dev 0 0
### Select mmc dev 0 (eMMC0) on the i.MX 8QuadMax MEK, i.MX 8QuadXPlus MEK,
i.MX 8M Quad, 8DualX, and 8DXL boards:
U-Boot > mmc dev 0 0
### select mmc dev 2 (USDHC3) on the i.MX 8M Mini EVK, i.MX 8M Nano EVK, and
i.MX 8M Plus EVK:
U-Boot > mmc dev 2 0
### select mmc dev 0 (USDHC0) on the i.MX 8ULP EVK
U-boot > mmc dev 0
### Suppose kernel zImage is less than 8 MB:
U-Boot > tftpboot ${loadaddr} ${bootfile}
U-Boot > mmc write ${loadaddr} 0x800 0x4000
7. Program the dtb file located in RAM at ${fdt_addr} into the eMMC chip.
U-Boot > tftpboot ${fdt_addr} ${fdtfile}
U-Boot > mmc write ${fdt_addr} 0x5000 0x800
8. Boot up the system through the rootfs in eMMC, using the HannStar LVDS as display. The kernel MMC
module now uses the fixed mmcblk indexes for the USDHC slots. The eMMC/SD4 slot on the i.MX 6
SABRE boards is mmcblk3. The eMMC5.0 on the i.MX 8QuadMax MEK board, i.MX 8QuadXPlus MEK
board, and i.MX 8M Quad EVK board are mmcblk0. The eMMC5.0/SD3 slot on the i.MX 7Dual SABRE
board is mmcblk2. eMMC is not populated on the i.MX 7Dual SABRE board.
U-Boot > setenv mmcboot 'run bootargs_base mmcargs; mmc dev 2;
mmc read ${loadaddr} 0x800 0x4000; mmc read ${fdt_addr} 0x5000 0x800;bootz
${loadaddr} - ${fdt_addr} '
U-Boot > setenv bootcmd 'run mmcboot'
U-Boot > saveenv
9. Boot up the system through the rootfs in eMMC, using the CLAA WVGA panel as display:
• For i.MX 6 boards:
U-Boot > setenv mmcargs 'setenv bootargs ${bootargs}
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Alternatively, users can flash the Arm Cortex-M4 image from TFTP by performing the following steps:
1. Boot from the SD card.
2. TFTP the Arm Cortex-M4 image.
U-Boot > tftp ${loadaddr} m4_qspi.bin
3. Select the NOR flash on QuadSPI2 PortB CS0 on the i.MX 6SoloX SABRE-SD board.
U-Boot > sf probe 1:0
Select the NOR flash on QuadSPI1 PortA CS0 on the i.MX 7Dual SABRE-SD board and i.MX 7ULP EVK
board.
U-Boot > sf probe 0:0
4. Flash the Arm Cortex-M4 image to the selected NOR flash. The erase size is ${filesize}, around 64
Kbytes. This example assumes that it is 128 Kbytes.
U-Boot > sf erase 0x0 0x20000
U-Boot > sf write ${loadaddr} 0x0 ${filesize}
i.MX 7Dual SABRE-SD needs to program the Arm Cortex-M4 images to 1 MB offset, because the first 1 MB
is used by the U-Boot image in QuadSPI.
U-Boot > sf erase 0x100000 0x20000
U-Boot > sf write ${loadaddr} 0x100000 ${filesize}
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note:
On i.MX 7Dual SABRE-SD, the Arm Cortex-M4 image on QuadSPI is supported only when the U-Boot image is
built by the target mx7dsabresd_qspi1_defconfig booted by U-Boot from QuadSPI.
The default U-Boot for the i.MX 7Dual SABRESD board uses the Cortex-M4 image from the SD card and runs it
on OCRAM.
On i.MX 7ULP EVK, the Arm Cortex-M4 image needs to be programmed. Otherwise, it will not boot.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
~$ fdisk /dev/sdb
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-30318591, default 2048): 4096
Last sector, +sectors or +size{K,M,G} (4096-30318591, default 30318591): +50M
Command (m for help): p
Disk /dev/sdb: 15.5 GB, 15523119104 bytes
64 heads, 32 sectors/track, 14804 cylinders, total 30318592 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3302445d
Device Boot Start End Blocks Id System
/dev/sdb1 4096 106495 51200 83 Linux
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-30318591, default 2048): 106496
Last sector, +sectors or +size{K,M,G} (106496-30318591, default 30318591):
Using default value 30318591
Command (m for help): p
Disk /dev/sdb: 15.5 GB, 15523119104 bytes
64 heads, 32 sectors/track, 14804 cylinders, total 30318592 sectors
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The following table shows the DIP switch settings for booting from the SD card slot labeled SD1 on the i.MX
7ULP EVK boards.
The following table shows the bootcfg pin settings for booting from the SD card slot labeled SD1 on the i.MX
8QuadMax MEK boards.
The following table shows the bootcfg pin settings for booting from the SD card slot labeled SD1 on the i.MX
8QuadXPlus MEK boards.
Note: This is the same setting for the i.MX 8DualX MEK and i.MX 8DXL EVK boards.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The i.MX 6UltraLite EVK board or i.MX 6ULL EVK board has one TF card slot on the CPU board. This slot uses
the USDHC2 controller. The following table shows the DIP switch settings for booting from the TF slot.
Table 7. Booting from TF on i.MX 6UltraLite EVK and i.MX 6ULL EVK
Switch D1 D2 D3 D4
SW601 OFF OFF ON OFF
SW602 ON OFF - -
The i.MX 8M Quad EVK board has one TF card slot. This slot uses the USDHC2 controller. The following table
shows the DIP switch settings for booting from the TF slot.
The i.MX 8M Mini EVK board has one TF card slot. This slot uses the USDHC2 controller. The following table
shows the DIP switch settings for booting from the TF slot.
The i.MX 8M Nano EVK board has one TF card slot. This slot uses the USDHC2 controller. The following table
shows the DIP switch settings for booting from the TF slot.
The i.MX 8M Plus EVK board has one TF card slot. This slot uses the USDHC2 controller. The following table
shows the DIP switch settings for booting from the TF slot.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The following table shows the DIP switch settings for booting from the USDHC2 slot.
The following table shows the DIP switch settings to boot from an SD card in slot SD3 on i.MX 6SoloX SABRE-
AI boards.
Table 14. Booting from an MMC card in Slot SD3 on i.MX 6SoloX SABRE-AI
Switch D1 D2 D3 D4 D5 D6 D7 D8
S4 OFF ON OFF X OFF OFF ON OFF
S3 X OFF OFF OFF ON ON OFF OFF
S1 OFF OFF ON OFF - - - -
The following table shows the DIP switch settings for booting from SD3, also labeled as J507. The SD3 slot is
located between the HDMI and UART ports.
Table 16. Booting from an SD card in slot SD4 on i.MX 6SoloX SABRE-SD
Switch D1 D2 D3 D4 D5 D6 D7 D8
SW10 OFF OFF OFF OFF OFF OFF OFF OFF
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Table 16. Booting from an SD card in slot SD4 on i.MX 6SoloX SABRE-SD...continued
Switch D1 D2 D3 D4 D5 D6 D7 D8
SW11 OFF OFF ON ON ON OFF OFF OFF
SW12 OFF ON OFF OFF OFF OFF OFF OFF
Table 17. Booting from an MMC card in slot SD4 on i.MX 6SoloX SABRE-SD
Switch D1 D2 D3 D4 D5 D6 D7 D8
SW10 OFF OFF OFF OFF OFF OFF OFF OFF
SW11 OFF OFF ON ON ON OFF OFF OFF
SW12 OFF ON ON OFF OFF OFF OFF OFF
i.MX 7Dual is different from i.MX 6. The eMMC uses the SD3 pin connections from the i.MX 7Dual processor.
The following table shows the boot switch settings to boot from eMMC4.4 on the i.MX 7ULP EVK boards.
The following table shows the boot switch settings to boot from eMMC5.0 on the i.MX 8QuadMax MEK boards.
The following table shows the boot switch settings to boot from eMMC5.0 on the i.MX 8QuadXPlus MEK
boards.
Note: This is the same setting for the i.MX 8DualX MEK and i.MX 8DXL EVK boards, except that 8DXL EVK
uses SW1.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The following table shows the boot switch settings to boot from eMMC5.0 on the i.MX 8M Quad EVK boards.
The following table shows the boot switch settings to boot from eMMC5.1 on the i.MX 8M Mini EVK boards.
The following table shows the boot switch settings to boot from eMMC5.1 on the i.MX 8M Nano EVK boards.
The following table shows the boot switch settings to boot from eMMC5.1 on the i.MX 8M Plus EVK boards.
The following table lists the boot switch settings to boot from eMMC5.1 on the i.MX 8ULP EVK.
Table 28. Dualboot booting from eMMC for A35 on i.MX 8ULP EVK
Switch D1 D2 D3 D4 D5 D6 D7 D8
SW5 OFF ON OFF OFF OFF OFF OFF ON
The following table shows the DIP switch settings needed to boot from NAND for i.MX 7Dual SABRE-SD
boards.
The following table shows the DIP switch settings needed to boot from NAND for i.MX 8M Mini DDR4 EVK
boards.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note:
SPI and EIM NOR have pin conflicts on i.MX 6 SABRE-AI boards. Neither can be used for the same
configuration. The default U-Boot configuration is set to SPI NOR.
Table 39. Booting from QuadSPI on i.MX 6UltraLite EVK and i.MX 6ULL EVK
Switch D1 D2 D3 D4
SW601 OFF OFF OFF OFF
SW602 ON OFF - -
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Table 45. Singleboot booting from FlexSPI NOR on i.MX 8ULP EVK
Switch D1 D2 D3 D4 D5 D6 D7 D8
SW5 OFF OFF OFF OFF OFF ON OFF ON
Table 46. Dualboot booting from FlexSPI for A35 on i.MX 8ULP EVK
Switch D1 D2 D3 D4 D5 D6 D7 D8
SW5 OFF ON OFF OFF OFF ON OFF ON
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Table 48. Setup for the Manufacturing Tool on i.MX 7Dual SABRE-SD
Switch D1 D2 D3 D4
S3 OFF ON - -
Table 49. Setup for Manufacturing Tool on i.MX 6UltraLite EVK and i.MX 6ULL EVK
Switch D1 D2
SW602 OFF ON
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note:
The following settings are same for the i.MX 8DualX MEK and i.MX 8DXL EVK boards (8DXL EVK uses SW1).
Note:
If the SD card with bootable image is plugged in SD2 (baseboard), ROM will not fall back into the serial
download mode.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• For i.MX 6 and i.MX 7 builds on the host machine, set the environment with the following command before
building.
source /opt/fsl-imx-fb/6.1-langdale/environment-setup-cortexa9hf-neon-poky-
linux-gnueab
export ARCH=arm
• For i.MX 8 and i.MX 9 builds on the host machine, set the environment with the following command before
building.
source /opt/fsl-imx-xwayland/6.1-langdale/environment-setup-aarch64-poky-linux
export ARCH=arm64
U-Boot:
Download source by cloning with:
• To build an i.MX 6 or i.MX 7 U-Boot in the standalone environment, find the configuration for the target boot. In
the following example, i.MX 6ULL is the target.
make clean
make mx6ull_14x14_evk_defconfig
make
• To build an i.MX 8 U-Boot in the standalone environment, find the configuration for the target boot. In the
following example, i.MX 8QuadMax MEK board is the target and it runs on the Arm Cortex-A53 core by
default. SPL image (u-boot-spl.bin) is also generated with the default defconfig. It is needed when booting with
OP-TEE image.
make distclean
make imx8qm_mek_defconfig
make
For i.MX 8QuadXPlus MEK and i.MX 8DualX board:
make distclean
make imx8qxp_mek_defconfig
make
For i.MX 8DXL EVK board:
make distclean
make imx8dxl_evk_defconfig
make
• For i.MX 8M Quad EVK:
make distclean
make imx8mq_evk_defconfig
make
• For i.MX 8M LPDDR4 EVK:
make distclean
make imx8mm_evk_defconfig
make
• For i.MX 8M DDR4 EVK:
make distclean
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
make imx8mm_ddr4_evk_defconfig
make
• For i.MX 8M Plus LPDDR4 EVK board:
make distclean
make imx8mp_evk_defconfig
make
• For i.MX 8ULP EVK board:
make distclean
make imx8ulp_evk_defconfig
make
• For i.MX 93 11x11 EVK board:
make distclean
make imx93_11x11_evk_defconfig
make
Kernel:
Download source by cloning with:
• To build the kernel in the standalone environment for i.MX 6 and i.MX 7, execute the following commands:
make imx_v7_defconfig
make
• To build the kernel in the standalone environment for i.MX 8 and i.MX 9, execute the following commands:
make imx_v8_defconfig
make
Note:
Users need to modify configurations for fused parts. For example, the i.MX 6UltraLite has four parts, G0, G1,
G2, and G3.
The fused modules are as follows:
• G0: TSC, ADC2, FLEXCAN1, FLEXCAN2, FREQ_MON, TEMP_MON, VOLT_MONLCDIF, CSI, ENET2,
CAAM, USB_OTG2, SAI23, BEE, UART5678, PWM5678, ECSPI34, I2C34, GPT2, and EPIT2.
• G1: TSC, ADC2, FLEXCAN2, FREQ_MON, TEMP_MON, VOLT_MON, LCDIF, CSI, ENET2, and BEE.
• G2: FREQ_MON, TEMP_MON, VOLT_MON, and BEE.
• G3: No fused module.
U-Boot configuration changes:
G0:
/* #define CONFIG_VIDEO */
#define CONFIG_FEC_ENET_DEV 0
/* #define CONFIG_CMD_BEE */
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
G1:
/* #define CONFIG_VIDEO */
#define CONFIG_FEC_ENET_DEV 0
/* #define CONFIG_CMD_BEE */
G2:
/* #define CONFIG_CMD_BEE */
G3: No change.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Table 59. Matrix table for targets of i.MX 8QuadMax, i.MX 8QuadXPlus, and i.MX 8DXL
- OP-TEE U-Boot SPL Cortex-M4
flash_spl Yes Yes Yes No
flash No Yes No No
flash_linux_m4 Yes Yes Yes Yes
flash_regression_ No Yes No Yes
linux_m4
For i.MX 8ULP EVK, to build imx-boot image by using imx-mkimage, perform the following steps:
1. Copy u-boot.bin from u-boot/u-boot.bin and u-boot-spl.bin from u-boot/spl/u-boot-
spl.bin to imx-mkimage/iMX8ULP/.
2. Copy bl31.bin from Arm Trusted firmware (imx-atf) to imx-mkimage/iMX8ULP/.
3. Copy the image of Sentinel firmware container mx8ulpa0-ahab-container.img to imx-mkimage/
iMX8ULP/.
4. Copy the image of uPower firmware image upower.bin to imx-mkimage/iMX8ULP/.
5. Copy the Cortex-M33 image m33_image.bin to imx-mkimage/iMX8ULP/.
6. If using OP-TEE, copy tee.bin to imx-mkimage/iMX8ULP/. The bl31.bin copied in Step 2 must be
built with OP-TEE SPD enabled.
7. Run make SOC=iMX8ULP flash_singleboot_m33 to generate flash.bin.
Note: For the location where the binaries for Sentinel/SECO/uPower/M33/V2X firmwares are available
to download, see the Table "BSP and multimedia standard packages" in the i.MX Linux Release Notes
(IMXLXRN).
The following table list the imx-mkimage targets used on i.MX 8ULP.
For i.MX 8M EVK, to build imx-boot image by using imx-mkimage, perform the following steps:
1. Copy and rename mkimage from u-boot/tools/mkimage to imx-mkimage/iMX8M/mkimage_uboot.
2. Copy u-boot-spl.bin from u-boot/spl/u-boot-spl.bin to imx-mkimage/iMX8M/.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
mtdparts=gpmi-nand:64m(boot),16m(kernel),16m(dtb),-(rootfs)
mtdparts=8000000.nor:1m(uboot),-(rootfs)
mtdparts=spi32766.0:768k(uboot),8k(env),128k(dtb),-(kernel)
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
mtdparts=21e4000.qspi:1m(uboot),8m(kernel),1m(dtb),-(user)
U-Boot has the mapping below to help in accessing the QuadSPI flash in U-Boot for non-parallel mode.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The commands env default -f -a and saveenv can be used to return to the default environment.
For the i.MX 7ULP EVK, i.MX 8QuadMax MEK boards, and i.MX 8QuadXPlus MEK board, change to "
console=ttyLP0,115200".
Specifying displays
The display information can be specified on the Linux boot command line. It is not dependent on the source
of the Linux image. If nothing is specified for the display, the settings in the device tree are used. Add
${displayinfo} to the environment macro containing bootargs. The specific parameters can be found in
the i.MX Linux Release Notes (IMXLXRN). The following are some examples of these parameters.
• U-Boot > setenv displayinfo 'video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24' for an
HDMI display
• U-Boot > setenv displayinfo 'video=mxcfb1:dev=ldb video=mxcfb0:dev=hdmi,1920x1080
M@60,if=RGB24' for LVDS and HDMI dual displays
• U-Boot > setenv displayinfo 'video=mxcfb0:dev=lcd,if=RGB565' for an LCD
• U-Boot > setenv displayinfo 'video=mxcepdcfb:E060SCM,bpp=16
max17135:pass=2,vcom=-2030000' for an EPDC connection
• U-Boot > setenv displayinfo 'video=mxcfb0:mxcfb0:dev=lcd,if=RGB565
video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24' for LCD and HDMI dual displays
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
In addition, fdtfile is used to specify the filename of the device tree file. The commands used to set the U-
Boot environment variables are as follows:
Special settings
i.XM 6Solo, and 6UltraLite can specify uart_from_osc on the command line to specify that the OSC clock
rather than PLL3 should be used. This allows the system to enter low power mode.
U-Boot > setenv bootcmd 'run bootargsset; nand read ${loadaddr} 0x1000000
0x800000; nand read ${fdt_addr} 0x2000000 0x100000; bootz ${loadaddr} -
${fdt_addr}'
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note:
For how to add the MCC demo to the kernel and limit RAM available to kernel to use it, see Chapter 53 "i.MX 6
SoloX MultiCore Communication (MCC)" of the i.MX Linux Reference Manual (IMXLXRM).
As well as supporting running the Arm Cortex-M4 image from QuadSPI, the default i.MX 7Dual SABRE-SD
board supports loading the Arm Cortex-M4 image from the SD card and running it on OCRAM.
Prepare the Arm Cortex-M4 image to the FAT partition of the SD card. Name the file to m4_qspi.bin when
using m4boot script.
After the board is powered on, the following information is displayed at the U-Boot prompt:
Note:
If your demo has no resource table, such as NXP hello_world.bin, clear the resource table area.
Otherwise, Linux OS may shows the garbage value.
• For i.MX 8M Mini/Nano/Quad LPDDR4 EVK: run #mw 0xb80ff000 0 4 to clear the garbage resource table
area.
• For i.MX 8M Plus LPDDR4 EVK: run #mw 0x550ff000 0 4 to clear the garbage resource table area.
On the i.MX 8M boards, perform the commands to boot the Arm Cortex-M Core core:
There are two methods to start the remote core: U-Boot bootaux and Linux remoteproc.
Whether to use bootaux or remoteproc to start the remote core, use remoteproc to stop or start the
Cortex-M core for debug purposes only. It is not recommended to stop the Cortex-M core from Linux OS in a
production system.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
If you choose to use remoteproc to start the remote core directly, execute run prepare_mcore in U-Boot
before starting the Linux OS.
On the i.MX 8QuadMax and i.MX 8QuadXPlus boards, there are two ways to boot the Arm Cortex-M4 cores:
• Booting from ROM
Users need to use imx-mkimage to pack the Arm Cortex-M4 images into imx-boot image. It is necessary to
specify the core ID and its TCML address in the build command. The following is an example:
flash_linux_m4: $(MKIMG) mx8qmb0-ahab-container.img scfw_tcm.bin u-boot-spl.bin
m4_image.bin m4_1_image.bin u-boot-atf-container.img
./$(MKIMG) -soc QM -rev B0 -dcd skip -append mx8qmb0-ahab-container.img -c -
flags 0x00200000 -scfw scfw_tcm.bin -ap u-boot-spl.bin a53 0x00100000 -p3 -m4
m4_image.bin 0 0x34FE0000 -p4 -m4 m4_1_image.bin 1 0x38FE0000 -out flash.bin
cp flash.bin boot-spl-container.img
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \
echo "append u-boot-atf-container.img at $$pad_cnt KB"; \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$
$pad_cnt;
Note:
When booting with the packed Cortex-M4 image (flash_linux_m4), use kernel DTB with RPMSG enabled,
like fsl-imx8qm-mek-rpmsg.dtb for i.MX 8QuadMax MEK or fsl-imx8qxp-mek-rpmsg.dtb for i.MX
8QuadXPlus MEK.
• Booting from U-Boot (not support multiple partitions enabled)
U-Boot supports loading the Arm Cortex-M4 image from the FAT partitions of the SD card with default name
m4_0.bin and m4_1.bin. After the board is booted into the U-Boot console, use the following command to
boot Arm Cortex-M4 core 0:
U-Boot > run m4boot_0
Or the command to boot M4 core 1:
U-Boot > run m4boot_1
Or perform the commands for core 0 without depending on the script:
U-Boot > fatload mmc 1:1 0x80280000 m4_0.bin
U-Boot > dcache flush; bootaux 0x80280000 0
In the default configuration of the SD card and the example here, U-Boot is at the 1024 byte offset, 32 KB
offset for the i.MX 8QuadXPlus B0 and i.MX 8QuadMax B0, or 33 KB offset for the i.MX 8QuadXPlus A0, i.MX
8QuadMax A0, i.MX 8M EVK boards before the first partition, partition 1 is the partition with the Linux kernel and
device trees, and partition 2 is the rootfs.
Setting up the environment variables
For convenience, this document uses a standard set of variables to describe the information in the Linux
command line. The values used here may be different for different machines or configurations. By default,
U-Boot supports setting mmcdev and mmcroot automatically based on the uSDHC slot that we boot from.
This assumes zImage, the device tree file (DTB), and the rootfs are on the same SD/MMC card. To set these
environment variables manually, set mmcautodetect to no to disable the feature.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The following is one way to set up the items needed to boot Linux OS.
Note: If the MAC address has not been burned into the fuses, set the MAC address to use the network in U-
Boot.
# eth0:
setenv ethaddr xx:xx:xx:xx:xx:xx
# eth1:
setenv eth1addr xx:xx:xx:xx:xx:xx
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Do not interrupt U-Boot. Let the board run into grub. Before grub runs, it should update the bootloader
automatically and remove capsule1.bin. And reboot the board again. The board will boot up with the
updated U-Boot.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
To build U-Boot for an i.MX 6Solo on an i.MX 6DualLite SABRE-AI card, use the following command:
6 Power Management
The i.MX power management uses the standard Linux interface. Check the standard Linux power
documentation for information on the standard commands. The i.MX Linux Reference Manual (IMXLXRM)
contains information on the power modes that are available and other i.MX-specific information in the power
management section.
There are three main power management techniques on i.MX boards: suspend and resume commands, CPU
frequency scaling, and bus frequency scaling. They are described in the following sections.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Scaling governors are used in the Linux kernel to set the CPU frequency. CPU frequencies can be scaled
automatically depending on the system load either in response to ACPI events or manually by userspace
programs. For more information about governors, read governors.txt from www.kernel.org/doc/Documentation/
cpu-freq/governors.txt.
The following are some of the more frequently used commands:
These commands return information about the system and the current settings.
• The kernel is pre-configured to support only certain frequencies. The list of frequencies currently supported
can be obtained from:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
• To get the available scaling governors:
cat /sys/devices/system/cpu/*/cpufreq/scaling_available_governors
• To check the current CPU frequency:
cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq
The frequency is displayed depending on the governor set.
• To check the maximum frequency:
cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_max_freq
• To check the minimum frequency:
cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_min_freq
Execute the following command for i.MX 8ULP to enable system level voltage and frequency scaling:
On most systems, the chip enters low power IDLE mode after the above two commands are executed.
To manipulate bus frequency, use the following commands to achieve the results desired:
cat /sys/bus/platform/drivers/imx_busfreq/soc\:busfreq/enable -> displays the status of bus
frequency.
echo 0 > /sys/bus/platform/drivers/imx_busfreq/soc\:busfreq/enable -> disables bus
frequency.
echo 1 > /sys/bus/platform/drivers/imx_busfreq/soc\:busfreq/enable -> enables bus
frequency.
The i.MX Linux Reference Manual (IMXLXRM) has more information on the bus frequency in the chapter about
DVFS.
7 Multimedia
i.MX provides audio optimized software codecs, parsers, hardware acceleration units, and associated plugins.
The i.MX provides GStreamer plugins to access the i.MX multimedia libraries and hardware acceleration units.
This chapter provides various multimedia use cases with GStreamer command line examples.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
One option is to set these as environment variables as shown in the following examples. Use the full path to the
command on your system.
export GSTL=gst-launch-1.0
export PLAYBIN=playbin
export GPLAY=gplay-1.0
export GSTINSPECT=gst-inspect-1.0
In this document, variables are often used to describe the command parameters that have multiple options.
These variables are of the format $description where the type of values that can be used are described. The
possible options can be found in the Section about Multimedia in the i.MX Linux Release Notes (IMXLXRN) for
i.MX-specific options, or at "gstreamer.freedesktop.org/ for the community options.
The GStreamer command line pipes the input through various plugins. Each plugin section of the command line
is marked by an exclamation mark (!). Each plugin can have arguments of its own that appear on the command
line after the plugin name and before the next exclamation mark (!). Use $GSTINSPECT $plugin to get
information on a plugin and what arguments it can use.
Square brackets ([ ]) indicate optional parts of the command line.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
If the file to be played contains an ID3 header, use the ID3 parser. If the file does not have an ID3 header, this
has no effect.
This example plays an MP3 file in the audio jack output.
This is an example of an MP4 container with H.264 encoding format video file playback:
For the platforms without VPU hardware, $video_decoder_plugin could be a software decoder plugin like
avdec_h264.
For the multichannel audio playback settings to be used when PulseAudio is enabled, see Section 7.4.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Use extra-controls property after v4l2xxxenc to specify the value for different codec controls. v4l2-ctl
--device device_path --list-ctrls shows all video device's controls and their values.
For example:
7.3.4 Transcoding
Transcoding is converting a file from one video encoding to another.
VPU video encoding only works on SoC with VPU encoder support.
For i.MX 6 family with VPU, use the following command:
capsfilter is the container's mime type. CAPS1 is the target video resolution, and the vpuenc_xxx can be
vpuenc_mpeg4, vpuenc_h263, vpuenc_h264, and vpuenc_jpeg.
For example:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note:
• For some mux, such as matroskamux, add h264parse/h265parse before mux.
• For i.MX 6, h264parse is not required, because the VPU can output AVC and byte-stream formats. For i.MX
8, h264parse/h265parse should be added before some mux, because the VPU supports only the byte-stream
output.
Note:
Run the following command to work in EARC mode:
The following examples show how to make an MP3 or WMA audio recording.
• MP3 recording
$GSTL pulsesrc num-buffers=$NUMBER blocksize=$SIZE ! lamemp3enc
! filesink location=output.mp3
Note:
The recording duration is calculated as $NUMBER * $SIZE * 8 / (samplerate * channel * bit
width).
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Therefore, to record 10 seconds of a stereo channel sample with a 44.1K sample rate and a 16 bit width, use
the following command:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Parameter comments:
• Get the camera support format and resolution using gst-inspect-1.0 v4l2src.
• Set caps filter according to the camera's supported capabilities if the user needs other format or resolution.
• Ensure that the right caps filter has been set, which also needs to be supported by v4l2sink.
Note:
The TV decoder is ADV7180. It supports NTSC and PAL TV mode. The output video frame is interlaced, so the
sink plugin needs to enable deinterlace. The default value of v4l2sink deinterface is True.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
! beepdec ! $audio_sink_plugin
• PLAYBIN
$GSTL $PLAYBIN uri=http://SERVER/test.avi
• GPLAY
$GPLAY http://SERVER/test.avi
Note: Supports TS, MP4, and WebM container format segment currently.
RTSP streams can be played with a manual pipeline or by using playbin. The format of the commands is as
follows.
• Manual pipeline
$GSTL rtspsrc location=$RTSP_URI name=source
! queue ! $video_rtp_depacketize_plugin ! $vpu_dec ! $video_sink_plugin
source.
! queue ! $audio_rtp_depacketize_plugin ! $audio_parse_plugin ! beepdec !
$audio_sink_plugin
• PLAYBIN
$GSTL $PLAYBIN uri=$RTSP_URI
Two properties of rtspsrc that are useful for RTSP streaming are:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• Latency: This is the extra added latency of the pipeline, with the default value of 200 ms. If you need low-
latency RTSP streaming playback, set this property to a smaller value.
• Buffer-mode: This property is used to control the buffering algorithm in use. It includes four modes:
– None: Outgoing timestamps are calculated directly from the RTP timestamps, not good for real-time
applications.
– Slave: Calculates the skew between the sender and receiver and produces smoothed adjusted outgoing
timestamps, good for low latency communications.
– Buffer: Buffer packets between low and high watermarks, good for streaming communication.
– Auto: Chooses the three modes above depending on the stream. This is the default setting.
To pause or resume the RTSP streaming playback, use a buffer-mode of slave or none for rtspsrc, as in
buffer-mode=buffer. After resuming, the timestamp is forced to start from 0, and this causes buffers to be
dropped after resuming.
Manual pipeline example:
Playback does not exit automatically in GStreamer 1.x, if buffer-mode is set to buffer in the rtpsrc plugin.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
imxvideoconvert_ipu can also be used to perform video deinterlacing. They can be used to connect before
ximagesink to enable the video rendering on X Windows or used in transcoding to change video size, rotation,
or deinterlacing.
Use gst-inspect-1.0 to get each converter's capability and supported input and output formats. Note that
imxvideoconvert_g2d can only perform color space converting to RGB space.
Color Space Conversion (CSC)
Resize
Rotate
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
space conversion is also performed automatically if input and output video are not same. Each video can be set
to an alpha and z-order value to get alpha blending and video blending sequence.
Note that imxcompositor_g2d can only output RGB color space format. Use gst-inspect-1.0 to get more detailed
information, including the supported input and output video format.
• Composite two videos into one.
gst-launch-1.0 imxcompositor_{xxx} name=comp sink_1::xpos=160
sink_1::ypos=120 ! overlaysink videotestsrc ! comp.sink_0 videotestsrc !
comp.sink_1
• Composite two videos into one with red background color.
gst-launch-1.0 imxcompositor_{xxx} background=0x000000FF name=comp
sink_1::xpos=160 sink_1::ypos=120 ! overlaysink videotestsrc ! comp.sink_0
videotestsrc ! comp.sink_1
• Composite two videos into one with CSC, resize, and rotate.
gst-launch-1.0 imxcompositor_{xxx} name=comp sink_0::width=640
sink_0::height=480
sink_1::xpos=160 sink_1::ypos=120 sink_1::width=640 sink_1::height=480
sink_1::rotate=1 !
video/x-raw,format=RGB16 ! overlaysink videotestsrc !
video/x-raw,format=NV12,width=320,height=240 ! comp.sink_0 videotestsrc !
video/x-raw,format=I420,width=320,height=240 ! comp.sink_1
• Composite three videos into one with CSC, resize, rotate, alpha, z-order, and keep aspect ratio.
gst-launch-1.0 imxcompositor_{xxx} name=comp sink_0::width=640
sink_0::height=480
sink_0::alpha=0.5 sink_0::z-order=3 sink_1::alpha=0.8 sink_1::z-order=2
sink_1::xpos=160
sink_1::ypos=120 sink_1::width=640 sink_1::height=480 sink_1::rotate=1
sink_2::xpos=320
sink_2::ypos=240 sink_2::width=500 sink_2::height=500 sink_2::alpha=0.6
sink_2::keep-ratio=true ! video/x-raw,format=RGB16 ! overlaysink
videotestsrc !
video/x-raw,format=NV12,width=320,height=240 ! comp.sink_0 videotestsrc !
video/x-raw,format=I420,width=320,height=240 ! comp.sink_1 videotestsrc !
video/x-raw,format=RGB16,width=320,height=240 ! comp.sink_2
Sink #0
State: SUSPENDED
Name: alsa_output.platform-soc-audio.1.analog-stereo
Description: sgtl5000-audio Analog Stereo
...
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
...
Sink #1
State: SUSPENDED
Name: alsa_output.platform-soc-audio.4.analog-stereo
Description: imx-hdmi-soc Analog Stereo
...
...
Use the pacmd command to set the default audio sink according to the sink number in the list shown above:
Source #0
State: SUSPENDED
Name: alsa_output.platform-soc-audio.1.analog-stereo.monitor
Description: Monitor of sgtl5000-audio Analog Stereo
...
...
Source #1
State: SUSPENDED
Name: alsa_input.platform-soc-audio.1.analog-stereo
Description: sgtl5000-audio Analog Stereo ...
...
...
Use the pacmd command to set the default audio source according to the source number in the list shown
above:
$sink-number could be 0 or 1 in the example above. If record and playback at the same time is not needed,
there is no need to set the monitor mode.
The PulseAudio I/O path setting status can be checked with:
$ pactl stat
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
8 Audio
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
eARC mode ON
Besides, enabling the complete eARC feature, per the HDMI 2.1 specification, is more of a system-level
application that integrates different layers and modules of the CEC driver, DRM, HDMI/HDCP controller driver,
EDID, and eARC driver modules.
8.3.1 Introduction
The Cortex-M core on the i.MX 8M Plus, i.MX 8M Mini and i.MX 93 platforms can be used in an
AsymmetricMultiprocessing (AMP) architecture for a low-power voice UI solution.
Thevoice activity detection and wake work engine shall use the lowest power core of the i.MX 8M and i.MX 93,
so that the Cortex-A cluster and related peripherals can remain in sleep mode for most of the “active listening”
time.
Upon successful detection of a wake word, the Cortex-M core shall wake up the Cortex-A domain for better
acoustic performance and further voice processing.
There are three components needed for this solution:
• Audio Front End (AFE)
• Linux drivers
• Cortex-M Image
Note: The Cortex-M image for i.MX 93 is not available yet.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The AFE code is on GitHub: https://github.com/nxp-imx/nxp-afe/. Use the Git tag corresponding to the current
Linux BSP release.
The AFE deliveries are in Yocto rootfs/unit_tests/nxp-afe/ and /usr/lib/nxp-afe/.
• /unit_tests/nxp-afe/afe: The main application of the AFE
• /unit_tests/nxp-afe/TODO.md: User guide document
• /unit_tests/nxp-afe/asound.conf: Used for i.MX 8M Mini default dtb
• /unit_tests/nxp-afe/asound.conf_imx8mp: Used for i.MX 8M Plus default dtb
• /unit_tests/nxp-afe/asound.conf_rpmsg_imx8mm: Used for i.MX 8M Mini RPMsg dtb
• /unit_tests/nxp-afe/asound.conf_rpmsg_imx8mp: Used for i.MX 8M Plus RPMsg dtb
• . /unit_tests/nxp-afe/asound.conf_imx93: Used for i.MX 93 default dtb
• /usr/lib/nxp-afe/libdummyimpl.so: Dummy signal processor
• /usr/lib/nxp-afe/libdummyimpl.so.2.0: Dummy signal processor
In addition to the AFE, the Yocto BSP integrates VoiceSeeker (a multi-microphone voice control audio front-
end signal processing solution), VoiceSpot (a small memory and MIPS profile wake word engine supporting the
"Hey NXP" voice trigger word), and VIT for local voice command recognition. These deliveries are available on
GitHub: https://github.com/nxp-imx/imx-voiceui. This contains:
• VoiceSeeker_wrapper folder contains the code used for generating the shared library used by the AFE
wrapper. Check the TODO.md in the nxp-afe repository..
• Voice_UI_Test_app folder contains the code used for generating the voice UI application called
"voice_ui_app". This application contains the VoiceSpot wake-word engine and VIT for local voice
command recognition. This application uses the output of the AFE for voice detection (wake-word and voice
commands).
See the README file in this GitHub repository, which explains how to build the VoiceSeeker library and the
Voice UI Test application. Once these are built, the user shall copy the following files to Yocto rootfs:
• Copy release/Config.ini to /unit_tests/nxp-afe/.
• Copy release/HeyNXP_1_params.bin to /unit_tests/nxp-afe/.
• Copy release/HeyNXP_en-US_1.bin to /unit_tests/nxp-afe/.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
After this, follow the steps in /unit_tests/nxp-afe/TODO.md to perform a test. The typical test method is
as follows:
• ./voice_ui_app &
• ./afe libvoiceseekerlight &
• aplay test.wav &
• arecord -d10 -fS32_LE -r16000 -c1 voiceseeker_afe_on.wav
The voice_ui_app binary enables the following VIT commands:
• MUTE
• NEXT
• SKIP
• PAIR DEVICE
• PAUSE
• STOP
• POWER OFF
• POWER ON
• PLAY MUSIC
• PLAY GAME
• WATCH CARTOON
• WATCH MOVIE
When users say "Hey NXP, power on", the "Hey NXP" wakes up the system, and the "power on" command is
detected.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
There is a configuration file called Config.ini through which user can choose the wake-word engine, select
the VIT language or implement other settings. It is a part of the standard voice solution.
$ cat /unit_tests/nxp-afe/Config.ini
[AFEConfig]
WWDectionDisable = 0
WakeWordEngine = VoiceSpot
DebugEnable = 0
RefSignalDelay = 3211
mic0 = 35.0, 15.15, 0.0
mic1 = 17.5, -15.15, 0.0
mic2 = -17.5, -15.15, 0.0
mic3 = -35.0, 15.15, 0.0
VoiceSpotModel = HeyNXP_en-US_1.bin
VoiceSpotParams = HeyNXP_1_params.bin
VITLanguage = English
• WWDectionDisable
Disables/Enables the wake-word and command detection.
– 0 - By default, enables the wake-word and command detection.
– 1 - Disables wake-word and command detection. voice_ui_app does not work.
• WakeWordEngine
This configuration depends on setting WWDectionDisable to 0. Selects if the voice_ui_app uses
VoiceSpot or VIT for wake-word detection.
– VoiceSpot - By default, use VoiceSpot to detect the wake-word.
– VIT - Use VIT to detect wake-word.
• DebugEnable
– 0 - By default, no debug recordings are made.
– 1 - Enables recording the AFE input/output streams for debugging and tuning the RefSignalDelay.
• RefSignalDelay
Used to calibrate the reference signal delay when using VoiceSeeker’s Acoustic Echo Cancellation (AEC).
The AEC enabled library is delivered with controlled access through Flexera. Please contact [email protected]
for more information.
• Mic coordinates
XYZ coordinates of the microphones in millimeters. The origin of the coordinate axis can be chosen as
convenient.
• VoiceSpotModel/VoiceSpotParams
The two parameters depend on setting WakeWordEngine to "VoiceSpot". They are used to specify the wake-
word model and parameters used by VoiceSpot.
• VITLanguage
This configuration depends on setting WakeWordEngine to "VIT". Selects the VIT language used to detect
the wake-word and commands.
– English - By default, uses English.
– Mandarin - If set, available VIT wake-words and commands are listed in Mandarin.
Notes on VIT model:
– VIT Wake-word and commands can be updated with generating new VIT Model thanks to the VIT Model
generation online tool.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
– To have the new VIT Model considered by the application, the VIT model has be updated in ./vit/
i.MX8M_A53/Lib/ or /vit/i.MX9X_A55/Lib/ and Voice_ui_app recompiled.
– Same VIT model is used by the Voice_ui_app in low power or standard configuration. In the low power
configuration, since VIT is used in voice commands mode only, VIT wake-word information is not considered
by the VIT engine.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
3. Reboot the board, and the Cortex-M will be automatically started before the Linux OS. This can be checked
on the Cortex-M console.
4. Apply the appropriate ALSA configuration. After the Linux OS has booted, from the console:
• i.MX 8M Mini:
cp /unit_tests/nxp-afe/asound.conf_rpmsg_imx8mm /etc/asound.conf
• i.MX 8M Plus:
cp /unit_tests/nxp-afe/asound.conf_rpmsg_imx8mp /etc/asound.conf
• Reboot to apply the changes above.
5. Before starting any audio application, e.g., arecord, aplay, afe, load the audio loopback driver. From a
Linux OS console:
modprobe snd-aloop
8.3.5.3 Execution
Once started, users have no direct actions to control the Cortex-M application. It automatically executes
appropriate actions according to the Linux state:
• When Linux OS is active: The Cortex-M application is acting as a data pump, getting audio data from the
microphones and providing them to ALSA drivers through RPMsg.
• When Linux OS is suspended: Audio data are processed locally on Cortex-M (by either VIT LPVAD or
VoiceSeeker/VoiceSpot). The data is also stored in a ring-buffer. Once voice or the wake-word is detected
(depending on the application), the Linux OS is automatically resumed, data from the ring buffer is sent to
ALSA (so the Linux OS also gets the wakeword), and then the data-pump is re-started.
• Suspending Linux OS: Cortex-M only has the possibility to resume the Linux OS, not to suspend it. Instead,
the Linux OS should be suspended by user-space action (the decision to suspend cannot be based only
on voice. It should also consider all the other potential user applications running on the Linux OS). For test
purposes, this can be forced by the user by entering the following command to the Linux console.
echo mem > /sys/power/state
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note: The Conversa processing suite is a restricted-access solution. Contact your NXP representative for more
details.
9 Graphics
There are a number of graphics tools, tests, and example programs that are built and installed in the Linux
rootfs. There are some variation on what is included based on the build and packages selected, the board, and
the backend specified. This section describes some of them.
The kernel module version of graphics used on the system can be found by running the following command on
the board:
The user-side GPU drivers version of graphics can be displayed using the following command on the board:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
9.1 imx-gpu-sdk
This graphics package contains source for several graphics examples for OpenGLES 2.0 and OpenGLES
3.0 APIs for X11, Framebuffer, and XWayland graphical backends. These applications show that the graphics
acceleration is working for different APIs. The package includes samples, demo code, and documentation for
working with the i.MX family of graphic cores. More details about this SDK are in the i.MX Graphics User's
Guide. This SDK is only supported for hardware that has OpenGLES hardware acceleration.
9.2 G2D-imx-samples
The G2D Application Programming Interface (API) is designed to make it easy to use and understand the 2D
BLT functions. It allows the user to implement customized applications with simple interfaces. It is hardware and
platform independent when using 2D graphics.
The G2D API supports the following features and more:
• Simple BLT operation from source to destination
• Alpha blend for source and destination with Porter-Duff rules
• High-performance memory copy from source to destination
• Up-scaling and down-scaling from source to destination
• 90/180/270 degree rotation from source to destination
• Horizontal and vertical flip from source to destination
• Enhanced visual quality with dither for pixel precision-loss
• High performance memory clear for destination
• Pixel-level cropping for source surface
• Global alpha blend for source only
• Asynchronous mode and synchronization
• Contiguous memory allocator
• VG engine
The G2D API document includes the detailed interface description and sample code for reference. The API is
designed with C-Style code and can be used in both C and C++ applications.
The G2D is supported on all i.MX. The hardware that supports G2D is described below. For more details, see
the Frame Buffer information in the i.MX Release Notes (IMXLXRN) to check which hardware is used for G2D.
• For i.MX 6 with GPU, the G2D uses the 2D GPU.
• For i.MX with PXP, the G2D uses the PXP with limited G2D features.
The following is the directory structure for the G2D test applications located under /opt.
• g2d_samples
– g2d_test
– g2d_overlay_test
– g2d_multiblit_test
9.3 viv_samples
The directory viv_samples is found under /opt. It contains binary samples for OpenGL ES 1.1/2.0 and
OpenVG 1.1.
The following are the basic sanity tests, which help to make sure that the system is configured correctly.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• cl11: This contains unit tests and FFT samples for OpenCL 1.1 Embedded Profile. OpenCL is implemented on
the i.MX 6Quad, i.MX 6QuadPlus, and i.MX 8 boards.
– – UnitTest
– clinfo
– loadstore
– math
– threadwalker
– test_vivante
– functions_and_kernels
– illegal_vector_sizes
– initializers
– multi_dimensional_arrays
– reserved_data_types
– structs_and_enums
– unions
– unsupported_extensions
– fft
• es20: This contains tests for Open GLES 2.0.
– vv_launcher
– coverflow.sh
– vv_launcher
• tiger: A simple OpenVG application with a rotating tiger head. This is to demonstrate OpenVG.
• vdk: Contains sanity tests for OpenGL ES 1.1 and OpenGL ES 2.0.
The tiger and VDK tests show that hardware acceleration is being used. They will not run without it.
9.4 Qt 6
Qt 6 is built into the Linux image in the Yocto Project environment with the command bitbake imx-image-
full. For more details on Qt enablement, check out the README in the meta-imx repo and the i.MX Yocto
Project User's Guide (IMXLXYOCTOUG).
10 Security
The i.MX platforms define a series of security acceleration subsystems.
10.1.1 Introduction
The Linux kernel contains a Scatterlist Crypto API driver for the NXP CAAM security hardware block. It
integrates seamlessly with in-kernel crypto users, such as DM-Crypt, Keyctl, in a way that any disk encryption
and key management suites will automatically use the hardware to do the crypto acceleration. CAAM hardware
is known in Linux kernel as 'caam', after its internal block name: Cryptographic Accelerator and Assurance
Module.
There are several HW interfaces ("backends") that can be used to communicate (for example, submit requests)
with the engine, their availability depends on the SoC:
• Register Interface (RI) - available on all SoCs (though access from kernel is restricted on DPAA2 SoCs).
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Its main purpose is debugging (such as single-stepping through descriptor commands), though it is used also
for RNG initialization.
• Job Ring Interface (JRI) - legacy interface, available on all SoCs; on most SoCs there are 4 rings.
Note:
There are cases when fewer rings are accessible or visible in the kernel, for example, when firmware like
Trusted Firmware-A (TF-A) reserves one of the rings.
On top of these backends, there are the "frontends" - drivers that sit between the Linux Crypto API and backend
drivers. Their main tasks aim to:
• Register supported crypto algorithms.
• Process crypto requests coming from users (through the Linux Crypto API) and translate them into the proper
format understood by the backend being used.
• Forward the CAAM engine responses from the backend being used to the users.
To use a specific implementation, it is possible to ask for it explicitly by using the specific (unique) "driver name"
instead of the generic "algorithm name". See official Linux Kernel Crypto API documentation (section Crypto API
Cipher References And Priority). Currently, the default priority is 3000 for JRI frontend.
crypto@30000 {
compatible = "fsl,sec-v4.0";
fsl,sec-era = <2>;
#address-cells = <1>;
#size-cells = <1>;
reg = <0x300000 0x10000>;
ranges = <0 0x300000 0x10000>;
interrupt-parent = <&mpic>;
interrupts = <92 2>;
clocks = <&clks IMX6QDL_CLK_CAAM_MEM>,
<&clks IMX6QDL_CLK_CAAM_ACLK>,
<&clks IMX6QDL_CLK_CAAM_IPG>,
<&clks IMX6QDL_CLK_EIM_SLOW>;
clock-names = "mem", "aclk", "ipg", "emi_slow";
};
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Section from boot log that specify where crypto test are made (If a boot test is passing with success, no
information will be reported. For algorithms with no tests available, a line in dmesg will be printed):
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
caamhash frontend (hash algorithms) may be individually turned off, since the nature of the application may be
such that it prefers software (core) crypto latency due to many small-sized requests.
caampkc frontend (public key / asymmetric algorithms) can be turned off too, if needed.
caamrng frontend (Random Number Generation) may be turned off in case there is an alternate source of
entropy available to the kernel.
caamkeyblob frontend (algorithms supporting tagged key) can be turned off if tagged keys or blobs are not
used.
If the messages are not present in the logs, either the driver is not configured in the kernel, or no CAAM
compatible device tree node is present in the device tree.
If the number of interrupts fired increment, then the hardware is being used to do the crypto. If the numbers do
not increment, then check the algorithm being exercised is supported by the driver. If the algorithm is supported,
there is a possibility that the driver is in polling mode (NAPI mechanism) and the hardware statistics in debugfs
(inbound/outbound bytes encrypted/protected - see below) should be monitored.
name : cbc(des)
driver : cbc-des-caam
module : kernel
priority : 3000
refcnt : 1
selftest : passed
internal : no
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
type : givcipher
async : yes
blocksize : 8
min keysize : 8
max keysize : 8
ivsize : 8
geniv : <built-in>
Note that although a test vector may not exist for a particular algorithm supported by the driver, the kernel will
emit messages saying which algorithms weren't tested, and mark them as 'passed' anyway:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
the crypto library. The callback hooks provide the glue logic to interface with the hardware accelerators. Generic
offloading of cipher and digests algorithms through Linux kernel is possible with cryptodev engine.
CORE_IMAGE_EXTRA_INSTALL+="cryptodev-module openssl-bin"
bitbake imx-image-full
Note:
Starting from OpenSSL 1.1.1, the cryptodev engine is invoked by OpenSSL by default if the corresponding
module has been inserted in the kernel. Thus to perform only SW benchmark test using OpenSSL, remove the
cryptodev module by running rmmod cryptodev.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
10.4.5.1 Running OpenSSL benchmarking tests for symmetric ciphering and digest
In the speed test file, a series of performance tests are made to check the performance of the symmetric and
digest operations. The following is described in the OpenSSL test execution:
10.4.6.1 Running OpenSSL benchmarking tests for symmetric ciphering and digest
Execute the following command:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Or to generate an EC key:
root@imx8mpevk:~# openssl req -engine pkcs11 -new -key "<token url private>" -
keyform engine -out req.pem -text -x509 -subj "/CN=NXP Semiconductor"
Engine "pkcs11" set.
Enter PKCS#11 token PIN for token label:<user pin>
The second command creates a self-signed certificate for the request. The private key used to sign the
certificate is the same private key used to create the request.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
If the disk encryption scenario is not enabled, some features in the kernel need to be enabled:
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• keyutils: provides keyctl, which is required to manage Linux Key retention service.
• lvm2: provides dmsetup utility and libraries to manage device-mapper.
• e2fsprogs-mke2fs: contains necessary tools to create filesystems.
• util-linux: provides blockdev utility needed to read number of sectors from a volume.
• CAAM’s tagged key, used to suppress the mechanism of encrypting the master volume key with a key derived
from a user-supplied passphrase
Linux OS provides an in-kernel key management and retention facility called Keyrings. Keyring also enables
interfaces to allow accessing keys and performing operations such as add, update, and delete from user-space.
The kernel provides several basic types of keys including ecrypted, trusted, user, and logon.
The CAAM driver has associated a user-space application used to generate:
• A plain key and encapsulated it into Red blob
• A tagged key and encapsulated it into a black blob
10.5.3.1.1 Usage
The following steps shows how to perform a full disk encryption on i.MX devices.
1. Insert the kernel module.
$>: modprobe trusted
2. Generate the trusted key:
$>: KEYNAME=dm_trust
$>: KEY="$(keyctl add trusted $KEYNAME 'new 32' @s)"
$>: keyctl pipe $KEY >~/$KEYNAME.blob
$>: keyctl list @s
Output:
$>: keyctl list @s
2 keys in keyring:
48178143: ----s-rv 0 0 user: invocation_id
143779047: --alswrv 0 0 trusted: dm_trust
3. Create a secure volume. It could be a physical partition. In this example, make use of an image file and
mount it later.
$>: DEV=/dev/loop0
$>: BLOCKS=20
$>: fallocate -l $((BLOCKS*512)) ~/loop0.img
$>: losetup -P $DEV ~/loop0.img
4. Create the mapping table "TABLE". Where:
• Algo is set in Kernel Crypto API format to use the plain key. Algo/cipher is set to cbc(aes)-plain.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• Key is set as the trusted key of length 32 and the name is exported as $KEYNAME.
$>: DEV=/dev/loop0
$>: ALGO=capi:cbc(aes)-plain
$>: KEYNAME=dm_trust
$>: BLOCKS=20
$>: TARGET=crypt
$>: TABLE="0 $BLOCKS $TARGET $ALGO :32:trusted:$KEYNAME 0 $DEV 0 1
allow_discards"
5. Use dmsetup to create a new device-mapper device named encrypted for example, and specify the
mapping table "TABLE" created above, as argument.
$>: echo $TABLE | dmsetup create encrypted
6. Load the device-mapper device named encrypted created in the previous step.
$>: echo $TABLE | dmsetup load encrypted
7. Create a secure volume.
$>: dd if=/dev/zero of=/dev/mapper/encrypted || true
8. Write to the volume.
$>: echo "It works. Congratulations" 1<> /dev/mapper/encrypted
9. Unmount the device.
$>: umount /mnt/encrypted/
10. Deactivate the device mapper device.
$>: dmsetup remove encrypted
Restart the board:
$>: reboot
11. In the next boot, insert the kernel module.
$>: modprobe trusted
Step 11: Load the trusted key:
$>: KEYNAME=dm_trust
$>: keyctl add trusted $KEYNAME "load $(cat ~/$KEYNAME.blob)" @s
$>: keyctl list @s
Output:
$>: keyctl list @s
2 keys in keyring:
48178143: ----s-rv 0 0 user: invocation_id
143779047: --alswrv 0 0 trusted: dm_trust
12. Create the mapping table "TABLE". Where:
• Algo is set in Kernel Crypto API format to use the plain key. Algo/cipher is set to cbc(aes)-plain.
• Key is set as the trusted key of length 32 and name is exported as $KEYNAME.
$>: DEV=/dev/loop0
$>: ALGO=capi:cbc(aes)-plain
$>: KEYNAME=dm_trust
$>: BLOCKS=20
$>: TARGET=crypt
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
$ ./caam-keygen
CAAM keygen usage: caam-keygen [options]
Options:
create <key_name> <key_enc> <key_mode> <key_val>
<key_name> the name of the file that will contain the black key.
A file with the same name, but with .bb extension, will contain the black
blob.
<key_enc> can be ecb or ccm
<key_mode> can be -s or -t.
-s generate a black key from random with the size given in the next
argument
-t generate a black key from a plaintext given in the next argument
<key_val> the size or the plaintext based on the previous argument
(<key_mode>)
import <blob_name> <key_name>
<blob_name> the absolute path of the file that contains the blob
<key_name> the name of the file that will contain the black key.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
By default, the keys and blobs are created in KEYBLOB_LOCATION, which is /data/caam/.
Later, CAAM Tagged Key is added into Linux Key Retention service and managed by user-space application
such as keyctl. Black blobs can be stored on any non-volatile storage.
Dmsetup (part of the libdevmapper package) is a powerful tool for performing very low-level configuration and
is used to manage encrypted volumes.
10.5.4 Usage
The following are the steps to perform a full disk encryption on i.MX devices.
1. After booting the device, make sure that cryptographic transformations using Tagged Key are registered.
root@imx8mqevk:~# grep -B1 -A2 tk- /proc/crypto|grep -v kernel
name : tk(ecb(aes))
driver : tk-ecb-aes-caam
priority : 3000
--
name : tk(cbc(aes))
driver : tk-cbc-aes-caam
priority : 3000
root@imx8mqevk:~#
And caam-keygen application is available:
root@imx8mmevk:~# cd /; find -name "caam-keygen"
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
./usr/bin/caam-keygen
./dev/caam-keygen
./sys/class/misc/caam-keygen
./sys/devices/virtual/misc/caam-keygen
For now, we only support AES algorithms. Therefore, the size of the key accepted for encryption/decryption
is 16, 24, and 32 bytes.
2. Make sure DM-Crypt is enabled.
root@imx8mqevk:~# dmsetup targets
crypt v1.19.0
striped v1.6.0
linear v1.4.0
error v1.5.0
If any of the above is missing, check Kernel configurations or see section Enable disk encryption support in
kernel.
3. Then, provide the device with its key, the black key, which could be created either from a defined plain key
or randomly.
Here is an example for black key encrypted with ECB, from a given plaintext of size 16 bytes:
root@imx8mqevk:~# ./caam-keygen create fromTextkey ecb -t 0123456789abcdef
The result is a Tagged Key and a Blob files written to filesystem (the default location is /data/caam). The
used key encryption scheme is ECB.
root@imx8mqevk:~# ls -la /data/caam/
total 16
drwxr-xr-x 2 root root 4096 Aug 25 15:38 .
drwxr-xr-x 3 root root 4096 Aug 25 15:38 ..
-rw-r--r-- 1 root root 36 Aug 25 15:38 fromTextkey
-rw-r--r-- 1 root root 96 Aug 25 15:38 fromTextkey.bb
Next, add the key in key retention service, using keyctl:
root@imx8mqevk:~# cat /data/caam/fromTextkey | keyctl padd logon logkey: @s
876928653
4. Create a secure volume. It could be a physical partition. In this example, make use of an image file and
mount it later.
root@imx8mqevk:~# dd if=/dev/zero of=encrypted.img bs=1M count=32
32+0 records in
32+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 3.20227 s, 10.5 MB/s
root@imx8mqevk:~#
root@imx8mqevk:~# losetup /dev/loop0 encrypted.img
root@imx8mqevk:~#
5. Use dmsetup to create a new device-mapper device named encrypted for example, and specify the
mapping table. The table can be provided on stdin or as argument.
root@imx8mqevk:~# dmsetup -v create encrypted --table "0 $(blockdev --getsz /
dev/loop0) crypt capi:tk(cbc(aes))-plain :36:logon:logkey: 0 /dev/loop0 0 1
sector_size:512"
Name: encrypted
State: ACTIVE
Read Ahead: 256
Tables present: LIVE
Open count: 0
Event number: 0
Major, minor: 253, 0
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Number of targets: 1
The following is a breakdown of the mapping table:
• start means encrypting begins with sector 0.
• size is the size of the volume in sectors.
• blockdev gets the number of sectors of the device.
• target is crypt.
• cipher is set in Kernel Crypto API format to use Tagged Key. cipher set to capi:tk(cbc(aes))-
plain and key set to :36:logon:logkey: leads to use of the logon key with CAAM Tagged Key
transformation.
• IV is the Initialization Vector defined to plain, initial vector, which is the 32-bit little-endian version of the
sector number, padded with zeros if necessary.
• key type is the Keyring key service type, set to Logon Key. 36 is the key size in bytes.
• key name is the key description to identify the key to load.
• IV offset is the value to add to sector number to compute the IV value.
• device is the path to device to be used as backend; it contains the encrypted data.
• offset represents encrypted data begins at sector 0 of the device.
• optional parameters represent the number of optional parameters.
• sector_size specifies the encryption sector size.
For more detailed options and descriptions, refer to https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMCrypt.
The created device appears in /dev/mapper:
root@imx8mqevk:~# dmsetup table --showkey encrypted
0 65536 crypt capi:tk(cbc(aes))-plain :36:logon:logkey: 0 7:0 0
6. Create a file system on the device.
root@imx8mqevk:~# mkfs.ext4 /dev/mapper/encrypted
mke2fs 1.45.3 (14-Jul-2019)
Creating filesystem with 32768 1k blocks and 8192 inodes
Filesystem UUID: 3ba01ad8-ba03-4389-a955-5136b3173c35
Superblock backups stored on blocks:
8193, 24577
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information:l done
7. Set up a mount point.
root@imx8mqevk:~# mkdir /mnt/encrypted
8. Mount the mapped device.
root@imx8mqevk:~# mount -t ext4 /dev/mapper/encrypted /mnt/encrypted/
[ 9409.936183] EXT4-fs (dm-0): mounted filesystem with ordered data mode.
Opts: (null)
[ 9409.943892] ext4 filesystem being mounted at /mnt/encrypted supports
timestamps until 2038 (0x7fffffff)
9. Write to device.
root@imx8mqevk:~# echo "This is an encrypt with black key (ECB from text
16 bytes key size) test of full disk encryption on i.MX" > /mnt/encrypted/
readme.txt
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
18. Unmount the device and deactivate the device mapper device.
root@imx8mqevk:~# umount /mnt/encrypted/; dmsetup remove encrypted
10.6.1 Prerequisites
The caam-keygen application is needed to import the black key from the black blob. Make sure that the caam-
keygen application is already present at /usr/bin.
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-
arm-8.2-2019.01-x86_64-aarch64-elf.tar.xz
$ tar xf gcc-arm-8.2-2019.01-x86_64-aarch64-elf.tar.xz
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
10.6.3 Usage
After the device successfully boots with the previously generated image, caam-decrypt can be used to decrypt
an encrypted data stored in a file.
$ ./caam-decrypt
Application usage: caam-decrypt [options]
Options:
<blob_name> <enc_algo> <input_file> <output_file>
<blob_name> the absolute path of the file that contains the black blob
<enc_algo> can be AES-256-CBC
<input_file> the absolute path of the file that contains input data
initialization vector(iv) of 16 bytes prepended
size of input file must be multiple of 16
<output_file> the absolute path of the file that contains output data
where:
• myblob: generated black key blob. The caam-keygen application imports a black key from the black blob.
This black key is used by CAAM for decryption.
• AES-256-CBC: currently the only supported symmetric algorithm used for decryption operation. Make sure
that the encrypted data must use the same algorithm.
• my_encrypted_file: Encrypted data stored in a file. Initialization vector(iv) of 16 bytes used during
encryption must be prepended to encrypted data.
AES Encrypted file format
16 Octets - Initialization Vector (IV) is an input to encryption algorithm.
nn Octets - Encrypted message (for AES-256-CBC, it must be multiple of 16)
• output_decrypted: contains decrypted data after successful decryption operation.
10.7.1 Prerequisites
Check OpenSSL version using the following command. It must be 3.0.0 or higher.
openssl version
root@imx8mmevk:~# openssl req -new -newkey rsa:2048 -nodes -keyout rsa.key -out
rsa.csr
root@imx8mmevk:~# openssl x509 -req -sha256 -days 365 -in rsa.csr -signkey
rsa.key -out server.pem
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Remove -quiet to see full client logs. With TLSv1.2, the Kernel TLS supports these ciphers:
• AES128-GCM-SHA256
• AES256-GCM-SHA384
• ECDHE-RSA-AES128-GCM-SHA256
• ECDHE-RSA-AES256-GCM-SHA384
Secure and trusted keys are derived using a hardware security engine for greater security while the security
of user-key depends on the user-defined mechanisms irrespective of the hardware. The secure-key is derived
using the Layerscape's SEC (aka CAAM). The trusted-key can be used on the platforms supporting TPM.
The encrypted key acts as an HMAC key, which is subsequently used to calculate the HMAC value
(security.evm) over other security attributes. This key is stored internally by the kernel and user can only see
its blob.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
11 Connectivity
This section describes the connectivity for Bluetooth wireless technology and Wi-Fi, as well as for USB type-C.
Table 71. On-board chips and external solutions for Bluetooth and Wi-Fi support
SoC On-board chip PCIe M.2 card uSD card or SDIO M.2 card
8QuadXPlus/8DXL - NXP 88W8997 (tested with -
Murata LBEE5XV1YM)
NXP PCIe 88W9098 (tested
with Murata LBEE5ZZ1XL)
8QuadMax - NXP 88W8997 (tested with -
Murata LBEE5XV1YM)
NXP PCIe 88W9098 (tested
with Murata LBEE5ZZ1XL)
8M Quad - NXP 88W8997 (tested with NXP SDIO 88W8997 (tested
Murata LBEE5XV1YM) with Murata LBEE5XV1YM)
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Table 71. On-board chips and external solutions for Bluetooth and Wi-Fi support...continued
SoC On-board chip PCIe M.2 card uSD card or SDIO M.2 card
NXP PCIe 88W9098 (tested NXP SDIO 88W9098 (tested
with Murata LBEE5ZZ1XL). with Murata LBEE5ZZ1XL)
8M Nano NXP 88W8987 (tested with - NXP SDIO IW612 (tested
AzureWave AW-CM358SM) with Murata LBES5PL2EL)
Note: All Murata LBEE5QD1ZM are tested on i.MX 6/i.MX 7 platforms along with the Murata M.2-to-usd
adapter.
The wireless driver supports wpa_supplicant, which is a WEP/WPA/WPA2/WPA3 encryption authenticated tool.
• Wi-Fi driver: supports NXP 88W8987-based modules with SDIO interface, NXP 88W9098-based modules
with PCIe and SDIO interfaces, NXP 88W8997-based modules with PCIe and SDIO interfaces, NXP IW416-
based modules with SDIO interface, NXP 88W8801-based modules with SDIO interface, and NXP IW612-
based modules with SDIO interface.
• Firmware
The NXP release package already includes all NXP, Wi-Fi/Bluetooth firmware. It requires to accept NXP
license.
To run Wi-Fi, execute the following commands first and follow common commands below:
• For the following steps, execute these commands using connman
# For all the Wi-Fi modules:
modprobe moal mod_para=nxp/wifi_mod_para.conf
$connmanctl
connmanctl> enable wifi
connmanctl> scan wifi
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
To run NXP Bluetooth with BlueZ stack, execute the following commands (it requires load Wi-Fi first to load
Bluetooth firmware):
Run the following commands to connect the Bluetooth device for all chips:
$ bluetoothctl
[bluetooth]# default-agent
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]# pair xx:xx:xx:xx:xx:xx
[BT dev]# connect xx:xx:xx:xx:xx:xx
[BT dev]# quit
Note:
• Device: /dev/ttymxcN or /dev/ttyLPN.
• Different boards have different devices.
The i.MX 6 boards require board rework to support the Bluetooth/Wi-Fi enablement as well as running with the
Bluetooth/Wi-Fi device tree. The following is a list of the hardware modifications required and possibly conflicts
caused by these modifications.
• i.MX 6QuadPlus/Quad/Dual/DualLite/Solo: See https://community.nxp.com/docs/DOC-94235. This change
HAS a pin conflict with: EPDC/SPI-NOR/GPIO-LED.
• i.MX 6SoloX: Install R328, and disconnect R327. Connect with SD2 slot and BLUETOOTH CABLE
CONNECTOR J19. It has no Pin conflict with other modules.
• i.MX 6SLL: Install R127, and double check to ensure R126 and R128 are installed. Connect with SD3 slot and
BLUETOOTH CABLE CONNECTOR J4. It has no Pin conflict with other modules.
• i.MX 6UL/ULL/ULZ: Install R1701. It has no Pin conflict with other modules.
Rework is also required to support NXP PCIe 88W9098 on i.MX 8M Plus, and NXP SDIO 88W8997, NXP SDIO
IW416, NXP SDIO 88W8801, and SDIO 88W9098 on i.MX 8M Quad.
• To run NXP PCIe 88W9098 on i.MX 8M Plus, perform the hardware rework as follows:
Change R452 to 0 ohm.
• To run NXP SDIO 88W89997, NXP SDIO IW416, SDIO 88W8801, and SDIO 88W9098 on i.MX 8M Quad,
perform the hardware rework as follows:
Remove the following 0 Ω 0402 resistors: R1603, R1617, R1618, R1619, R1620, and R1621 (micro SD card
J1601)
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Install the following 0 Ω 0402 resistors: R1429, R1430, R1431, R1432, R1433, R1434, R1435, and R1436
(M.2 J1401)
The following describes the connectivity for USB type-C and power delivery connection on the i.MX
8QuadXPlus MEK board.
• The Linux release includes USB type-C and PD stack, which is enabled by default. The specific power
parameters are passed in by DTS. The following fsl-imx8qxp-mek is an example:
typec_ptn5110: typec@50 {
compatible = "usb,tcpci";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_typec>;
reg = <0x50>;
interrupt-parent = <&gpio1>;
interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
ss-sel-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
reset-gpios = <&pca9557_a 7 GPIO_ACTIVE_HIGH>;
src-pdos = <0x380190c8>;
snk-pdos = <0x380190c8 0x3802d0c8>;
max-snk-mv = <9000>;
max-snk-ma = <1000>;
op-snk-mw = <9000>;
port-type = "drp";
sink-disable;
default-role = "source";
status = "okay";
};
For power capability related configuration, users need to check the PD specification to see how to composite
the PDO value. To make it support power source role for more voltages, specify the source PDO. The i.MX
8QuadXPlus board can support 5 V and 12 V power supply.
• The Linux BSP of the Alpha and Beta releases on the i.MX 8QuadXPlus MEK platform only supports power
source role for 5 V.
• Users can use /sys/kernel/debug/tcpm/2-0050 to check the power delivery state, which is for debugging
purpose information.
• Booting only by type-C port power supply is not supported on the Alpha release.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
11.4 Certification
12.1 Introduction
There are counters in some i.MX 8 DDR controllers, which are used to monitor DDR signals. Some signals can
help users monitor DDR transactions and calculate DDR bandwidth.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
13.1 Introduction
The One-Time Programmable Controller driver is realized with the NVMEM Subsystem, which introduces
DT representation for consumer devices to get the data they require (MAC addresses, SoC/Revision ID, part
numbers, and so on) from the NVMEMs.
The first data in reg is 0x90, 0x400 + 0x90 * 0x4 = 0x640, 0x640 is the first Fuse address of MAC_ADDR. 0x4
represents 4 bytes.
EAR00386
IW416 Type 1XK (LBEE5CJ1XK)
EAR00385
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
EAR00364
88W8997 Type 1YM (LBEE5XV1YM)
EAR00370
88W9098 Type 1XL (LBEE5ZZ1XL)
EAR00387
Table 74. Murata Wi-Fi/Bluetooth solutions for NXP and Embedded Artists EVKs
Embedded Artists M.2
EVK Murata module Interconnect
Module Part #
NXP i.MX 8QuadMax Type 1YM (PCIe) M.2 EAR00370
Type 1XL (PCIe) M.2 EAR00387
NXP i.MX 8QuadXPlus Type 1YM (PCIe) M.2 EAR00370
Type 1XL (PCIe) M.2 EAR00387
NXP i.MX 8M Type 1XK uSD-M.2 EAR00385
Type 1ZM uSD-M.2 EAR00364
[1]
Type 1YM (SDIO ) uSD-M.2 EAR00370
[1]
Type 1XL (SDIO ) uSD-M.2 EAR00387
Type 1YM (PCIe) M.2 EAR00370
Type 1XL (PCIe) M.2 EAR00387
NXP i.MX 8DXL Type 1YM (PCIe) M.2 EAR00370
Type 1XL (PCIe) M.2 EAR00387
NXP i.MX 8M Plus Type 1XK M.2 EAR00385
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Table 74. Murata Wi-Fi/Bluetooth solutions for NXP and Embedded Artists EVKs...continued
Embedded Artists M.2
EVK Murata module Interconnect
Module Part #
Type 1ZM M.2 EAR00364
[1]
Type 1YM (SDIO ) M.2 EAR00370
[1]
Type 1XL (SDIO ) M.2 EAR00387
Type 1YM (PCIe) M.2 EAR00370
Type 1XL (PCIe) M.2 EAR00387
NXP i.MX 8M Mini LPDDR4 Type 1XK uSD-M.2 EAR00385
Type 1ZM uSD-M.2 EAR00364
[1]
Type 1YM (SDIO ) uSD-M.2 EAR00370
[1]
Type 1XL (SDIO ) uSD-M.2 EAR00387
Type 1YM (PCIe) M.2 EAR00370
Type 1XL (PCIe) M.2 EAR00387
NXP i.MX 8M Nano LPDDR4 Type 1XK uSD-M.2 EAR00385
Type 1ZM uSD-M.2 EAR00364
[1]
Type 1YM (SDIO ) uSD-M.2 EAR00370
[1]
Type 1XL (SDIO ) uSD-M.2 EAR00387
NXP i.MX 7Dual Type 1XK uSD-M.2 EAR00385
Type 1ZM uSD-M.2 EAR00364
[1]
Type 1YM (SDIO ) uSD-M.2 EAR00370
NXP i.MX 7ULP Type 1XK uSD-M.2 EAR00385
Type 1ZM uSD-M.2 EAR00364
NXP i.MX 6QuadPlus Type 1XK uSD-M.2 EAR00385
NXP i.MX 6Quad Type 1YM (SDIO )
[1]
uSD-M.2 EAR00370
NXP i.MX 6DL
NXP i.MX 6SLL Type 1XK uSD-M.2 EAR00385
NXP i.MX 6UL Type 1ZM uSD-M.2 EAR00364
NXP i.MX 6ULL/ULZ [1]
Type 1YM (SDIO ) uSD-M.2 EAR00370
[1] Default strapping option on Embedded Artists 1YM/1XL M.2 module is WLAN-PCIe. Refer to Embedded Artists datasheet on how to modify strapping on
M.2 module for WLAN-SDIO configuration.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
17 Revision History
This table provides the revision history.
Revision history
Revision number Date Substantive changes
L4.9.51_imx8qxp-alpha 11/2017 Initial release
L4.9.51_imx8qm-beta1 12/2017 Added i.MX 8QuadMax
L4.9.51_imx8mq-beta 12/2017 Added i.MX 8M Quad
L4.9.51_8qm-beta2/8qxp-beta 02/2018 Added i.MX 8QuadMax Beta2 and i.MX 8QuadXPlus Beta
L4.9.51_imx8mq-ga 03/2018 Added i.MX 8M Quad GA
L4.9.88_2.0.0-ga 05/2018 i.MX 7ULP and i.MX 8M Quad GA release
L4.9.88_2.1.0_8mm-alpha 06/2018 i.MX 8M Mini Alpha release
L4.9.88_2.2.0_8qxp-beta2 07/2018 i.MX 8QuadXPlus Beta2 release
L4.9.123_2.3.0_8mm 09/2018 i.MX 8M Mini GA release
L4.14.62_1.0.0_beta 11/2018 i.MX 4.14 Kernel Upgrade, Yocto Project Sumo upgrade
L4.14.78_1.0.0_ga 01/2019 i.MX6, i.MX7, i.MX8 family GA release
L4.14.98_2.0.0_ga 04/2019 i.MX 4.14 Kernel upgrade and board updates
L4.19.35_1.0.0 07/2019 i.MX 4.19 Beta Kernel and Yocto Project Upgrades
L4.19.35_1.1.0 10/2019 i.MX 4.19 Kernel and Yocto Project Upgrades
LF5.4.3_1.0.0 03/2020 i.MX 5.4 Kernel and Yocto Project Upgrades
L5.4.3_2.0.0 04/2020 i.MX 5.4 Alpha release for i.MX 8M Plus and 8DXL EVK
boards
L5.4.24_2.1.0 06/2020 i.MX 5.4 Beta release for i.MX 8M Plus, Alpha2 for 8DXL, and
consolidated GA for released i.MX boards
L5.4.47_2.2.0 09/2020 i.MX 5.4 Beta2 release for i.MX 8M Plus, Beta for 8DXL, and
consolidated GA for released i.MX boards
L5.4.70_2.3.0 12/2020 i.MX 5.4 consolidated GA for release i.MX boards including i.
MX 8M Plus and i.MX 8DXL
L5.4.70_2.3.0 01/2021 Updated the command lines in Section "Running the Arm
Cortex-M4 image"
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Revision history...continued
Revision number Date Substantive changes
LF5.10.9_1.0.0 03/2021 Upgraded Yocto Project to Gatesgarth and the kernel
upgraded to 5.10.9
LF5.10.35_2.0.0 06/2021 Upgraded Yocto Project to Hardknott and the kernel upgraded
to 5.10.35
LF5.10.52_2.1.0 09/2021 Updated for i.MX 8ULP Alpha and the kernel upgraded to
5.10.52
LF5.10.52_2.1.0 10/2021 Added an appendix for Murata Wi-Fi/Bluetooth solutions
LF5.10.72_2.2.0 12/2021 Upgraded the kernel to 5.10.72 and updated the BSP
LF5.15.5_1.0.0 03/2022 Upgraded to the 5.15.5 kernel, Honister Yocto, and Qt6
LF5.15.32_2.0.0 06/2022 Upgraded to the 5.15.32 kernel, U-Boot 2022.04, and
Kirkstone Yocto
LF5.15.52_2.1.0 09/2022 Upgraded to the 5.15.52 kernel, and added the i.MX 93.
LF5.15.71_2.2.0 12/2022 Upgraded to the 5.15.71 kernel.
LF6.1.1_1.0.00 03/2023 Upgraded to the 6.1.1 kernel.
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Contents
1 Overview .............................................................. 2 4.7 Running Linux OS on the target ...................... 39
1.1 Audience ............................................................ 2 4.7.1 Running the image from NAND ....................... 41
1.2 Conventions ....................................................... 2 4.7.2 Running Linux OS from Parallel NOR ............. 42
1.3 Supported hardware SoCs and boards ............. 2 4.7.3 Running the Linux OS image from QuadSPI ... 42
1.4 References .........................................................3 4.7.4 Running the Arm Cortex-M4/7/33 image ......... 42
2 Introduction ......................................................... 4 4.7.5 Linux OS login ................................................. 45
3 Basic Terminal Setup ..........................................4 4.7.6 Running Linux OS from MMC/SD ....................45
4 Booting Linux OS ............................................... 5 4.7.7 Running the Linux image from NFS ................ 46
4.1 Software overview ............................................. 5 4.8 Arm SystemReady-IR ...................................... 46
4.1.1 Bootloader ..........................................................6 4.8.1 Arm SystemReady-IR ACS compliance test .... 46
4.1.2 Linux kernel image and device tree ...................7 4.8.2 Capsule update ............................................... 47
4.1.3 Root file system .................................................7 4.8.3 Linux distro installation .................................... 47
4.2 Universal update utility ...................................... 7 5 Enabling Solo Emulation ..................................48
4.2.1 Downloading UUU ............................................. 7 6 Power Management .......................................... 48
4.2.2 Using UUU .........................................................7 6.1 Suspend and resume ...................................... 48
4.3 Preparing an SD/MMC card to boot .................. 8 6.2 CPU frequency scaling .................................... 49
4.3.1 Preparing the card .............................................9 6.3 Bus frequency scaling ..................................... 49
4.3.2 Copying the full SD card image .......................10 7 Multimedia ..........................................................50
4.3.3 Partitioning the SD/MMC card ......................... 10 7.1 i.MX multimedia packages ...............................50
4.3.4 Copying a bootloader image ............................11 7.2 Building limited access packages .................... 51
4.3.5 Copying the kernel image and DTB file ........... 11 7.3 Multimedia use cases ...................................... 51
4.3.6 Copying the root file system (rootfs) ................ 12 7.3.1 Playback use cases .........................................51
4.4 Downloading images ....................................... 13 7.3.1.1 Audio-only playback .........................................51
4.4.1 Downloading images using U-Boot ..................13 7.3.1.2 Video-only playback .........................................52
4.4.1.1 Flashing an Arm Cortex-M4 image on 7.3.1.3 Audio/Video file playback .................................52
QuadSPI .......................................................... 13 7.3.1.4 Multichannel audio playback ............................52
4.4.1.2 Downloading an image to MMC/SD .................14 7.3.1.5 Other methods for playback ............................ 52
4.4.1.3 Using eMMC ....................................................16 7.3.1.6 Video playback to multiple displays ................. 53
4.4.1.4 Flashing U-Boot on SPI-NOR from U-Boot ...... 18 7.3.2 Audio encoding ................................................54
4.4.1.5 Flashing U-Boot on Parallel NOR from U- 7.3.3 Video encoding ................................................ 54
Boot ..................................................................20 7.3.4 Transcoding ..................................................... 55
4.4.2 Using an i.MX board as the host server to 7.3.5 Audio recording ............................................... 56
create a rootfs ................................................. 20 7.3.6 Video recording ................................................57
4.5 How to boot the i.MX boards ...........................23 7.3.7 Audio/Video recording ..................................... 57
4.5.1 Booting from an SD card in slot SD1 ...............23 7.3.8 Camera preview .............................................. 58
4.5.2 Booting from an SD card in slot SD2 ...............24 7.3.9 Recording the TV-in source .............................58
4.5.3 Booting from an SD card in slot SD3 ...............25 7.3.10 Web camera .................................................... 58
4.5.4 Booting from an SD card in slot SD4 ...............25 7.3.11 HTTP streaming .............................................. 58
4.5.5 Booting from eMMC ........................................ 26 7.3.12 HTTP live streaming ........................................ 59
4.5.6 Booting from SATA .......................................... 27 7.3.13 MPEG-DASH streaming .................................. 59
4.5.7 Booting from NAND ......................................... 28 7.3.14 Real Time Streaming Protocol (RTSP)
4.5.8 Booting from SPI-NOR .................................... 28 playback ...........................................................59
4.5.9 Booting from EIM (Parallel) NOR .................... 28 7.3.15 RTP/UDP MPEGTS streaming ........................ 60
4.5.10 Booting from QuadSPI or FlexSPI ................... 29 7.3.16 RTSP streaming server ................................... 61
4.5.11 Serial download mode for the 7.3.17 Video conversion ............................................. 61
Manufacturing Tool .......................................... 30 7.3.18 Video composition ........................................... 62
4.5.12 How to build U-Boot and Kernel in 7.4 PulseAudio input/output settings ..................... 63
standalone environment .................................. 32 7.5 Installing gstreamer1.0-libav into rootfs ........... 65
4.5.13 How to build imx-boot image by using imx- 8 Audio .................................................................. 65
mkimage .......................................................... 35 8.1 DSP support .................................................... 66
4.6 Flash memory maps ........................................ 37 8.1.1 HiFi 4 DSP framework .....................................66
4.6.1 MMC/SD/SATA memory map .......................... 38 8.1.2 Sound Open Firmware .................................... 66
4.6.2 NAND flash memory map ................................38 8.2 HDMI eARC support ........................................66
4.6.3 Parallel NOR flash memory map ..................... 38 8.3 Low-power voice solution ................................ 67
4.6.4 SPI-NOR flash memory map ........................... 38 8.3.1 Introduction ...................................................... 67
4.6.5 QuadSPI flash memory map ........................... 39 8.3.2 Standard voice solution ................................... 68
IMXLUG All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
8.3.3 Audio Front End (AFE) .................................... 69 10.6 crypto_af_alg application support .................. 101
8.3.4 Linux drivers .................................................... 73 10.6.1 Prerequisites .................................................. 101
8.3.5 Cortex-M Image ............................................... 73 10.6.2 Building the kernel ......................................... 101
8.3.5.1 Application name ............................................. 73 10.6.2.1 Kernel configuration .......................................101
8.3.5.2 Board setup ..................................................... 73 10.6.2.2 Building a toolchain ....................................... 101
8.3.5.3 Execution ......................................................... 74 10.6.2.3 Cross compiling the user space sources ....... 101
8.3.6 Power consumption notes ............................... 74 10.6.3 Usage .............................................................102
8.4 Conversa Integration ....................................... 74 10.6.4 Use case example ......................................... 102
9 Graphics .............................................................75 10.7 Kernel TLS offload .........................................102
9.1 imx-gpu-sdk ..................................................... 76 10.7.1 Prerequisites .................................................. 102
9.2 G2D-imx-samples ............................................ 76 10.7.2 Running Kernel TLS test ............................... 102
9.3 viv_samples ..................................................... 76 10.8 IMA/EVM on i.MX SoCs ................................ 103
9.4 Qt 6 ..................................................................77 10.8.1 EVM Key on user keyrings ............................ 103
10 Security .............................................................. 77 10.8.2 Modes of operation in IMA EVM ....................104
10.1 CAAM kernel driver ......................................... 77 10.8.3 Build Steps .................................................... 104
10.1.1 Introduction ...................................................... 77 10.8.4 Steps to verify IMA EVM feature ................... 105
10.1.2 Source files ......................................................78 11 Connectivity .....................................................105
10.1.3 Module loading ................................................ 79 11.1 Connectivity for Bluetooth wireless
10.1.4 Kernel configuration .........................................79 technology and Wi-Fi .....................................105
10.1.5 How to test the drivers .................................... 80 11.2 Connectivity for USB type-C ..........................108
10.2 Crypto algorithms support ............................... 82 11.3 NXP Bluetooth/Wi-Fi information ................... 108
10.3 CAAM Job Ring backend driver 11.4 Certification .................................................... 109
specifications ................................................... 83 11.4.1 WFA certification ............................................109
10.3.1 Verifying driver operation and correctness .......84 11.4.2 Bluetooth controller certification .....................109
10.3.2 Incrementing IRQs in /proc/interrupts .............. 84 12 DDR Performance Monitor ............................. 109
10.3.3 Verifying the 'self test' fields say 'passed' 12.1 Introduction .................................................... 109
in /proc/crypto .................................................. 84 12.2 Frequently used events ................................. 109
10.4 OpenSSL offload ............................................. 85 12.3 Showing supported events ............................ 110
10.4.1 OpenSSL software architecture .......................85 12.4 Examples for monitoring transactions ............110
10.4.2 OpenSSL's ENGINE interface ......................... 86 12.5 Performance metric ....................................... 111
10.4.3 NXP solution for OpenSSL hardware 12.5.1 Showing supported metric ............................. 111
offloading ......................................................... 87 12.5.2 Monitoring transactions ..................................112
10.4.4 Deploying OpenSSL into rootfs ....................... 87 12.6 DDR Performance usage summary ............... 112
10.4.5 Running OpenSSL benchmarking tests with 13 One-Time Programmable Controller Driver
cryptodev engine ............................................. 87 Using NVMEM Subsystem ..............................112
10.4.5.1 Running OpenSSL benchmarking tests for 13.1 Introduction .................................................... 112
symmetric ciphering and digest ....................... 88 13.2 NVMEM provider OCOTP ..............................112
10.4.6 Running OpenSSL benchmarking tests with 13.3 NVMEM consumer .........................................112
AF_ALG engine ............................................... 88 13.4 Examples to read/write the raw NVMEM file
10.4.6.1 Running OpenSSL benchmarking tests for in user space ................................................. 113
symmetric ciphering and digest ....................... 88 14 NXP eIQ Machine Learning ............................ 113
10.4.7 Running OpenSSL asymmetric tests with 15 Murata Wi-Fi/Bluetooth Solutions ..................113
PKCS#11 based engine .................................. 89 16 Note About the Source Code in the
10.4.7.1 Running p11tool to generate key (RSA or Document .........................................................115
EC) ...................................................................89 17 Revision History ..............................................116
10.4.7.2 Using OpenSSL from command line ............... 90
10.4.7.3 Running OpenSSL test for RSA ...................... 90
10.4.7.4 Running OpenSSL test for EC .........................91
10.5 Disk encryption acceleration ............................91
10.5.1 Enabling disk encryption support in kernel .......92
10.5.2 User space tools for disk encryption ................93
10.5.3 DM-Crypt using CAAM backed keys ............... 93
10.5.3.1 DM-Crypt with Trusted keys backed by
CAAM ...............................................................94
10.5.3.2 DM-Crypt with CAAM’s tagged key ................. 96
10.5.4 Usage ...............................................................97