board/freescale/common/imx: make imx8-bootloader-prepare more generic
authorGary Bisson <gary.bisson@boundarydevices.com>
Thu, 19 Jul 2018 10:31:04 +0000 (12:31 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 19 Jul 2018 13:41:24 +0000 (15:41 +0200)
Allow user to override the hardcoded dtb name by using
BR2_ROOTFS_POST_SCRIPT_ARGS.

The only user of this script, configs/freescale_imx8mqevk, is updated
accordingly.

Cc: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
board/freescale/common/imx/imx8-bootloader-prepare.sh
configs/freescale_imx8mqevk_defconfig

index 2648147ab0a76f6e1ca0c9057a1aa13994b7a256..cc12666ae6c0088e6b7d7cc05ded97142e1ad4d4 100755 (executable)
@@ -2,9 +2,13 @@
 
 main ()
 {
-       # Currently we support imx8mqevk.
+       UBOOT_DTB=$2
+       if [ ! -e "$UBOOT_DTB" ]; then
+               echo "ERROR: couldn't find dtb: $UBOOT_DTB"
+               exit 1
+       fi
        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
+       BL31=${BINARIES_DIR}/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin ${HOST_DIR}/bin/mkimage_fit_atf.sh ${UBOOT_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
 
index f48e4f78e4d19aa8af02688a0fbd53eab4845693..a6e9b940b5fa5bd98270c1ca552f03d43bb85575 100644 (file)
@@ -3,6 +3,7 @@ BR2_ARM_FPU_VFPV3=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/imx8-bootloader-prepare.sh board/freescale/common/imx/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="${UBOOT_DIR}/arch/arm/dts/fsl-imx8mq-evk.dtb"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/linux-imx"