I am trying to enable secure boot functionality on an imx8mn-ddr4 device following along with the documentation provided in the repo. However I seem to run into compiling issues when setting the CONFIG_IMX_HAB. Unsetting this flag will build u-boot without issue. I'm not sure what steps I am missing, I've provided my terminal output bellow:
$ git clone https://source.codeaurora.org/external/imx/uboot-imx -b imx_v2020.04_5.4.70_2.3.0
$ cd uboot-imx/
$ cp ${ROOTDIR}/${FW_VERSION}/firmware/hdmi/cadence/signed_hdmi_imx8m.bin .
$ cp ${ROOTDIR}/${FW_VERSION}/firmware/ddr/synopsys/ddr4*.bin .
$ cp ${ROOTDIR}/imx-atf/build/imx8mn/release/bl31.bin .
$ export ARCH=arm64
$ export CROSS_COMPILE=${ROOTDIR}/gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu/bin/aarch64-linux-gnu-
$ make imx8mn_ddr4_evk_defconfig
$ export ATF_LOAD_ADDR=0x960000
$ export CONFIG_IMX_HAB=y
$ make flash.bin
CHK include/config/uboot.release
CHK include/generated/version_autogenerated.h
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CHK include/generated/generic-asm-offsets.h
CHK include/generated/asm-offsets.h
HOSTCC tools/mkenvimage.o
HOSTLD tools/mkenvimage
HOSTCC tools/fit_image.o
HOSTCC tools/image-host.o
HOSTCC tools/dumpimage.o
HOSTLD tools/dumpimage
HOSTCC tools/mkimage.o
HOSTLD tools/mkimage
CC arch/arm/cpu/armv8/fwcall.o
LD arch/arm/cpu/armv8/built-in.o
CC arch/arm/mach-imx/hab.o
arch/arm/mach-imx/hab.c: In function ‘imx_hab_is_enabled’:
arch/arm/mach-imx/hab.c:863:36: error: ‘imx_sec_config_fuse’ undeclared (firs t use in this function); did you mean ‘imx_sec_config_fuse_t’?
(struct imx_sec_config_fuse_t *)&imx_sec_config_fuse;
^~~~~~~~~~~~~~~~~~~
imx_sec_config_fuse_t
arch/arm/mach-imx/hab.c:863:36: note: each undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:278: recipe for target 'arch/arm/mach-imx/hab.o' faile d
make[1]: *** [arch/arm/mach-imx/hab.o] Error 1
Makefile:1728: recipe for target 'arch/arm/mach-imx' failed
Thanks!
Solved! Go to Solution.
Eric,
Update the defconfig file with the desired configuration, instead of exporting it on the console.
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -139,3 +139,4 @@ CONFIG_DM_VIDEO=y
CONFIG_VIDEO_LCD_RAYDIUM_RM67191=y
CONFIG_VIDEO_ADV7535=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_IMX_HAB=y
Hi @Eric5
If you simply compile uboot, then there should be no problem using make flash.bin with upstream uboot. You'd better use imx-mkimage, for uboot of nxp release, the support of make flash.bin is not as perfect as imx-mkimage.
Best regards
Harvey
Eric,
Update the defconfig file with the desired configuration, instead of exporting it on the console.
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -139,3 +139,4 @@ CONFIG_DM_VIDEO=y
CONFIG_VIDEO_LCD_RAYDIUM_RM67191=y
CONFIG_VIDEO_ADV7535=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_IMX_HAB=y