diff mbox

[U-Boot,v2,08/12] x86: Add multiboot header

Message ID 1320755603-8695-9-git-send-email-graeme.russ@gmail.com
State Accepted
Delegated to: Graeme Russ
Headers show

Commit Message

Graeme Russ Nov. 8, 2011, 12:33 p.m. UTC
By adding a multiboot header, 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>
---
Changes for v1:
 - None (skipped to set single version for consolidated series)
Changes for v2:
 - Consolidated patch series

 arch/x86/cpu/start.S |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

--
1.7.5.2.317.g391b14

Comments

Graeme Russ Nov. 12, 2011, 10:08 a.m. UTC | #1
On 08/11/11 23:33, Graeme Russ wrote:
> By adding a multiboot header, 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>
> ---
> Changes for v1:
>  - None (skipped to set single version for consolidated series)
> Changes for v2:
>  - Consolidated patch series
> 
>  arch/x86/cpu/start.S |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)

Applied to u-boot-x86

Thanks,

Graeme
diff mbox

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