From fa4ba9c398418c49987570859ec9c7a9d94f5e16 Mon Sep 17 00:00:00 2001 From: Joao Marcos Costa Date: Thu, 7 Dec 2023 15:24:51 +0100 Subject: [PATCH 1/3] firmware-sentinel: bump to v0.11 v0.11 supports A1 revision for iMX93 SoC. The previous version, however, only supports A0. Without the proper firmware version, it is impossible to boot the SoC. Upgrade firmware-sentinel from v0.10 to v0.11, which supports both A0 and A1 hardware revisions. Signed-off-by: Joao Marcos Costa --- .../firmware-sentinel_0.10.bb | 27 ----------------- .../firmware-sentinel_0.11.bb | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) delete mode 100644 recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb create mode 100644 recipes-bsp/firmware-sentinel/firmware-sentinel_0.11.bb diff --git a/recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb b/recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb deleted file mode 100644 index 1b2b20218..000000000 --- a/recipes-bsp/firmware-sentinel/firmware-sentinel_0.10.bb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2021-2023 NXP -SUMMARY = "NXP i.MX Sentinel firmware" -DESCRIPTION = "Firmware for i.MX Sentinel Security Controller" -SECTION = "base" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=63a38e9f392d8813d6f1f4d0d6fbe657" - -inherit fsl-eula-unpack use-imx-security-controller-firmware deploy - -SRC_URI = "${FSL_MIRROR}/${BP}.bin;fsl-eula=true" -SRC_URI[md5sum] = "a92e272d665a3b3bb9281253d5eca69f" -SRC_URI[sha256sum] = "be862b62c849510cce08ec24c1ddf53d826458e326e5a7f09c4b35092d6f9950" - -do_compile[noexec] = "1" - -do_install() { - install -Dm 0644 ${S}/${SECO_FIRMWARE_NAME} ${D}${nonarch_base_libdir}/firmware/imx/ele/${SECO_FIRMWARE_NAME} -} - -do_deploy() { - install -m 0644 ${S}/${SECO_FIRMWARE_NAME} ${DEPLOYDIR} -} -addtask deploy after do_compile before do_build - -FILES:${PN} += "${nonarch_base_libdir}/firmware/imx/ele/${SECO_FIRMWARE_NAME}" - -COMPATIBLE_MACHINE = "(mx8ulp-nxp-bsp|mx9-nxp-bsp)" diff --git a/recipes-bsp/firmware-sentinel/firmware-sentinel_0.11.bb b/recipes-bsp/firmware-sentinel/firmware-sentinel_0.11.bb new file mode 100644 index 000000000..e965e06e2 --- /dev/null +++ b/recipes-bsp/firmware-sentinel/firmware-sentinel_0.11.bb @@ -0,0 +1,29 @@ +# Copyright 2021-2023 NXP +SUMMARY = "NXP i.MX Sentinel firmware" +DESCRIPTION = "Firmware for i.MX Sentinel Security Controller" +SECTION = "base" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=db4762b09b6bda63da103963e6e081de" + +inherit fsl-eula-unpack use-imx-security-controller-firmware deploy + +SRC_URI = "${FSL_MIRROR}/${BP}.bin;fsl-eula=true" +SRC_URI[md5sum] = "339011b6b199151d835c03089a3c2221" +SRC_URI[sha256sum] = "269480417a8ae9aa4cc4101ab947287fc33455a931021dbdc4d9badb5212bceb" + +do_compile[noexec] = "1" + +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/imx/ele + install -m 0644 ${S}/${SECO_FIRMWARE_NAME} ${D}${nonarch_base_libdir}/firmware/imx/ele +} + +do_deploy () { + # Deploy the related firmware to be package by imx-boot + install -m 0644 ${S}/${SECO_FIRMWARE_NAME} ${DEPLOYDIR} +} +addtask deploy after do_install before do_build + +FILES:${PN} += "${nonarch_base_libdir}/firmware/imx/ele/${SECO_FIRMWARE_NAME}" + +COMPATIBLE_MACHINE = "(mx8ulp-nxp-bsp|mx9-nxp-bsp)" From 7e6ba8ce6ec2ae558e455c3bb68e7b400e24fd8e Mon Sep 17 00:00:00 2001 From: Joao Marcos Costa Date: Thu, 7 Dec 2023 16:04:13 +0100 Subject: [PATCH 2/3] imx-boot: fix firmware name handling In imx-boot's iMX9/soc.mak, the firmware name is set to a constant value, i.e. mx93a0-ahab-container.img. Instead, it should be set to SECO_FIRMWARE_NAME. This variable is defined in use-imx-security-controller-firmware.bbclass, then it is passed as a make parameter in imx-boot's do_compile() task. As of now, there are revisions beyond A0 (namely A1), so the firmware must be compiled accordingly. This patch implements such feature. Signed-off-by: Joao Marcos Costa --- recipes-bsp/imx-mkimage/imx-boot_1.0.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/imx-mkimage/imx-boot_1.0.bb b/recipes-bsp/imx-mkimage/imx-boot_1.0.bb index d5aef3c64..222039496 100644 --- a/recipes-bsp/imx-mkimage/imx-boot_1.0.bb +++ b/recipes-bsp/imx-mkimage/imx-boot_1.0.bb @@ -190,10 +190,10 @@ do_compile() { if [ "$target" = "flash_linux_m4_no_v2x" ]; then # Special target build for i.MX 8DXL with V2X off bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} V2X=NO ${target}" - make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} V2X=NO dtbs=${UBOOT_DTB_NAME_EXTRA} flash_linux_m4 + make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} V2X=NO dtbs=${UBOOT_DTB_NAME_EXTRA} flash_linux_m4 SECO_FIRMWARE_NAME=${SECO_FIRMWARE_NAME} else bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} ${target}" - make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} dtbs=${UBOOT_DTB_NAME_EXTRA} ${target} + make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} dtbs=${UBOOT_DTB_NAME_EXTRA} ${target} SECO_FIRMWARE_NAME=${SECO_FIRMWARE_NAME} fi if [ -e "${BOOT_STAGING}/flash.bin" ]; then cp ${BOOT_STAGING}/flash.bin ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target} From 25c496f5e42d4681f882dda92fbd45db29d97365 Mon Sep 17 00:00:00 2001 From: Joao Marcos Costa Date: Thu, 7 Dec 2023 16:15:37 +0100 Subject: [PATCH 3/3] imx-boot: patch makefile in imx-mkimage/iMX9 This is a follow-up to the previous commit, which handles firmware naming in Yocto side. Add patch to handle it in imx-boot/imx-mkimage side. Signed-off-by: Joao Marcos Costa --- ...MX9-soc.mak-dynamically-set-AHAB_IMG.patch | 38 +++++++++++++++++++ recipes-bsp/imx-mkimage/imx-mkimage_git.inc | 1 + 2 files changed, 39 insertions(+) create mode 100644 recipes-bsp/imx-mkimage/files/0001-iMX9-soc.mak-dynamically-set-AHAB_IMG.patch diff --git a/recipes-bsp/imx-mkimage/files/0001-iMX9-soc.mak-dynamically-set-AHAB_IMG.patch b/recipes-bsp/imx-mkimage/files/0001-iMX9-soc.mak-dynamically-set-AHAB_IMG.patch new file mode 100644 index 000000000..5b9bff372 --- /dev/null +++ b/recipes-bsp/imx-mkimage/files/0001-iMX9-soc.mak-dynamically-set-AHAB_IMG.patch @@ -0,0 +1,38 @@ +From e3803a81326cece3b4cdd086ab009e9858fec21e Mon Sep 17 00:00:00 2001 +From: Joao Marcos Costa +Date: Thu, 7 Dec 2023 15:45:12 +0100 +Subject: [PATCH] iMX9/soc.mak: dynamically set AHAB_IMG + +Instead of assigning a constant value to AHAB_IMG (i.e., +mx93a0-ahab-container.img), set it to SECO_FIRMWARE_NAME. + +This variable is defined in +use-imx-security-controller-firmware.bbclass, then it is passed as a +make parameter in imx-boot's do_compile() task. + +As of now, there are revisions beyond A0 (namely A1), so the firmware +must be compiled accordingly. The firmware name is already handled in +Yocto side, but not in imx-boot/imx-mkimage side. This patch implements +such feature. + +Signed-off-by: Joao Marcos Costa +--- + iMX9/soc.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/iMX9/soc.mak b/iMX9/soc.mak +index 7c4086c..fa13391 100644 +--- a/iMX9/soc.mak ++++ b/iMX9/soc.mak +@@ -16,7 +16,7 @@ else + RENAME = rename + endif + +-AHAB_IMG = mx93a0-ahab-container.img ++AHAB_IMG = ${SECO_FIRMWARE_NAME} + MCU_IMG = m33_image.bin + + SPL_LOAD_ADDR ?= 0x2049A000 +-- +2.43.0 + diff --git a/recipes-bsp/imx-mkimage/imx-mkimage_git.inc b/recipes-bsp/imx-mkimage/imx-mkimage_git.inc index 56f3fba54..48adaa9f0 100644 --- a/recipes-bsp/imx-mkimage/imx-mkimage_git.inc +++ b/recipes-bsp/imx-mkimage/imx-mkimage_git.inc @@ -4,6 +4,7 @@ DEPENDS = "zlib-native openssl-native" SRC_URI = "git://github.com/nxp-imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH} \ file://0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch \ + file://0001-iMX9-soc.mak-dynamically-set-AHAB_IMG.patch \ " SRCBRANCH = "lf-6.1.22_2.0.0" SRCREV = "5cfd218012e080fb907d9cc301fbb4ece9bc17a9"