File tree Expand file tree Collapse file tree 7 files changed +337
-3
lines changed
Expand file tree Collapse file tree 7 files changed +337
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ Sphinx\ [#f1]_ 2.4.4 sphinx-build --version
6262cpio any cpio --version
6363GNU tar 1.28 tar --version
6464gtags (optional) 6.6.5 gtags --version
65+ mkimage (optional) 2017.01 mkimage --version
6566====================== =============== ========================================
6667
6768.. [#f1 ] Sphinx is needed only to build the Kernel documentation
@@ -189,6 +190,14 @@ The kernel build requires GNU GLOBAL version 6.6.5 or later to generate
189190tag files through ``make gtags ``. This is due to its use of the gtags
190191``-C (--directory) `` flag.
191192
193+ mkimage
194+ -------
195+
196+ This tool is used when building a Flat Image Tree (FIT), commonly used on ARM
197+ platforms. The tool is available via the ``u-boot-tools `` package or can be
198+ built from the U-Boot source code. See the instructions at
199+ https://docs.u-boot.org/en/latest/build/tools.html#building-tools-for-linux
200+
192201System utilities
193202****************
194203
Original file line number Diff line number Diff line change @@ -3051,6 +3051,13 @@ F: drivers/mmc/host/sdhci-of-arasan.c
30513051N: zynq
30523052N: xilinx
30533053
3054+ ARM64 FIT SUPPORT
3055+ M: Simon Glass <
[email protected] >
3056+ L:
[email protected] (moderated for non-subscribers)
3057+ S: Maintained
3058+ F: arch/arm64/boot/Makefile
3059+ F: scripts/make_fit.py
3060+
30543061ARM64 PORT (AARCH64 ARCHITECTURE)
30553062M: Catalin Marinas <
[email protected] >
30563063M: Will Deacon <
[email protected] >
Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
154154# Default target when executing plain make
155155boot := arch/arm64/boot
156156
157+ BOOT_TARGETS := Image vmlinuz.efi image.fit
158+
159+ PHONY += $(BOOT_TARGETS )
160+
157161ifeq ($(CONFIG_EFI_ZBOOT ) ,)
158162KBUILD_IMAGE := $(boot ) /Image.gz
159163else
@@ -162,8 +166,10 @@ endif
162166
163167all : $(notdir $(KBUILD_IMAGE ) )
164168
165- vmlinuz.efi : Image
166- Image vmlinuz.efi : vmlinux
169+ image.fit : dtbs
170+
171+ vmlinuz.efi image.fit : Image
172+ $(BOOT_TARGETS ) : vmlinux
167173 $(Q )$(MAKE ) $(build ) =$(boot ) $(boot ) /$@
168174
169175Image.% : Image
@@ -215,6 +221,7 @@ virtconfig:
215221define archhelp
216222 echo '* Image.gz - Compressed kernel image (arch/$(ARCH ) /boot/Image.gz)'
217223 echo ' Image - Uncompressed kernel image (arch/$(ARCH ) /boot/Image)'
224+ echo ' image.fit - Flat Image Tree (arch/$(ARCH ) /boot/image.fit)'
218225 echo ' install - Install uncompressed kernel'
219226 echo ' zinstall - Install compressed kernel'
220227 echo ' Install using (your) ~/bin/installkernel or'
Original file line number Diff line number Diff line change 22Image
33Image.gz
44vmlinuz *
5+ image.fit
Original file line number Diff line number Diff line change 1616
1717OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
1818
19- targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo Image.zst
19+ targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo \
20+ Image.zst image.fit
2021
2122$(obj ) /Image : vmlinux FORCE
2223 $(call if_changed,objcopy)
@@ -39,6 +40,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE
3940$(obj ) /Image.zst : $(obj ) /Image FORCE
4041 $(call if_changed,zstd)
4142
43+ $(obj ) /image.fit : $(obj ) /Image $(obj ) /dts/dtbs-list FORCE
44+ $(call if_changed,fit)
45+
4246EFI_ZBOOT_PAYLOAD := Image
4347EFI_ZBOOT_BFD_TARGET := elf64-littleaarch64
4448EFI_ZBOOT_MACH_TYPE := ARM64
Original file line number Diff line number Diff line change @@ -504,6 +504,22 @@ quiet_cmd_uimage = UIMAGE $@
504504 -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
505505 -n '$(UIMAGE_NAME)' -d $< $@
506506
507+ # Flat Image Tree (FIT)
508+ # This allows for packaging of a kernel and all devicetrees files, using
509+ # compression.
510+ # ---------------------------------------------------------------------------
511+
512+ MAKE_FIT := $(srctree)/scripts/make_fit.py
513+
514+ # Use this to override the compression algorithm
515+ FIT_COMPRESSION ?= gzip
516+
517+ quiet_cmd_fit = FIT $@
518+ cmd_fit = $(MAKE_FIT) -o $@ --arch $(UIMAGE_ARCH) --os linux \
519+ --name '$(UIMAGE_NAME)' \
520+ $(if $(findstring 1,$(KBUILD_VERBOSE)),-v) \
521+ --compress $(FIT_COMPRESSION) -k $< @$(word 2,$^)
522+
507523# XZ
508524# ---------------------------------------------------------------------------
509525# Use xzkern to compress the kernel image and xzmisc to compress other things.
You can’t perform that action at this time.
0 commit comments