IMXWGU
IMXWGU
Document information
Information Content
Keywords i.MX, Windows 10 IoT
Abstract i.MX Windows 10 IoT User’s Guide describes the process of building and installing Windows 10
IoT OS BSP (Board Support Package) for the i.MX platform. It also covers special i.MX features
and how to use them.
NXP Semiconductors
IMXWGU
i.MX Windows 10 IoT User’s Guide
1 Overview
The User’s Guide describes the process of building and installing Windows 10 IoT OS BSP (Board Support
Package) for the i.MX platform. It also covers special i.MX features and how to use them. The guide lists the
steps to run the i.MX platform, including board DIP switch settings (see i.MX Windows 10 IoT Quick Start Guide,
IMXWQSG ) and instructions on the usage and configuration of U-Boot bootloader. Features covered in this
guide may be specific to particular boards or SoCs. For the capabilities of a particular board or SoC, see i.MX
Windows 10 IoT Release Notes (IMXWNR).
1.1 Audience
This chapter is intended for software, hardware, and system engineers planning to use the product and anyone
who wants to know more about the product.
1.2 Conventions
This chapter 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.6 References
For more information about Windows 10 IoT Enterprise, see Microsoft online documentation.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• http://windowsondevices.com
The following Quick Start Guides contain basic information on the board and setting it up. They are available on
the NXP website.
• i.MX 8M Quad Evaluation Kit Quick Start Guide
• i.MX 8M Mini Evaluation Kit Quick Start Guide
• i.MX 8M Nano Evaluation Kit Quick Start Guide
• i.MX 8M Plus Evaluation Kit Quick Start Guide
• i.MX 8QuadXPlus Multisensory Enablement Kit
Documentation is available online at nxp.com
• i.MX 8 information is at http://www.nxp.com/imx8
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
• After installing all Windows Kits, restart the computer and check if you have the correct versions installed in
the Control panel.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
mv release cst
rm cst-3.1.0.tgz
4. Extract the i.MX firmware from the NXP website and place it in firmware-imx.
chmod +x firmware-imx-8.18.bin
./firmware-imx-8.18.bin
mv firmware-imx-8.18 firmware-imx
rm firmware-imx-8.18.bin
Note: It extracts the tool inside the bsp repository and renames the newly created folder to firmware-imx
to get <BSP_DIR>/firmware-imx/firmware/ ddr/ in directory tree.
5. Your directory structure must contain the following folders.
- <BSP_DIR>
|- cst (manually downloaded)
|- firmware-imx (manually downloaded)
|- Documentation
|- MSRSec
|- RIoT
|- imx-atf
|- imx-mkimage
|- imx-optee-os
|- imx-windows-iot
|- mu_platform_nxp
|- patches
|- uboot-imx
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Note: If you return here facing problems during UEFI build, use --force to clean the environment.
Make sure to commit or stash all your changes first. The --force argument performs git reset –hard.
b. Initialize and update Mu platform dependencies.
python3 NXP/MX8M_EVK/PlatformBuild.py --update
Note: If this command fails, try upgrading mono. The best way to do it is to uninstall mono and reinstall
it from its official repository. The process is described at https://www.mono-project.com/download/stable/
#download-lin.
11. Return to BSP root.
popd
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
– 8Mp, MX8M_PLUS_EVK
– 8X, MX8QXP_MEK
– 93, MX93_11X11_EVK
• -t|-target_app specifies target to build
– all = build all components
– u|uboot = build u-boot (by default with UUU tool)
– optee = build optee core
– apps|tee_apps = build optee trusted applications
– uimg|uboot_image = create bootable image
– tools|uefi_tools = build UEFI tools
– uefi = build UEFI
– profile_dev = build UEFI with development profile (set by default)
– profile_secure = build UEFI with secure profile
– profile_frontpage = build UEFI with frontpage profile
– secured_efi|secured_uefi = build UEFI in secure mode + sign image(the name of the resulting
firmware is prefixed with signed_)
• [-cap|-capsule] creates capsule
• [-c|-clean] cleans build files before build
• [-fw|-fw_bin] requests build of firmware from existing binaries
• [-nu|-no_uuu] builds uboot without UUU tool (the name of the resulting firmware does not contain
_uuu suffix)
• [-h|-help] prints manual for script usage
• [-bc|build_configuration] specifies build configuration of UEFI (RELEASE is selected as default)
– release or RELEASE = for Release version of uefi
– debug or DEBUG = for Debug version of uefi
• [-ao|-advance_option] Advanced options for experienced users
– rpmb_reset_fat = clears RPMB FAT
– rpmb_write_key = writes RPMB KEY into RPMB
– no_rpmb_test_key = uses Hardware-Unique key (HUK) instead of TEST KEY (TEST KEY is used as
default)
– optee_core_v = turns on verbose mode of OpTEE core
– optee_core_vv = turns on the highest verbose mode of OpTEE core
– optee_ta_v = turns on verbose mode of OpTEE trusted applications
– optee_ta_vv = turns on the highest verbose mode of OpTEE trusted applications
• [TARGET_WINDOWS_BSP_DIR] Specifies path to imx-windows-iot, in which the firmware shall be
updated.
• [KEY_ROOT] specifies path to custom PKI root
6. To deploy firmware_uuu.bin to the i.MX development board, follow the process described in i.MX
Windows 10 IoT Quick Start Guide.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
3 Display/GPU driver
This chapter contains several notes related to windows i.MX Gpu driver. Kernel graphic driver consists among
others of gpu driver galcore.sys and display controller driver dispctrl.dll. Setup information file
galcore.inf contains several parameters that are written into Windows registry database and later used
for the driver configuration. To change these parameters, either update registry database directly under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-
bfc1-08002be10318}\0000 key, or update INF file and uninstall/re-install gpu driver, and then reboot.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
4 Power management
Power management consists of the Processor Power Management (PPM) that includes low-power state
transition of processor cores and of the Device Power Management (DPM) that includes power gating and
clock gating of individual devices. An important part of customization of power management is the Power
Engine Plugin (PEP) driver that defines processor and platform low-power states and can handle power
and clock gating for individual devices. This chapter contains notes regarding the current support of power
management for i.MX 8/9 platforms, relevant tools, and utilities.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The PEP handles putting of CPU cores to coordinated low-power (sleep) states as requested by the operating
system. The call sequence that puts CPU core to sleep looks like follows:
```
WindowsOS -> PEP::AcceptProcessorNotification -> PEP:: PpmIdleExecute -> WFI
(Wait for
Interrupt instruction)
```
```
WindowsOS -> PEP::AcceptProcessorNotification -> PEP:: PpmIdleExecute -> SCM
call
->Imx-Atf PSCI CPU_SUSPEND -> HW instructions to CPU sleep
```
The sleeping CPU core is woken from sleep state by interrupt, either a Processor to Processor Interrupt (PPI)
for example, IRQ27 or by device interrupt IRQ > 32, for example, a USB device like mouse or keyboard. See
section related to IRQs.
PEP and Imx-Atf: ATF is the Arm Trusted Firmware, integrated with Uefi and Uboot in firmware.bin. The
ATF implements the PowerStateCoordinatedInterface (PSCI industry standard, DEN0022E_Power_State_
Coordination_Interface.pdf) from ARM specification, incl. the CPU_SUSPEND method used to put CPU cores
into low-power sleep states. The CPU_SUSPEND can specify either standby or Power-down mode. When the
last CPU core goes into the low-power Power-down mode, the whole platform must enter the platform power
down, which includes DDR self-refresh, and setup for wake-up using selected interrupts. In Release Milestone
6, the platform power down is not yet fully integrated with Win10 IoT OS so it needs more effort to have this
functional.
The PEP also ensures that before entering the Coordinated low-power state (defined in PEP) all devices are in
required low-power state. This is defined in PEP: DpmDeviceIdleContraints, the constraints are expected to be
extended in future releases.
PEP and WinDbg: the PEP driver is loaded in Windows OS as one of the first drivers during startup. It can
be replaced and debugged with WinDbg as usual. Enable the #define DBG_MESSAGE_PRINTING in
imxpep_dbg.h file to get traces in the WinDbg command window.
Utility Description
powercfg /a Available sleep states
powercfg /sleepstudy Sleep study HTML report
powercfg /energy Energy efficiency analysis and issues
WinDbg !fxdevice Device power management status
4.4.1 powercfg /a
This command displays the available sleep states.
In i.MX which uses the Modern Standby the only supported state is the S0 Low Power Idle - Network
Connected.
C:\> powercfg /a
The following sleep states are available on this system:
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Within 30 sec after I2C test run => active D0/F0 state:
!fxdevice 0xffffaf8256372010
DevNode: 0xffffaf8251115aa0
UniqueId: "\_SB.I2C2"
InstancePath: "ACPI\NXP0104\2"
Device Power State: PowerDeviceD0
Component Count: 1
Component 0: Current:F0/Deepest:F1 - IDLE (RefCount = 0)
After 30 sec after I2C test run => low power D3/F1 state:
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
!fxdevice 0xffffaf8256372010
DevNode: 0xffffaf8251115aa0
UniqueId: "\_SB.I2C2"
InstancePath: "ACPI\NXP0104\2"
Device Power State: PowerDeviceD3
Component Count: 1
Component 0: Current:F1/Deepest:F1 - IDLE (RefCount = 0)
nt!DbgBreakPointWithStatus:
fffff803`43c08330 d43e0000 brk #0xF000
0: kd> !fxdevice ffffaf82570e9aa0
!fxdevice 0xffffaf82570e9aa0
DevNode: 0xffffaf8251115aa0
UniqueId: "\_SB.I2C2"
InstancePath: "ACPI\NXP0104\2"
Device Power State: PowerDeviceD3
PEP Owner: Default PEP
Acpi Plugin: 0
Acpi Handle: 0
Device Status Flags: DevicePowerNotRequired_DeviceNotified
DevicePowerNotRequired_ReceivedFromPEP
Device Idle Timeout: 0000000000
Device Power On: No Activity
Device Power Off: No Activity
Device Unregister: No Activity
Component Count: 1
Component 0: Current:F1/Deepest:F1 - IDLE (RefCount = 0)
Pep Component: 0xffffaf8256df24d0
Active: 0 Latency: 0 Residency: 0 Wake: 0 Dx IRP: 0 WW IRP: 0
Component Idle State Change: No Activity
Component Activation: No Activity
Component Active: No Activity
Log has 25 entries starting at 0:
# IntTime CPU Cid Tid
--- ---------------- ---- ---- ----
0 000000076660627f 3 4 f0 Device registered with 1 component(s)
1 000000076660627f 3 4 f0 Start power management
2 000000076660627f 3 4 f0 Component 0 latency set to 8000001
3 000000076660627f 3 4 f0 Component 0 residency set to 120000001
4 0000000766609e64 1 4 5c0 Component 0 changed to idle state F1
5 0000000766609e64 1 4 5c0 Power not required from default PEP
6 0000000766609e64 1 4 5c0 Power not required to device
7 0000000766609e64 2 4 ec Power IRP requested with status 0
8 0000000766609e64 2 4 ec Power IRP type D3 dispatched to device
stack
9 0000000766609e64 3 4 e0 Device power state changed to D3
10 0000000766633b5a 1 4 ec Power required from default PEP
11 0000000766633b5a 1 4 ec Power required to device
12 0000000766633b5a 1 4 ec Driver device power required callback
pending
13 0000000766633b5a 1 4 ec Power IRP requested with status 0
14 0000000766633b5a 1 4 ec Power IRP type D0 dispatched to device
stack
15 0000000766638961 2 4 b78 Device power state changed to D0
16 0000000766638961 2 4 b78 Device powered
17 0000000766638961 2 4 b78 Driver device power required callback
completed
18 0000000766638961 3 4 18 Component 0 changed to idle state F0
19 000000076ddba246 0 4 18 Component 0 changed to idle state F1
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5 Secure boot
5.1.1
Secure Boot is a feature that prevents loading malicious pieces of software (rootkits) during the system boot.
To perform a secure boot, the feature has to be supported by the whole boot chain, starting at the device ROM
code and ending in Windows. For more information on how to prepare the board for Secure Boot, see Secure
Provisioning.
For more detailed information on each platform, see:
• Secure boot on i.MX 8M
• Secure boot on i.MX 8QXP
• Secure boot on i.MX 93
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.2.2.3 OP-TEE
Open Portable Trusted Execution Environment (OP-TEE) is an opensource implementation of Trusted
Execution Environment using ARM Trust Zone technology. It provides a way of running applications within
secure world. This project uses OP-TEE as runtime environment for fTPM and Authenticated Variables.
5.2.2.4 ATF
ARM Trusted Firmware is an implementation of firmware running with elevated privileges (EL3) and is used
mostly as a proxy between the OS running in non-secure world and OP-TEE running in secure world.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.2.2.6 UEFI
The Unified Extensible Firmware Interface (UEFI) is a specification defining a unified interface between the
firmware and the OS. UEFI firmware does the rest of the initialization and hands off the control to Windows Boot
Manager.
For more details, see Boot and UEFI.
5.2.3.1.1 Open/Closed
The open/closed state determines whether SECO allows execution of unauthenticated program images.
Open chip allows execution of any program image - unauthenticated images and authenticated images
with bad signature. Closed chip allows only execution of authenticated images. The state is defined by the
SEC_CONFIG[1:0] eFUSE:
5.2.3.1.2 SRKH
The Super Root Key Hash (SRKH) is a set of 8 eFUSES that contain combined hash of hashes of particular
Super Root Keys. Those are one of main components of the HAB chain of trust.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
HAB is a software component responsible for verifying digital signatures. Its API is available to external
applications via ROM vector table (RVT). Before jumping to SPL, ROM verifies the signature of SPL. Only a
valid SPL signature allows boot flow to proceed (see Chip lifecycle).
Once loaded and verified, U-Boot SPL is also considered secure and trusted. U-Boot SPL loads container
image containing Device Tree Blob, ATF, OP-TEE, U-Boot proper and UEFI. When building with -t
secured_efi, the U-Boot SPL verifies signature of each component of the FIT image. The U-Boot SPL will
proceed to proper U-Boot only with the matching signature. The verification is realized by HAB module.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
When HAB verifies the signature of i.MX firmware image, the steps as as follows:
1. Get the CSF location from IVT.
2. Extract the SRK table from CSF.
3. Compute SRKH and verify against fuses. Break if invalid.
4. Verify the CSF and IMG certificates by appropriate SRK from the SRK table. Break if invalid.
5. Verify the CSF signature and the image signature.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
bootloader for application cores may then be loaded directly to RAM (compared to i.MX 8M, which needs an
SPL, that will fit into OCRAM and set up the DDR first).
For more details, see chapter 5.5 Secure Boot Flow with SCU and SECO in i.MX
DualX/8DualXPlus/8QuadXPlus Applications Processor Reference Manual
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.3.3.3 OP-TEE
Open Portable Trusted Execution Environment (OP-TEE) is an opensource implementation of Trusted
Execution Environment using ARM Trust Zone technology. It provides a way of running applications within
secure world. This project uses OP-TEE as runtime environment for fTPM and Authenticated Variables.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.3.3.4 ATF
ARM Trusted Firmware is an implementation of firmware running with elevated privileges (EL3) and is used
mostly as a proxy between the OS running in non-secure world and OP-TEE running in secure world.
5.3.3.6 UEFI
The Unified Extensible Firmware Interface (UEFI) is a specification defining a unified interface between the
firmware and the OS. UEFI firmware does the rest of the initialization and hands off the control to Windows Boot
Manager.
For more details, see Boot and UEFI.
5.3.4.1.1 Open/Closed
The open/closed state determines whether SECO allows the execution of unauthenticated program images.
The open chip allows the execution of any program image - unauthenticated images and authenticated
images with bad signatures. A closed chip allows only the execution of authenticated images. The state can
be controlled, for example, from U-Boot cli via the `ahab_status` command. The status can be either `NXP
closed` (open) or `OEM closed` (closed).
Example:
```
=> ahab_status
Lifecycle: 0x0020, NXP closed
```
5.3.4.1.2 SRKH
The Super Root Key Hash (SRKH) is a set of 16 eFUSES (on i.MX 8QXP) that contain a combined hash of
hashes of particular Super Root Keys. They are one of the main components of the Advanced High Assurance
Boot (AHAB) chain of trust.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
1. Get the SRK table location from the container signature header.
2. Extract the SRK table.
3. Compute SRKH and verify against fuses. Break if invalid.
4. (optional) Verify the SGK certificate by an appropriate SRK from the SRK table. Break if invalid.
5. Verify the container signature.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.4.3.3 OP-TEE
Open Portable Trusted Execution Environment (OP-TEE) is an opensource implementation of Trusted
Execution Environment using ARM Trust Zone technology. It provides a way of running applications within
secure world. This project uses OP-TEE as runtime environment for fTPM and Authenticated Variables.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.4.3.4 ATF
ARM Trusted Firmware is an implementation of firmware running with elevated privileges (EL3) and is used
mostly as a proxy between the OS running in non-secure world and OP-TEE running in secure world.
5.4.3.6 UEFI
The Unified Extensible Firmware Interface (UEFI) is a specification defining a unified interface between the
firmware and the OS. UEFI firmware does the rest of the initialization and hands off the control to Windows Boot
Manager.
For more details, see Boot and UEFI.
5.4.4.1.1 Open/Closed
The open/closed state determines whether AHAB allows the execution of unauthenticated program images. The
open chip allows the execution of any program image - unauthenticated images and authenticated images with
bad signatures. A closed chip allows only the execution of authenticated images. The state can be controlled,
for example, from U-Boot cli via the `ahab_status` command. The status can be either `NXP closed` (open)
or `OEM closed` (closed).
Example:
```
=> ahab_status
Lifecycle: 0x0020, NXP closed
```
5.4.4.1.2 SRKH
The Super Root Key Hash (SRKH) on i.MX 93 is the SHA256 hash of the SRK table. The SRKH is stored in a
set of 8 32-bit eFUSES that contain the hash of the SRK table, containing Super Root Keys. Those are one of
the main components of the Advanced High Assurance Boot (AHAB) chain of trust.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.5.1 RPMB
This repository uses Replay Protected Memory Block (as defined in JEDEC eMMC specification JESD84-
B51) as a secure storage backend. RPMB is a special partition on eMMC memory where every read or write
operation must be authenticated. RPMB access is replay protected in a way, that every operation contains a
signature (MAC), that contains an incremental write counter. The signature is generated using a symmetric key,
that is burned in the eMMC controller and must be known also by issuer of the command. The process of writing
the key to eMMC controller is a one-way process and the key is written in plaintext, it therefore must be done in
a secure environment.
RPMB is mandatory for this system to work since it is used as a secure storage backend for OP-TEE (and OP-
TEE is used by UEFI for storing AuthVars). For more information on how OP-TEE uses RPMB, see the following
link
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
6 Secure provisioning
To achieve full system security with Secure Boot, the following steps must be performed in the correct order:
1. Prepare keys for HAB/AHAB.
2. Lock the device (burn SRKH and SEC_CONFIG fuses).
3. Write the RPMB key.
4. Boot the device and load UEFI keys.
There are many ways to generate HAB/AHAB keys, you are free to provide your own way of generating those.
This guide presents a simple way using CST toolset. After download, see User Guide in <cst_directory>/
docs/CST_UG.pdf.
For detailed steps, follow device-specific guides:
i.MX 8M
i.MX 8QXP
i.MX 93
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
cd <cst_directory>/keys
./hab4_pki_tree.sh
Do you want to use an existing CA key (y/n)?: n
Do you want to use Elliptic Curve Cryptography (y/n)?: y
Enter length for elliptic curve to be used for PKI tree:
Possible values p256, p384, p521: p256
Enter PKI tree duration (years): 10
How many Super Root Keys should be generated? 4
Do you want the SRK certificates to have the CA flag set? (y/n)?: n
The script populates keys and crts folders within CST root folder with private keys and appropriate
certificates. Set KEY_ROOT environment variable to absolute path to CST root folder (the folder containing keys
and crts sub-folders).
export KEY_ROOT=<cst_directory>
Build will automatically fetch keys and certificates from this path to sign firmware binaries.
cd <cst_directory>/crts
../linux64/bin/srktool -h 4 -t SRK_14table.bin -e SRK_fuse.bin -d sha256 -c
./SRK1_sha256_4096_65537_v3_ca_crt.pem,./SRK2_sha256_4096_65537_v3_ca_crt.pem,./
SRK3_sha256_4096_65537_v3_ca_crt.pem,./SRK4_sha256_4096_65537_v3_ca_crt.pem
-f 1
Number of certificates = 4
SRK table binary filename = SRK_14table.bin
SRK Fuse binary filename = SRK_fuse.bin
SRK Fuse binary dump:
SRK HASH[0] = 0x17B73726
SRK HASH[1] = 0x8E5CCC0E
SRK HASH[2] = 0xBC30A7BE
SRK HASH[3] = 0xE9B59C78
SRK HASH[4] = 0x2C682DAE
SRK HASH[5] = 0xDE5FE6C0
SRK HASH[6] = 0x3FF3DC81
SRK HASH[7] = 0x44B5B6FE
The SRK HASH[] array contains the SRKH value divided by four bytes. These are the values that are written to
SRK_HASH eFUSE in the next step.
For more information on how to use srktool, see chapter 3.1.3 Generating HAB4 SRK tables and Efuse Hash
in <cst_directory>/docs/CST_UG.pdf
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The device now contains an SRK Hash composed of your PKI keys and is able to verify firmware binary
signatures. Until locked, the device still accepts unsigned binaries and binaries with bad signature.
Tip: Before locking the chip, boot a signed image from the step Building secured binary and check HAB events:
1. Prepare an SD card with secured binary.
2. Enter U-Boot command line.
3. Enter the hab_status command.
The command should output following text, saying that all signatures are valid:
The chip is now locked and accepts only firmware signed with appropriate keys.
cd <cst_directory>/keys
./ahab_pki_tree.sh
Do you want to use an existing CA key (y/n)?: n
Do you want to use Elliptic Curve Cryptography (y/n)?: y
Enter length for elliptic curve to be used for PKI tree:
Possible values p256, p384, p521: p384
Enter the digest algorithm to use: sha384
Enter PKI tree duration (years): 5
Do you want the SRK certificates to have the CA flag set? (y/n)?: n
The script populates keys and crts folders within the CST root folder with private keys and appropriate
certificates. Set the KEY_ROOT environment variable to absolute path to CST root folder (the folder containing
keys and crts subfolders).
export KEY_ROOT=<cst_directory>
Build automatically fetches keys and certificates from this path to sign firmware binaries.
cd <cst_directory>/crts
../linux64/bin/srktool -a -s sha384 -t SRKtable.bin -e SRKfuse.bin -f 1 -c
SRK1_sha384_secp384r1_v3_usr_crt.pem,SRK2_sha384_secp384r1_v3_usr_crt.pem,SRK3_sha384_secp
Number of certificates = 4
SRK table binary filename = SRKtable.bin
SRK Fuse binary filename = SRKfuse.bin
SRK Fuse binary dump:
SRK HASH[0] = 0x336D1608
SRK HASH[1] = 0xDFCC2D5E
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The SRK HASH[] array contains the SRKH value divided by four bytes. These are the values that will be written
to SRK_HASH eFUSE in the next step (applicable only for i.MX 8QXP)
For more information on how to use srktool, see chapter 3.2.3 Generating AHAB SRK tables and Efuse Hash
in <cst_directory>/docs/CST_UG.pdf
0xC9CAD3BF
0x479DC210
0x79DA681C
0x8C55E093
0x3CF9CF19
0xC7B6DDF0
0xE0C3363E
0x73D8A971
0x240A0EEE
0xE46CE431
The device now contains an SRK Hash composed of your PKI keys and is able to verify firmware binary
signatures. Until locked, the device still accepts unsigned binaries and binaries with bad signature.
Tip: Before locking the chip, boot a signed image from the step Building secured binary and check AHAB
events:
1. Prepare the SD card with secured binary.
2. Enter U-Boot command line.
3. Enter the ahab_status command.
The command should output following text, indicating that all signatures are valid:
=> ahab_status
Lifecycle: 0x0020, NXP closed
No SECO Events Found!
In case of any error, U-Boot prints out and parse SECO events. Example for a missing signature:
=> ahab_status
Lifecycle: 0x0020, NXP closed
SECO Event[0] = 0x0087EE00
CMD = AHAB_AUTH_CONTAINER_REQ (0x87)
IND = AHAB_NO_AUTHENTICATION_IND (0xEE)
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
=> ahab_close
=> reset
The chip is now locked and accepts only firmware signed with appropriate keys. You can check that via
ahab_status command, the lifecycle must be 0x80 OEM closed.
=> ahab_status
Lifecycle: `0x80, OEM closed`
cd <cst_directory>/keys
./ahab_pki_tree.sh
Do you want to use an existing CA key (y/n)?: n
Do you want to use Elliptic Curve Cryptography (y/n)?: y
Enter length for elliptic curve to be used for PKI tree:
Possible values p256, p384, p521: p384
Enter the digest algorithm to use: sha384
Enter PKI tree duration (years): 5
Do you want the SRK certificates to have the CA flag set? (y/n)?: n
The script populates keys and crts folders within the CST root folder with private keys and appropriate
certificates. Set the KEY_ROOT environment variable to absolute path to CST root folder (the folder containing
keys and crts subfolders).
export KEY_ROOT=<cst_directory>
Build automatically fetches keys and certificates from this path to sign firmware binaries.
cd <cst_directory>/crts
../linux64/bin/srktool -a -s sha384 -t SRKtable.bin -e SRKfuse.bin -f 1 -c
SRK1_sha384_secp384r1_v3_usr_crt.pem,SRK2_sha384_secp384r1_v3_usr_crt.pem,
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
SRK3_sha384_secp384r1_v3_usr_crt.pem,SRK4_sha384_secp384r1_v3_usr_crt.pem
Number of certificates = 4
SRK table binary filename = SRKtable.bin
SRK Fuse binary filename = SRKfuse.bin
SRK Fuse binary dump:
SRK HASH[0] = 0x336D1608
SRK HASH[1] = 0xDFCC2D5E
SRK HASH[2] = 0xB582FA14
SRK HASH[3] = 0xDA325A05
SRK HASH[4] = 0xEAB66EDE
SRK HASH[5] = 0xB64F7A87
SRK HASH[6] = 0xC9CAD3BF
SRK HASH[7] = 0x479DC210
SRK HASH[8] = 0x79DA681C
SRK HASH[9] = 0x8C55E093
SRK HASH[10] = 0x3CF9CF19
SRK HASH[11] = 0xC7B6DDF0
SRK HASH[12] = 0xE0C3363E
SRK HASH[13] = 0x73D8A971
SRK HASH[14] = 0x240A0EEE
SRK HASH[15] = 0xE46CE431
The SRK HASH[] is SHA-512 hash of SRK table and is valid only for i.MX 8QXP family (i.MX 93 needs
SHA-256 format). SRKH for i.MX 93 will be prepared later.
For more information on how to use srktool, see chapter 3.2.3 Generating AHAB SRK tables and Efuse Hash
in <cst_directory>/docs/CST_UG.pdf
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
2. Generate SRKH using the following command: openssl dgst -sha256 -binary SRKtable.bin >
SRKfuse93.bin
3. Print contents of SRKH in the format used for writing to fuses: hexdump -e '/4 "0x"' -e '/4
"%X""\n"' < SRKfuse93.bin
The device now contains an SRK Hash composed of your PKI keys and is able to verify firmware binary
signatures. Until locked, the device will still accept unsigned binaries and binaries with bad signature.
Tip: Before locking the chip, boot a signed image from the step Building secured binary and check AHAB
events:
1. Prepare the SD card with secured binary.
2. Enter U-Boot command line.
3. Enter the ahab_status command.
The command must output the following text, indicating that all signatures are valid:
=> ahab_status
Lifecycle: 0x0020, NXP closed
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
In case of any error, U-Boot prints and parses SECO events. Example for a missing signature:
=> ahab_status
Lifecycle: 0x0020, NXP closed
=> ahab_close
=> reset
The chip is now locked and accepts only firmware signed with appropriate keys. You can check that via
ahab_status command, the lifecycle must be 0x80 OEM closed.
=> ahab_status
Lifecycle: `0x80, OEM closed`
6.4.1 RPMB
The following steps for loading RPMB key are only applicable with device in the "closed" state.
Used OP-TEE implementation allows the use of Hardware-Unique key (HUK) that is accessible only from
software running in secure world and thus unreachable from normal OS. This principle provides enhanced
security since the key does not need to be stored in memory, it is generated on demand.
OP-TEE itself is able to burn the key, when built with CFG_RPMB_WRITE_KEY=y. The following steps guide you
on how to prepare a "provisioning" build which contains OP-TEE with RPMB key provisioning enabled. OP-TEE
uses HUK as RPMB key by default.
1. Re-build the firmware using buildme64.sh -b <board-type> -t all -t secured_efi -ao
rpmb_write_key -ao no_rpmb_test_key and store the signed_firmware.bin separately. This
firmware should be used only for RPMB provisioning (at secured place).
2. Burn the provisioning signed_firmware.bin to the SD card and boot it.
OP-TEE automatically burns the RPMB key to eMMC controller during first boot. The RPMB is now fully
provisioned and the boot process should now be unblocked and proceed to UEFI and Windows. You can now
use your production signed_firmware.bin. The boot chain is now secured up to UEFI firmware.
6.4.2 UEFI
Even with Secure Boot settings enabled, the UEFI firmware and Windows still reside in setup mode, where
signatures are not checked. The UEFI automatically transfers to user mode with Secure Boot enabled when PK
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
is written and the OS is restarted. For more details, see Windows Secure Boot Key Creation and Management
Guidance.
6.5 Troubleshooting
6.5.2 Resolution
Re-build OP-TEE with debug prints enabled:
Boot the device with new OP-TEE, review boot messages. Following messages are signalizing that there is a
missing RPMB key:
7 Revision history
Table 2. Revision history
Revision number Date Substantive changes
W0.9.0 1/2022 Private preview release for i.MX8M platform.
W0.9.1 3/2022 Public preview release for i.MX8M platform.
W1.0.0 4/2022 Public release for i.MX8M and i.MX8M Mini platforms.
W1.1.0 6/2022 Public release for i.MX8M Nano and i.MX8M Plus platforms.
W1.2.0 9/2022 Section 1.7 is removed
W.1.2.1 10/2022 Updated for version 1.2.1
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
9 Legal information
9.1 Definitions Terms and conditions of commercial sale — NXP Semiconductors
products are sold subject to the general terms and conditions of commercial
sale, as published at http://www.nxp.com/profile/terms, unless otherwise
Draft — A draft status on a document indicates that the content is still agreed in a valid written individual agreement. In case an individual
under internal review and subject to formal approval, which may result agreement is concluded only the terms and conditions of the respective
in modifications or additions. NXP Semiconductors does not give any agreement shall apply. NXP Semiconductors hereby expressly objects to
representations or warranties as to the accuracy or completeness of applying the customer’s general terms and conditions with regard to the
information included in a draft version of a document and shall have no purchase of NXP Semiconductors products by customer.
liability for the consequences of use of such information.
Export control — This document as well as the item(s) described herein
may be subject to export control regulations. Export might require a prior
9.2 Disclaimers authorization from competent authorities.
Limited warranty and liability — Information in this document is believed Suitability for use in non-automotive qualified products — Unless
to be accurate and reliable. However, NXP Semiconductors does not give this data sheet expressly states that this specific NXP Semiconductors
any representations or warranties, expressed or implied, as to the accuracy product is automotive qualified, the product is not suitable for automotive
or completeness of such information and shall have no liability for the use. It is neither qualified nor tested in accordance with automotive testing
consequences of use of such information. NXP Semiconductors takes no or application requirements. NXP Semiconductors accepts no liability for
responsibility for the content in this document if provided by an information inclusion and/or use of non-automotive qualified products in automotive
source outside of NXP Semiconductors. equipment or applications.
In no event shall NXP Semiconductors be liable for any indirect, incidental, In the event that customer uses the product for design-in and use in
punitive, special or consequential damages (including - without limitation - automotive applications to automotive specifications and standards,
lost profits, lost savings, business interruption, costs related to the removal customer (a) shall use the product without NXP Semiconductors’ warranty
or replacement of any products or rework charges) whether or not such of the product for such automotive applications, use and specifications, and
damages are based on tort (including negligence), warranty, breach of (b) whenever customer uses the product for automotive applications beyond
contract or any other legal theory. NXP Semiconductors’ specifications such use shall be solely at customer’s
own risk, and (c) customer fully indemnifies NXP Semiconductors for any
Notwithstanding any damages that customer might incur for any reason
liability, damages or failed product claims resulting from customer design and
whatsoever, NXP Semiconductors’ aggregate and cumulative liability
use of the product for automotive applications beyond NXP Semiconductors’
towards customer for the products described herein shall be limited in
standard warranty and NXP Semiconductors’ product specifications.
accordance with the Terms and conditions of commercial sale of NXP
Semiconductors.
Translations — A non-English (translated) version of a document, including
the legal information in that document, is for reference only. The English
Right to make changes — NXP Semiconductors reserves the right to
version shall prevail in case of any discrepancy between the translated and
make changes to information published in this document, including without
English versions.
limitation specifications and product descriptions, at any time and without
notice. This document supersedes and replaces all information supplied prior
Security — Customer understands that all NXP products may be subject to
to the publication hereof.
unidentified vulnerabilities or may support established security standards or
specifications with known limitations. Customer is responsible for the design
Suitability for use — NXP Semiconductors products are not designed,
and operation of its applications and products throughout their lifecycles
authorized or warranted to be suitable for use in life support, life-critical or
to reduce the effect of these vulnerabilities on customer’s applications
safety-critical systems or equipment, nor in applications where failure or
and products. Customer’s responsibility also extends to other open and/or
malfunction of an NXP Semiconductors product can reasonably be expected
proprietary technologies supported by NXP products for use in customer’s
to result in personal injury, death or severe property or environmental
applications. NXP accepts no liability for any vulnerability. Customer should
damage. NXP Semiconductors and its suppliers accept no liability for
regularly check security updates from NXP and follow up appropriately.
inclusion and/or use of NXP Semiconductors products in such equipment or
applications and therefore such inclusion and/or use is at the customer’s own Customer shall select products with security features that best meet rules,
risk. regulations, and standards of the intended application and make the
ultimate design decisions regarding its products and is solely responsible
for compliance with all legal, regulatory, and security related requirements
Applications — Applications that are described herein for any of these
concerning its products, regardless of any information or support that may be
products are for illustrative purposes only. NXP Semiconductors makes no
provided by NXP.
representation or warranty that such applications will be suitable for the
specified use without further testing or modification. NXP has a Product Security Incident Response Team (PSIRT) (reachable
at PSIRT@nxp.com) that manages the investigation, reporting, and solution
Customers are responsible for the design and operation of their
release to security vulnerabilities of NXP products.
applications and products using NXP Semiconductors products, and NXP
Semiconductors accepts no liability for any assistance with applications or
customer product design. It is customer’s sole responsibility to determine
whether the NXP Semiconductors product is suitable and fit for the
customer’s applications and products planned, as well as for the planned
9.3 Trademarks
application and use of customer’s third party customer(s). Customers should
Notice: All referenced brands, product names, service names, and
provide appropriate design and operating safeguards to minimize the risks
trademarks are the property of their respective owners.
associated with their applications and products.
NXP Semiconductors does not accept any liability related to any default, NXP — wordmark and logo are trademarks of NXP B.V.
damage, costs or problem which is based on any weakness or default AMBA, Arm, Arm7, Arm7TDMI, Arm9, Arm11, Artisan, big.LITTLE,
in the customer’s applications or products, or the application or use by Cordio, CoreLink, CoreSight, Cortex, DesignStart, DynamIQ, Jazelle,
customer’s third party customer(s). Customer is responsible for doing all Keil, Mali, Mbed, Mbed Enabled, NEON, POP, RealView, SecurCore,
necessary testing for the customer’s applications and products using NXP Socrates, Thumb, TrustZone, ULINK, ULINK2, ULINK-ME, ULINK-
Semiconductors products in order to avoid a default of the applications PLUS, ULINKpro, μVision, Versatile — are trademarks and/or registered
and the products or of the application or use by customer’s third party trademarks of Arm Limited (or its subsidiaries or affiliates) in the US and/or
customer(s). NXP does not accept any liability in this respect. elsewhere. The related technology may be protected by any or all of patents,
copyrights, designs and trade secrets. All rights reserved.
EdgeLock — is a trademark of NXP B.V.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Contents
1 Overview .............................................................. 2 5.2.2.1 U-Boot SPL ......................................................18
1.1 Audience ............................................................ 2 5.2.2.2 Device Tree Blob ............................................. 18
1.2 Conventions ....................................................... 2 5.2.2.3 OP-TEE ............................................................18
1.3 How to start ....................................................... 2 5.2.2.4 ATF .................................................................. 18
1.4 Using Prebuilt Binaries to create an image ........2 5.2.2.5 U-Boot proper .................................................. 19
1.5 Using Source Files to create image ...................2 5.2.2.6 UEFI .................................................................19
1.6 References .........................................................2 5.2.3 Ensuring firmware security .............................. 19
2 Building Windows 10 IoT for NXP i.MX 5.2.3.1 Security configuration ...................................... 19
Processors ...........................................................3 5.2.3.2 Bootloader verification chain ............................19
2.1 Building the drivers in the BSP ..........................3 5.2.3.3 HAB Chain of trust .......................................... 20
2.1.1 Required tools ................................................... 3 5.2.3.4 i.MX Firmware image verification .....................20
2.1.1.1 Visual Studio 2019 ............................................ 3 5.3 Secure boot on i.MX 8QXP ............................. 21
2.1.1.2 Windows Kits from Windows 10, version 5.3.1 System boot on i.MX 8QXP .............................21
2004 (10.0.19041.685) ...................................... 3 5.3.2 i.MX boot containers ........................................22
2.1.2 Obtaining sources for building the drivers ..........4 5.3.3 System boot components ................................ 22
2.1.2.1 Preparing source for building the drivers ........... 4 5.3.3.1 U-Boot SPL ......................................................23
2.1.3 Structure of Windows driver sources ................. 4 5.3.3.2 Device Tree Blob ............................................. 23
2.1.4 One-time environment setup ............................. 4 5.3.3.3 OP-TEE ............................................................23
2.1.5 Building the drivers ............................................4 5.3.3.4 ATF .................................................................. 24
2.2 Building ARM64 Firmware .................................5 5.3.3.5 U-Boot proper .................................................. 24
2.2.1 Required tools ................................................... 5 5.3.3.6 UEFI .................................................................24
2.2.2 Obtaining sources for building ARM64 5.3.4 Ensuring firmware security .............................. 24
Firmware ............................................................ 5 5.3.4.1 Security configuration ...................................... 24
2.2.2.1 Preparing sources for building firmware ............ 5 5.3.4.2 Bootloader verification chain ............................24
2.2.3 Setting up your build environment ..................... 6 5.3.4.3 AHAB Chain of trust ........................................ 25
2.2.4 Building the firmware ......................................... 8 5.3.4.4 i.MX Firmware image verification .....................25
2.2.5 Common causes of build errors .......................10 5.4 Secure boot on i.MX 93 ...................................26
3 Display/GPU driver ............................................10 5.4.1 System boot on i.MX 93 .................................. 26
3.1 Display interface selection ............................... 10 5.4.2 i.MX Boot Containers .......................................26
3.2 Display resolution and timing parameters ........ 10 5.4.3 System boot components ................................ 27
3.2.1 HDMI display interface .................................... 11 5.4.3.1 U-Boot SPL ......................................................27
3.2.2 LVDS, MIPI-DSI and Parallel display 5.4.3.2 Device Tree Blob ............................................. 27
interfaces ......................................................... 11 5.4.3.3 OP-TEE ............................................................27
3.3 Display specific parameters .............................11 5.4.3.4 ATF .................................................................. 28
3.3.1 LVDS display interface .................................... 11 5.4.3.5 U-Boot proper .................................................. 28
3.3.2 MIPI-DSI display interface ............................... 11 5.4.3.6 UEFI .................................................................28
3.4 Display support in firmware ............................. 11 5.4.4 Ensuring firmware security .............................. 28
3.4.1 Firmware display interface selection ................12 5.4.4.1 Security configuration ...................................... 28
3.4.2 Firmware display resolution ............................. 12 5.4.4.2 Bootloader verification chain ............................28
4 Power management .......................................... 12 5.4.4.3 AHAB Chain of trust ........................................ 29
4.1 Power management user scenarios ................ 12 5.4.4.4 i.MX Firmware image verification .....................29
4.2 Device power management DPM on i.MX 5.5 Secure storage ................................................ 30
8/9 platforms ....................................................13 5.5.1 RPMB ...............................................................30
4.3 Processor power management PPM on 5.5.2 Secure vs. non-secure build ............................ 30
i.MX 8/9 platforms ........................................... 13 5.5.2.1 Secure build .....................................................30
4.4 Power management tools and debugging ....... 14 5.5.2.2 Non-Secure build ............................................. 30
4.4.1 powercfg /a ...................................................... 14 5.6 Secure Boot in UEFI and Windows ................. 31
4.4.2 powercfg /sleepstudy ....................................... 15 6 Secure provisioning ..........................................31
4.4.3 powercfg /energy ............................................. 15 6.1 Secure provisioning i.MX 8M ...........................31
4.4.4 WinDbg !fxdevice ............................................. 15 6.1.1 Generate HAB keys .........................................32
5 Secure boot ....................................................... 17 6.1.1.1 Prepare SRK table .......................................... 32
5.1 Basic concepts ................................................ 17 6.1.2 Building secured binary ................................... 33
5.1.1 .......................................................................... 17 6.1.3 Locking the device for i.MX 8M ....................... 33
5.2 Secure boot on i.MX 8M ..................................17 6.1.4 Burning SRK_HASH ........................................ 33
5.2.1 System boot on i.MX 8M ................................. 17 6.1.5 Burning SEC_CONFIG .................................... 33
5.2.2 System boot components ................................ 17 6.2 Secure provisioning i.MX 8QXP ...................... 34
IMXWGU All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Please be aware that important notices concerning this document and the product(s)
described herein, have been included in section 'Legal information'.