Hello All,
Recently we implemented Secure boot for our custom carrier board with Verdin iMX8MP, and below our current software configuration:
Torizon OS : Reference Minimal Image
Toradex BSP : Toradex BSP version 7.4.0
Linux Kernel : Linux Kernel version 6.6.94 LTS
Machine : verdin-imx8mp
Yocto Release : Yocto 5.0 (Scarthgap)
Distro (Distribution) : tdx-xwayland
Architecture : ARM64
When we enabled the secure boot in local.conf file as below configuration:
# 1. Enable Full Chain of Trust (HAB + signed FIT + dm-verity rootfs)
INHERIT += "tdxref-signed"
TDX_IMX_HAB_ENABLE = "1"
# Note: Replace below it with your custom image name.
DM_VERITY_IMAGE = "tdx-reference-minimal-image"
DM_VERITY_IMAGE_TYPE = "ext4"
# 2. NXP Code Signing Tool location
TDX_IMX_HAB_CST_DIR = "/home/vishal/IMX_CST_TOOL_NEW/cst-4.0.1"
TDX_IMX_HAB_CST_BIN = "${TDX_IMX_HAB_CST_DIR}/linux64/bin/cst"
# 3. PKI tree parameters - these MUST match the answers given to hab4_pki_tree.sh.
# The certificate/table file names are derived from these; do not hardcode paths.
# SRK_CA=1 because SRK_1_2_3_4_table.bin was built from the *_ca_crt.pem certs.
TDX_IMX_HAB_CST_CRYPTO = "rsa"
TDX_IMX_HAB_CST_KEY_SIZE = "2048"
TDX_IMX_HAB_CST_KEY_EXP = "65537"
TDX_IMX_HAB_CST_DIG_ALGO = "sha256"
TDX_IMX_HAB_CST_SRK_CA = "1"
TDX_IMX_HAB_CST_SRK_INDEX = "1"
# 4. Sign the kernel/DTB FIT image (required for a real chain of trust)
# TEMPORARY: "0" while validating HAB/hab_status. Setting this to "0" also
# auto-disables TDX_UBOOT_HARDENING_ENABLE, keeping the USB/TEZI update flow
# working. MUST be set back to "1" before production - see notes below.
UBOOT_SIGN_ENABLE = "1"
# Prevent Yocto from auto-generating random keys in ${TOPDIR}/keys/fit
FIT_GENERATE_KEYS = "0"
# Point directly to your static CST fit_keys directory and key basename
UBOOT_SIGN_KEYDIR = "${TDX_IMX_HAB_CST_DIR}/keys/fit_keys"
UBOOT_SIGN_KEYNAME = "prod_fit_key"
# 5. Boot container is produced by U-Boot, not imx-boot (mandatory on BSP 7.x)
UBOOT_PROVIDES_BOOT_CONTAINER = "1"
Initially I got the errors and we resolved all of them and build and flashed with above configuration in to our device. When device powerup the startup boot log attached here for review and reference.
Start_Up_Secure_boot_ECoT.txt (41.7 KB)
Currently the main problem we are facing is the USB boot feature for SoM FW upgrade using TEZI not working. When I ran USB boot and start FW Upgrade command in u-boot then we are getting the ERROR “Failed to verify required signature ‘key-prod_fit_key’
Bad Data Hash”:
## U-Boot CLI access is enabled
Hit any key to stop autoboot: 0
Verdin iMX8MP # setenv bootargs "quiet rootfstype=squashfs root=/dev/ram autoinstall console=ttymxc2,115200" && usb start && load usb 0:1 0x44200000 tezi.itb && bootm 0x44200000#conf-freescale_imx8mp-verdin-nonwifi-dev.dtb
## WARNING: Command execution WOULD BE DENIED in closed state (blocked by category) for `usb start`.
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
42800795 bytes read in 1014 ms (40.3 MiB/s)
## Loading kernel from FIT Image at 44200000 ...
Using 'conf-freescale_imx8mp-verdin-nonwifi-dev.dtb' configuration
Verifying Hash Integrity ... error!
No 'signature' subnode found for '<NULL>' hash node in 'conf-freescale_imx8mp-verdin-nonwifi-dev.dtb' config node
Failed to verify required signature 'key-prod_fit_key'
Bad Data Hash
ERROR -2: can't get kernel image!
Verdin iMX8MP #
Could you please help me how to resolve this SoM FW upgrade using USB boot via TEZI?
Thanks in advanced..!!