From patchwork Fri Oct 10 14:21:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 398587 X-Patchwork-Delegate: sjg@chromium.org 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 B02751400B2 for ; Sat, 11 Oct 2014 01:22:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A050DA749C; Fri, 10 Oct 2014 16:22:44 +0200 (CEST) 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 mHdLSA9ICufa; Fri, 10 Oct 2014 16:22:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2C327A7475; Fri, 10 Oct 2014 16:22:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F13FAA7467 for ; Fri, 10 Oct 2014 16:22:33 +0200 (CEST) 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 nTkEFFKSTDz4 for ; Fri, 10 Oct 2014 16:22:33 +0200 (CEST) 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-qa0-f74.google.com (mail-qa0-f74.google.com [209.85.216.74]) by theia.denx.de (Postfix) with ESMTPS id 917D7A7439 for ; Fri, 10 Oct 2014 16:22:29 +0200 (CEST) Received: by mail-qa0-f74.google.com with SMTP id x12so210824qac.1 for ; Fri, 10 Oct 2014 07:22:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d3/XpZsAgMWEtJSfv32LOh3DYEEqD1bljPd8ASVGTOM=; b=K2XatnxYMqI13DljRpyNRK7chauXCXfGhrfyRyU8Y1pTqbVkWX5EB//Z7UpG2UFaK/ pmbnWuWMeTICAnBiVadaZXuNUgU8XlksW5GCb9zOIhcdr1ObLiW3SWIgTONbm50AFvuz /LullQrwBSKX1ESTuvYIJGjd0x4AtL+UCSKtXK5d2/bCLivfcacmbbo9Fgj9WB4XmWex n/6dDeQXuiZAV3LYLjjASrNm1FGMc6iM3tLKOmf74wOWJxXOQq3G+wmR3q7pvjqDiQ82 5g8bxKIIF/x+xzh1B+Cyr2Iej0PSgen6+TNsTmPGDwfta8VxoFyvZDKNe20wCio2ADW6 20Ag== X-Gm-Message-State: ALoCoQnaa9aUwZcqcW+8bcslfJJkB8WaNyglJ/oyVbEUN48wPAzg3mOGUnsk3eX6mhExLGJrGRiF X-Received: by 10.236.179.102 with SMTP id g66mr3040389yhm.23.1412950948636; Fri, 10 Oct 2014 07:22:28 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id k66si326136yho.7.2014.10.10.07.22.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Oct 2014 07:22:28 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id hrjtwwqX.1; Fri, 10 Oct 2014 07:22:28 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 0157E22191F; Fri, 10 Oct 2014 08:22:27 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 10 Oct 2014 08:21:58 -0600 Message-Id: <1412950921-20052-8-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1412950921-20052-1-git-send-email-sjg@chromium.org> References: <1412950921-20052-1-git-send-email-sjg@chromium.org> Cc: Graeme Russ Subject: [U-Boot] [PATCH 07/10] x86: bootm: Support booting a 64-bit raw kernel X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 Detect an x86_64 kernel and boot it in 64-bit mode. Signed-off-by: Simon Glass --- arch/x86/lib/bootm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index b90ca65..46a1d96 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #ifdef CONFIG_SYS_COREBOOT @@ -148,7 +149,11 @@ int boot_linux_kernel(ulong setup_base, ulong load_address, bool image_64bit) timestamp_add_now(TS_U_BOOT_START_KERNEL); #endif if (image_64bit) { - /* TODO(boot 64-bit kernel) */ + if (!cpu_has_64bit()) { + puts("Cannot boot 64-bit kernel on 32-bit machine\n"); + return -EFAULT; + } + return cpu_jump_to_64bit(setup_base, load_address); } else { /* * Set %ebx, %ebp, and %edi to 0, %esi to point to the @@ -178,7 +183,8 @@ static int boot_jump_linux(bootm_headers_t *images) debug("## Transferring control to Linux (at address %08lx, kernel %08lx) ...\n", images->ep, images->os.load); - return boot_linux_kernel(images->ep, images->os.load, false); + return boot_linux_kernel(images->ep, images->os.load, + images->os.arch == IH_ARCH_X86_64); } int do_bootm_linux(int flag, int argc, char * const argv[],