imx: image: use 'u-boot-dtb.img' filename for SPL payload
authorPiotr Dymacz <pepe2k@gmail.com>
Fri, 1 Apr 2022 13:11:36 +0000 (15:11 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Thu, 7 Apr 2022 07:58:44 +0000 (09:58 +0200)
For targets in U-Boot which were migrated to DM, the correct binary
image filename will be 'u-boot-dtb.img'. For backward compatibility,
keep support for both files and use the one which was generated with
our 'uboot-imx' package.

See also 'CONFIG_SPL_FS_LOAD_PAYLOAD_NAME' and 'CONFIG_OF_CONTROL' in
mainline U-Boot sources.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
target/linux/imx/image/cortexa9.mk

index 75e19dc69412b5e063d25a974d2421f7da3e4d40..17a507b8da347a6ad268611c56d9deb80d5b2618 100644 (file)
@@ -80,7 +80,16 @@ endef
 define Build/imx6-sdcard
        $(Build/imx6-combined-image-prepare)
 
-       $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img $@.boot/u-boot.img
+       if [ -f $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img ]; then \
+               $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img \
+               $@.boot/u-boot.img; \
+       fi
+
+       if [ -f $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img ]; then \
+               $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img \
+               $@.boot/u-boot-dtb.img; \
+       fi
+
        $(Build/imx6-combined-image)
        dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc