From patchwork Sat Nov 5 02:21:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 123794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 76793B6F9F for ; Sat, 5 Nov 2011 13:22:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA01E29B11; Sat, 5 Nov 2011 03:22:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RYYhl+k3VxI2; Sat, 5 Nov 2011 03:22:46 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 67A6B29924; Sat, 5 Nov 2011 03:22:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3974289A7 for ; Sat, 5 Nov 2011 03:22:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y1DHypEDoy6A for ; Sat, 5 Nov 2011 03:22:07 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yw0-f44.google.com (mail-yw0-f44.google.com [209.85.213.44]) by theia.denx.de (Postfix) with ESMTPS id 14C42289BE for ; Sat, 5 Nov 2011 03:22:05 +0100 (CET) Received: by mail-yw0-f44.google.com with SMTP id 2so3042462ywt.3 for ; Fri, 04 Nov 2011 19:22:05 -0700 (PDT) Received: by 10.50.140.1 with SMTP id rc1mr17476588igb.25.1320459725453; Fri, 04 Nov 2011 19:22:05 -0700 (PDT) Received: from localhost.localdomain (d122-104-32-210.sbr6.nsw.optusnet.com.au. [122.104.32.210]) by mx.google.com with ESMTPS id t5sm14414001pbb.13.2011.11.04.19.22.03 (version=SSLv3 cipher=OTHER); Fri, 04 Nov 2011 19:22:05 -0700 (PDT) From: Graeme Russ To: u-boot@lists.denx.de Date: Sat, 5 Nov 2011 13:21:47 +1100 Message-Id: <1320459711-20257-4-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.5.2.317.g391b14 In-Reply-To: <1320459711-20257-1-git-send-email-graeme.russ@gmail.com> References: <1320459711-20257-1-git-send-email-graeme.russ@gmail.com> Cc: Graeme Russ Subject: [U-Boot] [PATCH v0 3/7] x86: Add multiboot header X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- arch/x86/cpu/start.S | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) 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