]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: zimage: add barebox image magic number
authorChristoph Fritz <chf.fritz@googlemail.com>
Fri, 3 May 2019 11:19:49 +0000 (13:19 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 10 May 2019 00:21:59 +0000 (20:21 -0400)
For chainboot configurations or test environments, this patch allows
booting barebox images by using command bootz.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
arch/arm/lib/zimage.c

index 09ab331ee09c31d47c502f46791b0cd4bfd5915e..49305299b39a9f473b8578c4b5957cf285711703 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 
 #define        LINUX_ARM_ZIMAGE_MAGIC  0x016f2818
+#define        BAREBOX_IMAGE_MAGIC     0x00786f62
 
 struct arm_z_header {
        uint32_t        code[9];
@@ -21,9 +22,10 @@ int bootz_setup(ulong image, ulong *start, ulong *end)
 {
        struct arm_z_header *zi = (struct arm_z_header *)image;
 
-       if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC) {
+       if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC &&
+           zi->zi_magic != BAREBOX_IMAGE_MAGIC) {
 #ifndef CONFIG_SPL_FRAMEWORK
-               puts("Bad Linux ARM zImage magic!\n");
+               puts("zimage: Bad magic!\n");
 #endif
                return 1;
        }