kumquat-buildroot/board/freescale/common/imx/imx9-bootloader-prepare.sh
Sébastien Szymanski c05f27c8ae configs/freescale_imx93evk: new defconfig
This patch adds support for the NXP i.MX 93 11x11 EVK board [1].

[1] https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-93-evaluation-kit:i.MX93EVK

Reviewed-by: Julien Olivain <ju.o@free.fr>
Tested-by: Julien Olivain <ju.o@free.fr>
[Julien: tested on NXP board i.MX93EVK, cpu rev A1, board rev B]
Reviewed-by: Gary Bisson <bisson.gary@gmail.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
[Arnout:
 - Fix shellcheck errors.
 - Add hash files for ATF, linux, U-Boot.
]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2024-02-12 22:44:37 +01:00

44 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
main ()
{
SPL_LOAD_ADDR=0x2049A000
ATF_LOAD_ADDR=0x204E0000
if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91=y$" "${BR2_CONFIG}"; then
SPL_LOAD_ADDR=0x204A0000
ATF_LOAD_ADDR=0x204C0000
fi
dd if="${BINARIES_DIR}/u-boot-spl.bin" of="${BINARIES_DIR}/u-boot-spl-padded.bin" bs=4 conv=sync
cat "${BINARIES_DIR}/u-boot-spl-padded.bin" "${BINARIES_DIR}/ddr_fw.bin" > "${BINARIES_DIR}/u-boot-spl-ddr.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"
if grep -Eq "^BR2_TARGET_OPTEE_OS=y$" "${BR2_CONFIG}"; then
"${HOST_DIR}/bin/mkimage_imx8" -soc IMX9 -c \
-ap "${BINARIES_DIR}/bl31.bin" a35 ${ATF_LOAD_ADDR} \
-ap "${BINARIES_DIR}/u-boot-hash.bin" a35 0x80200000 \
-ap "${BINARIES_DIR}/tee.bin" a35 0x96000000 \
-out "${BINARIES_DIR}/u-boot-atf-container.img" \
else
"${HOST_DIR}/bin/mkimage_imx8" -soc IMX9 -c \
-ap "${BINARIES_DIR}/bl31.bin" a35 ${ATF_LOAD_ADDR} \
-ap "${BINARIES_DIR}/u-boot-hash.bin" a35 0x80200000 \
-out "${BINARIES_DIR}/u-boot-atf-container.img"
fi
"${HOST_DIR}/bin/mkimage_imx8" -soc IMX9 -append "${BINARIES_DIR}/ahab-container.img" -c \
-ap "${BINARIES_DIR}/u-boot-spl-ddr.bin" a35 ${SPL_LOAD_ADDR} \
-out "${BINARIES_DIR}/imx9-boot-sd.bin"
flashbin_size="$(wc -c "${BINARIES_DIR}/imx9-boot-sd.bin" | awk '{print $1}')"
pad_cnt=$(($((flashbin_size + 0x400 - 1)) / 0x400))
dd if="${BINARIES_DIR}/u-boot-atf-container.img" of="${BINARIES_DIR}/imx9-boot-sd.bin" bs=1K seek=${pad_cnt}
exit $?
}
main "$@"