]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
MIPS: Add uImage build target
authorJames Hogan <james.hogan@imgtec.com>
Fri, 30 Aug 2013 15:42:42 +0000 (16:42 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 3 Sep 2013 16:00:01 +0000 (18:00 +0200)
Add a uImage build target for MIPS, which builds uImage.gz (a U-Boot
image of vmlinux.bin.gz), and then symlinks it to uImage. This allows
for the use of other compression algorithms in future, and is how a few
other architectures do it.

It's enabled conditionally on load-y >= 0xffffffff80000000 which
hopefully allows 64bit kernels to also work as long as the load and
entry address can be represented by the 32bit addresses in the U-Boot
image format.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5795/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Makefile
arch/mips/boot/.gitignore
arch/mips/boot/Makefile

index 91d5baa66540070b3a0541b7eb536016076d3335..75a36ad11ff51d0623243ee643b192eb7b9b9b34 100644 (file)
@@ -263,6 +263,10 @@ drivers-$(CONFIG_PM)       += arch/mips/power/
 boot-y                 := vmlinux.bin
 boot-y                 += vmlinux.ecoff
 boot-y                 += vmlinux.srec
+ifeq ($(shell expr $(load-y) \< 0xffffffff80000000 2> /dev/null), 0)
+boot-y                 += uImage
+boot-y                 += uImage.gz
+endif
 
 # compressed boot image targets (arch/mips/boot/compressed/)
 bootz-y                        := vmlinuz
@@ -341,6 +345,8 @@ define archhelp
        echo '  vmlinuz.ecoff        - ECOFF zboot image'
        echo '  vmlinuz.bin          - Raw binary zboot image'
        echo '  vmlinuz.srec         - SREC zboot image'
+       echo '  uImage               - U-Boot image'
+       echo '  uImage.gz            - U-Boot image (gzip)'
        echo
        echo '  These will be default as appropriate for a configured platform.'
 endef
index f210b09ececcf0fe9ab0ee282da0f9332c050394..a73d6e2c4f64fe55e033c05e0ec4aa1eed8eed4e 100644 (file)
@@ -4,3 +4,4 @@ vmlinux.*
 zImage
 zImage.tmp
 calc_vmlinuz_load_addr
+uImage
index 851261e9fdc0a948bb1bfbb9e1f930a0ff8beec1..1466c00260936c7e387877c8c9e296d430cd6240 100644 (file)
@@ -40,3 +40,18 @@ quiet_cmd_srec = OBJCOPY $@
       cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $@
 $(obj)/vmlinux.srec: $(VMLINUX) FORCE
        $(call if_changed,srec)
+
+UIMAGE_LOADADDR  = $(VMLINUX_LOAD_ADDRESS)
+UIMAGE_ENTRYADDR = $(VMLINUX_ENTRY_ADDRESS)
+
+$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
+       $(call if_changed,gzip)
+
+targets += uImage.gz
+$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
+       $(call if_changed,uimage,gzip)
+
+targets += uImage
+$(obj)/uImage: $(obj)/uImage.gz FORCE
+       @ln -sf $(notdir $<) $@
+       @echo '  Image $@ is ready'