xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/arm: build as zImage
@ 2012-11-23 15:45 Stefano Stabellini
  2012-11-23 15:54 ` Ian Campbell
  2012-11-23 16:22 ` Tim Deegan
  0 siblings, 2 replies; 8+ messages in thread
From: Stefano Stabellini @ 2012-11-23 15:45 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony Perard, Ian Campbell, Stefano Stabellini

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index 25c4cfe..de9cdb2 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -22,6 +22,9 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+#define XEN_PHYS_ADDRESS    0x80000000
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +55,18 @@
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	.rept	7
+	mov	r0, r0
+	.endr
+	mov	r0, r0
+	b	1f
+
+	.word	ZIMAGE_MAGIC_NUMBER				@ Magic numbers to help the loader
+	.word	(_start + XEN_PHYS_ADDRESS)		@ absolute load/run zImage address
+	.word	(_end + XEN_PHYS_ADDRESS)		@ zImage end address
+
+1:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-23 16:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23 15:45 [PATCH] xen/arm: build as zImage Stefano Stabellini
2012-11-23 15:54 ` Ian Campbell
2012-11-23 16:14   ` Stefano Stabellini
2012-11-23 16:26     ` Ian Campbell
2012-11-23 16:39       ` Tim Deegan
2012-11-23 16:50         ` Stefano Stabellini
2012-11-23 16:38     ` Tim Deegan
2012-11-23 16:22 ` Tim Deegan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).