Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: clean up bootable image build targets

Currently xtensa uses 'zImage' as a synonym of 'all', but in fact xtensa
supports three targets: 'Image' (ELF image with reset vector), 'zImage'
(compressed redboot image) and 'uImage' (U-Boot image).
Provide separate 'Image', 'zImage' and 'uImage' make targets that only
build corresponding image type. Make 'all' build all images appropriate
for a platform.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+21 -28
+3 -5
arch/xtensa/Makefile
··· 93 93 94 94 boot := arch/xtensa/boot 95 95 96 - all: zImage 97 - 98 - bzImage : zImage 99 - 100 - zImage: vmlinux 96 + all Image zImage uImage: vmlinux 101 97 $(Q)$(MAKE) $(build)=$(boot) $@ 102 98 103 99 %.dtb: ··· 103 107 $(Q)$(MAKE) $(build)=$(boot)/dts 104 108 105 109 define archhelp 110 + @echo '* Image - Kernel ELF image with reset vector' 106 111 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' 112 + @echo '* uImage - U-Boot wrapped image' 107 113 @echo ' dtbs - Build device tree blobs for enabled boards' 108 114 endef
+16 -7
arch/xtensa/boot/Makefile
··· 21 21 22 22 # Subdirs for the boot loader(s) 23 23 24 - bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf 25 - bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot 26 - bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot 24 + boot-$(CONFIG_XTENSA_PLATFORM_ISS) += Image 25 + boot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage 26 + boot-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += Image zImage uImage 27 27 28 - zImage Image: $(bootdir-y) 28 + all: $(boot-y) 29 + Image: boot-elf 30 + zImage: boot-redboot 31 + uImage: $(obj)/uImage 29 32 30 - $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \ 31 - $(addprefix $(obj)/,$(host-progs)) 33 + boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) \ 34 + $(addprefix $(obj)/,$(host-progs)) 32 35 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) 33 36 34 37 OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary ··· 44 41 45 42 boot-elf: vmlinux.bin 46 43 boot-redboot: vmlinux.bin.gz 47 - boot-uboot: vmlinux.bin.gz 44 + 45 + UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS) 46 + UIMAGE_COMPRESSION = gzip 47 + 48 + $(obj)/uImage: vmlinux.bin.gz FORCE 49 + $(call if_changed,uimage) 50 + $(Q)$(kecho) ' Kernel: $@ is ready'
+1 -1
arch/xtensa/boot/boot-elf/Makefile
··· 31 31 -o $@ $(obj)/Image.o 32 32 $(Q)$(kecho) ' Kernel: $@ is ready' 33 33 34 - zImage: $(obj)/../Image.elf 34 + all Image: $(obj)/../Image.elf
+1 -1
arch/xtensa/boot/boot-redboot/Makefile
··· 32 32 $(Q)$(OBJCOPY) -S -O binary $< $@ 33 33 $(Q)$(kecho) ' Kernel: $@ is ready' 34 34 35 - zImage: $(obj)/../zImage.redboot 35 + all zImage: $(obj)/../zImage.redboot
-14
arch/xtensa/boot/boot-uboot/Makefile
··· 1 - # 2 - # This file is subject to the terms and conditions of the GNU General Public 3 - # License. See the file "COPYING" in the main directory of this archive 4 - # for more details. 5 - # 6 - 7 - UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS) 8 - UIMAGE_COMPRESSION = gzip 9 - 10 - $(obj)/../uImage: vmlinux.bin.gz FORCE 11 - $(call if_changed,uimage) 12 - $(Q)$(kecho) ' Kernel: $@ is ready' 13 - 14 - zImage: $(obj)/../uImage