Makefile: add rule to generate u-boot-swap.bin
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Sat, 6 Jun 2020 20:21:47 +0000 (22:21 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Mon, 29 Jun 2020 20:36:36 +0000 (22:36 +0200)
This rule generates an u-boot binary file where the byte endianness
is swapped. This will be used by the MIPS Malta Little-Endian variants
to be able to boot with Qemu. The Qemu Malta Machine expects the
firmware in Big-Endian order.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Makefile

index e3c18d8..2a55a03 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1733,6 +1733,12 @@ u-boot-mtk.bin: u-boot.bin FORCE
        $(call if_changed,mkimage)
 endif
 
+quiet_cmd_endian_swap = SWAP    $@
+      cmd_endian_swap = $(srctree)/tools/endian-swap.py $< $@
+
+u-boot-swap.bin: u-boot.bin FORCE
+       $(call if_changed,endian_swap)
+
 ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink)
 
 # Rule to link u-boot