From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Fritz Date: Fri, 03 May 2019 12:19:05 +0200 Subject: [U-Boot] [PATCH] arm: zimage: add other-bootloader image magic number Message-ID: <1556878745.2494.1.camel@googlemail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de For chainboot configurations or test environments, this patch allows booting other-bootloader images by using command bootz. Signed-off-by: Christoph Fritz --- arch/arm/lib/zimage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/lib/zimage.c b/arch/arm/lib/zimage.c index 09ab331..bc2768b 100644 --- a/arch/arm/lib/zimage.c +++ b/arch/arm/lib/zimage.c @@ -9,6 +9,7 @@ #include #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_MAGICE) { #ifndef CONFIG_SPL_FRAMEWORK - puts("Bad Linux ARM zImage magic!\n"); + puts("zimage: Bad magic!\n"); #endif return 1; } -- 2.1.4