aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/boot/compressed/Makefile
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@pm.me>2020-11-01 15:13:01 +0000
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-11-12 23:47:22 +0100
commita3fb655027c33a9281d3b813798b15bdf1e75d43 (patch)
tree88e8a6dab1a076d93e494d85ef5cacdbf27a3947 /arch/mips/boot/compressed/Makefile
parentmips: boot: clean up self-extracting targets scenarios (diff)
downloadlinux-dev-a3fb655027c33a9281d3b813798b15bdf1e75d43.tar.xz
linux-dev-a3fb655027c33a9281d3b813798b15bdf1e75d43.zip
mips: boot: add support for self-extracting FIT images (vmlinuz.itb)
Commit c3e2ee657418 ("MIPS: generic: Add support for zboot") added support for self-extracting images to Generic MIPS. However, the intended way to boot Generic MIPS kernels is using FIT Images and UHI boot protocol, but currently there's no way to make self-extracting FIT Image (only legacy uzImages). Add a target for this named "vmlinuz.itb", which will consist of vmlinuz.bin and selected DT blobs. It will allow to have the advantages of both UHI and self-extracting images. Signed-off-by: Alexander Lobakin <alobakin@pm.me> Acked-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/boot/compressed/Makefile')
-rw-r--r--arch/mips/boot/compressed/Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index fa2c1e1b303f..4c3bc7e3d56d 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -172,3 +172,51 @@ targets += ../uzImage.bin
$(objboot)/uzImage.bin: $(objboot)/vmlinuz.bin FORCE
$(call if_changed,uimage,none)
+
+#
+# Flattened Image Tree (.itb) image
+#
+
+ifeq ($(ADDR_BITS),32)
+itb_addr_cells = 1
+endif
+ifeq ($(ADDR_BITS),64)
+itb_addr_cells = 2
+endif
+
+targets += ../vmlinuz.its.S
+
+quiet_cmd_its_cat = CAT $@
+ cmd_its_cat = cat $(real-prereqs) >$@
+
+$(objboot)/vmlinuz.its.S: $(addprefix $(srctree)/arch/mips/$(PLATFORM)/,$(ITS_INPUTS)) FORCE
+ $(call if_changed,its_cat)
+
+targets += ../vmlinuz.its
+
+quiet_cmd_cpp_its_S = ITS $@
+ cmd_cpp_its_S = $(CPP) -P -C -o $@ $< \
+ -DKERNEL_NAME="\"Linux $(KERNELRELEASE)\"" \
+ -DVMLINUX_BINARY="\"$(2)\"" \
+ -DVMLINUX_COMPRESSION="\"none\"" \
+ -DVMLINUX_LOAD_ADDRESS=$(VMLINUZ_LOAD_ADDRESS) \
+ -DVMLINUX_ENTRY_ADDRESS=$(VMLINUZ_LOAD_ADDRESS) \
+ -DADDR_BITS=$(ADDR_BITS) \
+ -DADDR_CELLS=$(itb_addr_cells)
+
+$(objboot)/vmlinuz.its: $(objboot)/vmlinuz.its.S FORCE
+ $(call if_changed,cpp_its_S,vmlinuz.bin)
+
+targets += ../vmlinuz.itb
+
+quiet_cmd_itb-image = ITB $@
+ cmd_itb-image = \
+ env PATH="$(objtree)/scripts/dtc:$(PATH)" \
+ $(BASH) $(MKIMAGE) \
+ -D "-I dts -O dtb -p 500 \
+ --include $(objtree)/arch/mips \
+ --warning no-unit_address_vs_reg" \
+ -f $(2) $@
+
+$(objboot)/vmlinuz.itb: $(objboot)/vmlinuz.its $(objboot)/vmlinuz.bin FORCE
+ $(call if_changed,itb-image,$<)