aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Ceresoli <luca.ceresoli@bootlin.com>2023-03-10 11:07:52 +0100
committerStefano Babic <sbabic@denx.de>2023-04-04 09:35:39 +0200
commit95942f99a7057359c07bf383214d57154e2466fe (patch)
treeb07394e657c944af10db5adb2898a13367968221
parentd08c00082183dc6a2301690678794d2b80e75258 (diff)
downloadu-boot-95942f99a7057359c07bf383214d57154e2466fe.zip
u-boot-95942f99a7057359c07bf383214d57154e2466fe.tar.gz
u-boot-95942f99a7057359c07bf383214d57154e2466fe.tar.bz2
arm: imx: add u-boot-nand.imx to boot from NAND without SPL
U-Boot can be booted from NAND without SPL by prepending the DCD header to the actual U-Boot binary. However this requires prepending 1024 bytes to u-boot.imx (DCD + u-boot.bin). There is already a similar target to build spl/u-boot-nand-spl.imx, add the same option for no-SPL boot. Tested on i.MX6ULL. The resulting layout of u-boot-nand.imx is: - Offset 0x0000 (0 KiB): padding - Offset 0x0400 (1 KiB): DCD header - Offset 0x1000 (4 KiB): u-boot.bin Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
-rw-r--r--Makefile3
-rw-r--r--arch/arm/mach-imx/Makefile6
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0f37c4b..15f48cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1522,6 +1522,9 @@ endif
u-boot.uim: u-boot.bin FORCE
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+u-boot-nand.imx: u-boot.imx FORCE
+ $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+
u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 9bcb23c..906f538 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -136,6 +136,12 @@ u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
$(call if_changed,mkimage)
+quiet_cmd_u-boot-nand_imx = GEN $@
+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)
+
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)