public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Christoph Fritz <chf.fritz@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm: zimage: add barebox image magic number
Date: Fri, 03 May 2019 13:19:49 +0200	[thread overview]
Message-ID: <1556882389.2494.5.camel@googlemail.com> (raw)
In-Reply-To: <20190503111317.GR31207@bill-the-cat>

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>
---
Changes since v1:
 - s/other-bootloader/barebox/

 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 <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_MAGICE) {
 #ifndef CONFIG_SPL_FRAMEWORK
-		puts("Bad Linux ARM zImage magic!\n");
+		puts("zimage: Bad magic!\n");
 #endif
 		return 1;
 	}
-- 
2.1.4

  reply	other threads:[~2019-05-03 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 10:19 [U-Boot] [PATCH] arm: zimage: add other-bootloader image magic number Christoph Fritz
2019-05-03 11:13 ` Tom Rini
2019-05-03 11:19   ` Christoph Fritz [this message]
2019-05-10 11:12     ` [U-Boot] [PATCH v2] arm: zimage: add barebox " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1556882389.2494.5.camel@googlemail.com \
    --to=chf.fritz@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox