summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-05-13 23:09:35 +0300
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-05-18 12:15:19 +0300
commit642226d5a38a8bde221b7e8b0dc6ae798e5437e6 (patch)
tree5f642ce0636400eeb8a1090c19de4b232dd9a828
parentdedbd79c9e960f57fde9f12b2cf090dc546c36a7 (diff)
Makefile: add u-boot-nand.imx target
NAND modules (Colibri Vybrid, iMX7, iMX6ULL) require the images with 1024 prepending bytes. Add the u-boot-nand.imx target which enables with CONFIG_IMX_NAND option. Related-to: TEI-775 Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
-rw-r--r--Makefile4
-rw-r--r--arch/arm/config.mk4
-rw-r--r--arch/arm/mach-imx/Makefile8
3 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7c3c78dfc5..cc5cbe69b3 100644
--- a/Makefile
+++ b/Makefile
@@ -1199,6 +1199,10 @@ ifeq ($(CONFIG_MULTI_DTB_FIT),y)
IMX_DEPS = u-boot-fit-dtb.bin
endif
+u-boot-nand.imx: $(IMX_DEPS) u-boot.bin
+ $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+ $(BOARD_SIZE_CHECK)
+
%.imx: $(IMX_DEPS) %.bin
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
$(BOARD_SIZE_CHECK)
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index f25603109e..2003161801 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -157,12 +157,16 @@ ifndef CONFIG_SPL_BUILD
ALL-y += SPL
endif
else
+ifeq ($(CONFIG_IMX_NAND),y)
+ALL-y += u-boot-nand.imx
+else
ifeq ($(CONFIG_OF_SEPARATE),y)
ALL-y += u-boot-dtb.imx
else
ALL-y += u-boot.imx
endif
endif
+endif
ifneq ($(CONFIG_VF610),)
ALL-y += u-boot.vyb
endif
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index a70d51b5cf..30a1ad2196 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -121,6 +121,14 @@ u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
+ifeq ($(CONFIG_IMX_NAND),y)
+cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
+ cat - $< > $@
+
+u-boot-nand.imx: u-boot.imx FORCE
+ $(call if_changed,u-boot-nand_imx)
+endif
+
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE)