board/freescale/common/imx: add imx8-bootloader-prepare script
authorErik Larsson <karl.erik.larsson@gmail.com>
Thu, 12 Apr 2018 20:36:48 +0000 (22:36 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 12 Apr 2018 20:38:50 +0000 (22:38 +0200)
This commit adds an imx8-bootloader-prepare.sh script that will be
used by i.MX8 platforms to prepare their bootloader image.

Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
board/freescale/common/imx/imx8-bootloader-prepare.sh [new file with mode: 0755]

diff --git a/board/freescale/common/imx/imx8-bootloader-prepare.sh b/board/freescale/common/imx/imx8-bootloader-prepare.sh
new file mode 100755 (executable)
index 0000000..2648147
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+main ()
+{
+       # Currently we support imx8mqevk.
+       cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/lpddr4_pmu_train_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin
+       BL31=${BINARIES_DIR}/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin ${HOST_DIR}/bin/mkimage_fit_atf.sh ${BINARIES_DIR}/fsl-imx8mq-evk.dtb > ${BINARIES_DIR}/u-boot.its
+       ${HOST_DIR}/bin/mkimage -E -p 0x3000 -f ${BINARIES_DIR}/u-boot.its ${BINARIES_DIR}/u-boot.itb
+       rm -f ${BINARIES_DIR}/u-boot.its
+
+       ${HOST_DIR}/bin/mkimage_imx8 -fit -signed_hdmi ${BINARIES_DIR}/signed_hdmi_imx8m.bin -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin 0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx8-boot-sd.bin
+
+       exit $?
+}
+
+main $@