Patchwork [U-Boot,v0,3/7] x86: Add multiboot header

login
register
mail settings
Submitter Graeme Russ
Date Nov. 5, 2011, 2:21 a.m.
Message ID <1320459711-20257-4-git-send-email-graeme.russ@gmail.com>
Download mbox | patch
Permalink /patch/123794/
State Accepted
Commit a206cc23431474a9890f0301f02f50ad3dc9b062
Headers show

Comments

Graeme Russ - Nov. 5, 2011, 2:21 a.m.
By adding a multiboot heade, U-Boot can be loaded by GRUB2. Using GRUB2 to
bootstrap U-Boot is useful for using an existing BIOS to get an initial
U-Boot port up and running before implementing the low-level reset vector
code, SDRAM init, etc. and overwriting the BIOS

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
---
 arch/x86/cpu/start.S |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
Wolfgang Denk - Nov. 7, 2011, 9:51 p.m.
Dear Graeme Russ,

In message <1320459711-20257-4-git-send-email-graeme.russ@gmail.com> you wrote:
> By adding a multiboot heade, U-Boot can be loaded by GRUB2. Using GRUB2 to
----------------------------^ 'r' missing.


Best regards,

Wolfgang Denk

Patch

diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 5adb387..d099fc9 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -129,3 +129,23 @@  die:	hlt
 blank_idt_ptr:
 	.word	0		/* limit */
 	.long	0		/* base */
+
+	.p2align	2	/* force 4-byte alignment */
+
+multiboot_header:
+	/* magic */
+	.long	0x1BADB002
+	/* flags */
+	.long	(1 << 16)
+	/* checksum */
+	.long	-0x1BADB002 - (1 << 16)
+	/* header addr */
+	.long	multiboot_header - _x86boot_start + CONFIG_SYS_TEXT_BASE
+	/* load addr */
+	.long	CONFIG_SYS_TEXT_BASE
+	/* load end addr */
+	.long	0
+	/* bss end addr */
+	.long	0
+	/* entry addr */
+	.long	CONFIG_SYS_TEXT_BASE