imx-boot: add makefile target to build imx93 A0 SOC revision

Also, set the build of A1 SOC revision by default for ccimx93.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2023-11-02 18:59:06 +01:00
parent a96d4fdc1d
commit 77755ac73c
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,28 @@
From: Javier Viguera <javier.viguera@digi.com>
Date: Thu, 2 Nov 2023 15:03:13 +0100
Subject: [PATCH] imx9: soc.mak: add makefile target to build A0 revision
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
iMX9/soc.mak | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/iMX9/soc.mak b/iMX9/soc.mak
index 97e311059df8..59352f22deb1 100644
--- a/iMX9/soc.mak
+++ b/iMX9/soc.mak
@@ -133,6 +133,14 @@ flash_singleboot: $(MKIMG) $(AHAB_IMG) u-boot-spl-ddr.bin u-boot-atf-container.i
echo "append u-boot-atf-container.img at $$pad_cnt KB" | tee -a $(MKIMAGE_LOG); \
dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt;
+flash_singleboot_a0: $(MKIMG) mx93a0-ahab-container.img u-boot-spl-ddr.bin u-boot-atf-container.img
+ ./$(MKIMG) -soc IMX9 -append mx93a0-ahab-container.img -c -ap u-boot-spl-ddr.bin a35 $(SPL_LOAD_ADDR) -out flash.bin | tee -a $(MKIMAGE_LOG)
+ 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" | tee -a $(MKIMAGE_LOG); \
+ dd if=u-boot-atf-container.img of=flash.bin bs=1K seek=$$pad_cnt;
+
flash_singleboot_spinand: $(MKIMG) $(AHAB_IMG) u-boot-spl-ddr.bin u-boot-atf-container-spinand.img flash_fw.bin
./$(MKIMG) -soc IMX9 -dev nand 4K -append $(AHAB_IMG) -c -ap u-boot-spl-ddr.bin a35 $(SPL_LOAD_ADDR) -out flash.bin
cp flash.bin boot-spl-container.img

View File

@ -9,6 +9,7 @@ SRC_URI:append:ccimx8m = " \
SRC_URI:append:ccimx93 = " \
file://0001-imx9-soc.mak-capture-commands-output-into-a-log-file.patch \
file://0002-imx9-soc.mak-add-makefile-target-to-build-A0-revisio.patch \
"
# Use NXP's lf-6.1.36-2.1.0 release for ccimx93
@ -22,6 +23,8 @@ DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-too
UUU_BOOTLOADER = ""
UUU_BOOTLOADER_TAGGED = ""
REV_OPTION:ccimx93 = "REV=A1"
compile_mx8m:append:ccimx8m() {
# Create dummy DEK blob to support building with encrypted u-boot
if [ -n "${TRUSTFENCE_DEK_PATH}" ] && [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then
@ -29,6 +32,16 @@ compile_mx8m:append:ccimx8m() {
fi
}
# For SOC revision A0 we need a different ATF binary
compile_mx93:append:ccimx93() {
if [ "$target" = "flash_singleboot_a0" ]; then
ATF_MACHINE_NAME_A0="$(echo ${ATF_MACHINE_NAME} | sed -e 's,.bin,-A0.bin,g')"
bbnote "Copy ATF binary for SOC revision A0: ${ATF_MACHINE_NAME_A0}"
\cp --remove-destination ${DEPLOY_DIR_IMAGE}/${ATF_MACHINE_NAME_A0} ${BOOT_STAGING}/bl31.bin
unset ATF_MACHINE_NAME_A0
fi
}
do_compile:append:ccimx8m() {
bbnote "building ${IMX_BOOT_SOC_TARGET} - print_fit_hab"
make SOC=${IMX_BOOT_SOC_TARGET} dtbs=${UBOOT_DTB_NAME} print_fit_hab
@ -87,6 +100,10 @@ do_deploy:append:ccimx93() {
generate_symlinks
for target in ${IMXBOOT_TARGETS}; do
install -m 0644 ${BOOT_STAGING}/mkimage-${target}.log ${DEPLOYDIR}/${BOOT_TOOLS}
# Generate symlink for SOC revision A0
if [ "$target" = "flash_singleboot_a0" ]; then
ln -sf ${BOOT_NAME}-${MACHINE}.bin-${target} ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-A0.bin
fi
done
}