summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWeijie Gao <weijie.gao@mediatek.com>2020-04-21 09:28:39 +0200
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2020-04-27 20:29:33 +0200
commita38f84b439ebf35313bed41665cd1ca5fedb24da (patch)
treeb2104e7f8fc1eab78fa698b528e704c74b4c0976 /Makefile
parent04cb39946c96e119a6a0978436662358aa33dbc9 (diff)
Makefile: add support to generate LZMA compressed u-boot image
This patch adds support for generating LZMA compressed u-boot image. The compressed image can be used for SPL to reduce the size of the u-boot binary. Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b8a4b5058a..ea62374e74 100644
--- a/Makefile
+++ b/Makefile
@@ -1002,6 +1002,9 @@ append = cat $(filter-out $< $(PHONY), $^) >> $@
quiet_cmd_pad_cat = CAT $@
cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
+quiet_cmd_lzma = LZMA $@
+cmd_lzma = lzma -c -z -k -9 $< > $@
+
cfg: u-boot.cfg
quiet_cmd_cfgcheck = CFGCHK $2
@@ -1384,6 +1387,16 @@ else
UBOOT_BIN := u-boot.bin
endif
+MKIMAGEFLAGS_u-boot-lzma.img = -A $(ARCH) -T standalone -C lzma -O u-boot \
+ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
+ -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
+
+u-boot.bin.lzma: u-boot.bin FORCE
+ $(call if_changed,lzma)
+
+u-boot-lzma.img: u-boot.bin.lzma FORCE
+ $(call if_changed,mkimage)
+
u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE),dts/dt.dtb) \