Skip to contentSkip to conversation

arm: zimage: add other-bootloader image magic number

PATCH Superseded Christoph Fritz 2 participants 4 messages May 3, 2019 – May 10, 2019 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: zimage: add other-bootloader image magic number

For chainboot configurations or test environments, this patch allows booting other-bootloader images by using command bootz.

---
 arch/arm/lib/zimage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/lib/zimage.c +4 -2
index 09ab331..bc2768b 100644
@@ -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;
 	}
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 arm: zimage: add other-bootloader image magic number

Quoted 23 lines · Christoph Fritz

For chainboot configurations or test environments, this patch allows booting other-bootloader images by using command bootz.

---
 arch/arm/lib/zimage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/lib/zimage.c +1 -0
index 09ab331..bc2768b 100644
@@ -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;

arch/arm/lib/zimage.c int bootz_setup(ulong image, ulong *start, ulong *end) · line 31

Quoted 10 lines
arch/arm/lib/zimage.c +3 -2
 
-	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;
 	}

Please re-word the commit to be clear you're adding the barebox magic number, but this is otherwise fine. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190503/d2ffbb8a/attachment.sig>
#2 lore raw

PATCH v2 1/1 arm: zimage: add barebox image magic number

For chainboot configurations or test environments, this patch allows booting barebox images by using command bootz.

---
Changes since v1:
- s/other-bootloader/barebox/

 arch/arm/lib/zimage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/lib/zimage.c +4 -2
index 09ab331..bc2768b 100644
@@ -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;
 	}
Signature · 1 line
2.1.4
#3 lore raw

PATCH v2 1/1 arm: zimage: add barebox image magic number

Quoted 4 lines · Christoph Fritz

For chainboot configurations or test environments, this patch allows booting barebox images by using command bootz.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190510/b1c969f6/attachment.sig>