From patchwork Thu Mar 13 22:47:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 26228 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C4AE203AC for ; Thu, 13 Mar 2014 22:48:52 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf8572838ykq.0 for ; Thu, 13 Mar 2014 15:48:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6vkzmFdUVWvhZ+2nvHUYxQQKXL1zSgYUHfXhBjkhqTU=; b=eMsxmZTkIrcDfRTYLMQKNgbj3sgT8ePyBtKeY276N26DvOkwHYirKSdFcxcjsL1q3L UFXAYa1qyAfBKgjLgawbmeIz9Zn84ZJzBDEhIg9yRWnWxD+CXTYOTWc95AGTn6deQLSO f7OGdb4XTC5fj5e1Eb6OuCkmtVWYlm8oyQt1XFwLl9m7RP5JpVcupGYjtfeP/qHdJOwr 05dFaQNuq97AzI++k0aOC631y5liPhAC5Z+VfJ4QdN9Dp/X8D5dAdICS087jkOYkLsA3 nPe9SVFpXEWhXvhOoetbX6jIITi6E/TnSjnvjUVD2k3cTBFpqKJxD/oXSsYTOYVMaSI1 EPRg== X-Gm-Message-State: ALoCoQkfPqqzj0mVnj9KwI5fTZ8UXpiA2l5Wk+xwgMzHp+CqR50UMINZydlqtmT/9RYrVsCsAzzj X-Received: by 10.58.91.196 with SMTP id cg4mr1824207veb.41.1394750932360; Thu, 13 Mar 2014 15:48:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.35 with SMTP id 32ls486310qgu.80.gmail; Thu, 13 Mar 2014 15:48:52 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr2860504vdb.30.1394750932268; Thu, 13 Mar 2014 15:48:52 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id u5si1405928vdo.4.2014.03.13.15.48.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 15:48:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if17so1865512vcb.22 for ; Thu, 13 Mar 2014 15:48:52 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr3561077vcb.0.1394750932166; Thu, 13 Mar 2014 15:48:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp10219vck; Thu, 13 Mar 2014 15:48:51 -0700 (PDT) X-Received: by 10.68.179.98 with SMTP id df2mr5342230pbc.51.1394750931294; Thu, 13 Mar 2014 15:48:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wh10si2380748pab.140.2014.03.13.15.48.48; Thu, 13 Mar 2014 15:48:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755506AbaCMWs0 (ORCPT + 26 others); Thu, 13 Mar 2014 18:48:26 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:57219 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755428AbaCMWsT (ORCPT ); Thu, 13 Mar 2014 18:48:19 -0400 Received: by mail-we0-f170.google.com with SMTP id w61so1467870wes.1 for ; Thu, 13 Mar 2014 15:48:18 -0700 (PDT) X-Received: by 10.194.21.193 with SMTP id x1mr3633638wje.33.1394750898684; Thu, 13 Mar 2014 15:48:18 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id dk9sm9072133wjb.4.2014.03.13.15.48.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Mar 2014 15:48:17 -0700 (PDT) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, matt.fleming@intel.com Cc: msalter@redhat.com, roy.franz@linaro.org, Leif Lindholm , linux-doc@vger.kernel.org, Rob Landley Subject: [PATCH v2 12/15] doc: arm64: add description of EFI stub support Date: Thu, 13 Mar 2014 22:47:05 +0000 Message-Id: <1394750828-16351-13-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394750828-16351-1-git-send-email-leif.lindholm@linaro.org> References: <1394750828-16351-1-git-send-email-leif.lindholm@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Salter Add explanation of arm64 EFI stub and kernel image header changes needed to masquerade as a PE/COFF application. Signed-off-by: Mark Salter Signed-off-by: Leif Lindholm Acked-by: Grant Likely CC: linux-doc@vger.kernel.org CC: Rob Landley --- Documentation/arm64/booting.txt | 4 ++++ Documentation/efi-stub.txt | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Documentation/arm64/booting.txt b/Documentation/arm64/booting.txt index a9691cc..aa95d38c 100644 --- a/Documentation/arm64/booting.txt +++ b/Documentation/arm64/booting.txt @@ -85,6 +85,10 @@ The decompressed kernel image contains a 64-byte header as follows: Header notes: - code0/code1 are responsible for branching to stext. +- when booting through EFI, code0/code1 are initially skipped. + res5 is an offset to the PE header and the PE header has the EFI + entry point (efi_stub_entry). When the stub has done its work, it + jumps to code0 to resume the normal boot process. The image must be placed at the specified offset (currently 0x80000) from the start of the system RAM and called there. The start of the diff --git a/Documentation/efi-stub.txt b/Documentation/efi-stub.txt index 26be7b0..7747024 100644 --- a/Documentation/efi-stub.txt +++ b/Documentation/efi-stub.txt @@ -12,6 +12,11 @@ arch/arm/boot/compressed/efi-header.S and arch/arm/boot/compressed/efi-stub.c. EFI stub code that is shared between architectures is in drivers/firmware/efi/efi-stub-helper.c. +For arm64, there is no compressed kernel support, so the Image itself +masquerades as a PE/COFF image and the EFI stub is linked into the +kernel. The arm64 EFI stub lives in arch/arm64/kernel/efi-entry.S +and arch/arm64/kernel/efi-stub.c. + By using the EFI boot stub it's possible to boot a Linux kernel without the use of a conventional EFI boot loader, such as grub or elilo. Since the EFI boot stub performs the jobs of a boot loader, in @@ -28,7 +33,8 @@ the extension the EFI firmware loader will refuse to execute it. It's not possible to execute bzImage.efi from the usual Linux file systems because EFI firmware doesn't have support for them. For ARM the arch/arm/boot/zImage should be copied to the system partition, and it -may not need to be renamed. +may not need to be renamed. Similarly for arm64, arch/arm64/boot/Image +should be copied but not necessarily renamed. **** Passing kernel parameters from the EFI shell @@ -72,7 +78,7 @@ is passed to bzImage.efi. **** The "dtb=" option -For the ARM architecture, we also need to be able to provide a device -tree to the kernel. This is done with the "dtb=" command line option, +For the ARM and arm64 architectures, we also need to be able to provide a +device tree to the kernel. This is done with the "dtb=" command line option, and is processed in the same manner as the "initrd=" option that is described above.