summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2019-03-08 16:06:55 +0100
committerMarek Vasut <marex@denx.de>2019-04-09 18:19:10 +0200
commit95f4bbd581cfde45d4bd1fa5e56c2d880dae7ced (patch)
treefdf036ff9026bfcae64afd553105b60dcac6f382 /Makefile
parent1fd303543aef9c4641bd578e6e52284f5a69df67 (diff)
lib: fdt: Allow LZO and GZIP DT compression in U-Boot
Add required Kconfig symbols, Makefile bits and macro fixes in a few places to support LZO and DT compression in U-Boot. This can save a lot of space with multi-DTB fitImages. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index aedc2ea4d9..4e4a33d99b 100644
--- a/Makefile
+++ b/Makefile
@@ -1020,6 +1020,20 @@ quiet_cmd_copy = COPY $@
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y)
+FINAL_DTB_CONTAINER = fit-dtb.blob.lzo
+else ifeq ($(CONFIG_MULTI_DTB_FIT_GZIP),y)
+FINAL_DTB_CONTAINER = fit-dtb.blob.gz
+else
+FINAL_DTB_CONTAINER = fit-dtb.blob
+endif
+
+fit-dtb.blob.gz: fit-dtb.blob
+ @gzip -kf9 $< > $@
+
+fit-dtb.blob.lzo: fit-dtb.blob
+ @lzop -f9 $< > $@
+
fit-dtb.blob: dts/dt.dtb FORCE
$(call if_changed,mkimage)
@@ -1027,7 +1041,7 @@ MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-a 0 -e 0 -E \
$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
-u-boot-fit-dtb.bin: u-boot-nodtb.bin fit-dtb.blob
+u-boot-fit-dtb.bin: u-boot-nodtb.bin $(FINAL_DTB_CONTAINER)
$(call if_changed,cat)
u-boot.bin: u-boot-fit-dtb.bin FORCE