board/freescale: add i.MX95 support

Add support for i.MX95-based boards. The boot container build process
differs a bit from i.MX93, thus the addition of a new script. Most
notably, there's at least 2 new images to be included (i.e. SM and
DDR/TCM OEI).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
[Julien:
 - add "set -eu" in script
 - rename "imx9-boot-sd.bin" to "flash.bin" after commit aa1ed6e741
 - remove "TODO:"
]
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Laurentiu Mihalcea
2026-02-03 07:36:16 -08:00
committed by Julien Olivain
parent c354786c55
commit 29252fe83e

View File

@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# VERY IMPORTANT: a lot of this code here is hardcoded such that
# it's able to generate a flash.bin equivalent to the one generated
# by imx-mkimage by running:
#
# make SOC=iMX95 OEI=YES LPDDR_TYPE=lpddr4x flash_a55
#
# As such, please be mindful of the fact that this script may not work
# if you wish to change the make target or one of its parameters.
set -eu
main ()
{
CNTR_VERSION=2
ATF_LOAD_ADDR=0x8A200000
UBOOT_LOAD_ADDR=0x90200000
OEI_M33_ENTR_ADDR=0x1ffc0001
OEI_M33_LOAD_ADDR=0x1ffc0000
MCU_TCM_ADDR=0x1FFC0000
SPL_LOAD_ADDR_M33_VIEW=0x20480000
V2X_DDR=0x8b000000
# generate u-boot-hash.bin
"${HOST_DIR}/bin/mkimage_imx8" -commit > "${BINARIES_DIR}/mkimg.commit"
cat "${BINARIES_DIR}/u-boot.bin" "${BINARIES_DIR}/mkimg.commit" > "${BINARIES_DIR}/u-boot-hash.bin"
rm -f "${BINARIES_DIR}/mkimg.commit"
# generate u-boot-atf-container.img (no TEE support for now)
"${HOST_DIR}/bin/mkimage_imx8" -soc IMX9 -cntr_version ${CNTR_VERSION} -c \
-ap "${BINARIES_DIR}/bl31.bin" a55 ${ATF_LOAD_ADDR} \
-ap "${BINARIES_DIR}/u-boot-hash.bin" a55 ${UBOOT_LOAD_ADDR} \
-out "${BINARIES_DIR}/u-boot-atf-container.img"
# generate m33-oei-ddrfw.bin
dd if="${BINARIES_DIR}/oei-m33-ddr.bin" of="${BINARIES_DIR}/oei-m33-ddr.bin-pad" bs=4 conv=sync
cat "${BINARIES_DIR}/oei-m33-ddr.bin-pad" "${BINARIES_DIR}/ddr_fw.bin" > "${BINARIES_DIR}/m33-oei-ddrfw.bin.unaligned"
dd if="${BINARIES_DIR}/m33-oei-ddrfw.bin.unaligned" of="${BINARIES_DIR}/m33-oei-ddrfw.bin" bs=8 conv=sync
rm -f "${BINARIES_DIR}/m33-oei-ddrfw.bin.unaligned" "${BINARIES_DIR}/oei-m33-ddr.bin-pad"
# generate flash.bin
"${HOST_DIR}/bin/mkimage_imx8" -soc IMX9 -cntr_version ${CNTR_VERSION} \
-append "${BINARIES_DIR}/ahab-container.img" -c -ddr_dummy \
-oei "${BINARIES_DIR}/m33-oei-ddrfw.bin" m33 ${OEI_M33_ENTR_ADDR} ${OEI_M33_LOAD_ADDR} -hold 65536 \
-msel 0 \
-m33 "${BINARIES_DIR}/m33_image.bin" 0 ${MCU_TCM_ADDR} \
-ap "${BINARIES_DIR}/u-boot-spl.bin" a55 ${SPL_LOAD_ADDR_M33_VIEW} \
-dummy ${V2X_DDR} \
-out "${BINARIES_DIR}/flash.bin"
# append u-boot-atf-container.img to flash.bin
flashbin_size="$(wc -c "${BINARIES_DIR}/flash.bin" | awk '{print $1}')"
pad_cnt=$(($((flashbin_size + 0x400 - 1)) / 0x400))
dd if="${BINARIES_DIR}/u-boot-atf-container.img" of="${BINARIES_DIR}/flash.bin" bs=1K seek=${pad_cnt}
exit $?
}
main "$@"