Skip to content

Commit 9a736fc

Browse files
committed
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 <[email protected]>
1 parent 4ab1870 commit 9a736fc

File tree

5 files changed

+21
-28
lines changed

5 files changed

+21
-28
lines changed

arch/xtensa/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ endif
9393

9494
boot := arch/xtensa/boot
9595

96-
all: zImage
97-
98-
bzImage : zImage
99-
100-
zImage: vmlinux
96+
all Image zImage uImage: vmlinux
10197
$(Q)$(MAKE) $(build)=$(boot) $@
10298

10399
%.dtb:
@@ -107,6 +103,8 @@ dtbs: scripts
107103
$(Q)$(MAKE) $(build)=$(boot)/dts
108104

109105
define archhelp
106+
@echo '* Image - Kernel ELF image with reset vector'
110107
@echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
108+
@echo '* uImage - U-Boot wrapped image'
111109
@echo ' dtbs - Build device tree blobs for enabled boards'
112110
endef

arch/xtensa/boot/Makefile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ subdir-y := lib
2121

2222
# Subdirs for the boot loader(s)
2323

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
2727

28-
zImage Image: $(bootdir-y)
28+
all: $(boot-y)
29+
Image: boot-elf
30+
zImage: boot-redboot
31+
uImage: $(obj)/uImage
2932

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))
3235
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
3336

3437
OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
@@ -41,4 +44,10 @@ vmlinux.bin.gz: vmlinux.bin FORCE
4144

4245
boot-elf: vmlinux.bin
4346
boot-redboot: vmlinux.bin.gz
44-
boot-uboot: vmlinux.bin.gz
47+
48+
UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
49+
UIMAGE_COMPRESSION = gzip
50+
51+
$(obj)/uImage: vmlinux.bin.gz FORCE
52+
$(call if_changed,uimage)
53+
$(Q)$(kecho) ' Kernel: $@ is ready'

arch/xtensa/boot/boot-elf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
3131
-o $@ $(obj)/Image.o
3232
$(Q)$(kecho) ' Kernel: $@ is ready'
3333

34-
zImage: $(obj)/../Image.elf
34+
all Image: $(obj)/../Image.elf

arch/xtensa/boot/boot-redboot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ $(obj)/../zImage.redboot: $(obj)/zImage.elf
3232
$(Q)$(OBJCOPY) -S -O binary $< $@
3333
$(Q)$(kecho) ' Kernel: $@ is ready'
3434

35-
zImage: $(obj)/../zImage.redboot
35+
all zImage: $(obj)/../zImage.redboot

arch/xtensa/boot/boot-uboot/Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)