From patchwork Fri Apr 25 16:09:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 29099 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1B0D9203AC for ; Fri, 25 Apr 2014 16:13:17 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf8912321pab.9 for ; Fri, 25 Apr 2014 09:13:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=sknH3FFWKSnTrcH1h4HiBa6AoLTq5+7+PmnUFuVSutg=; b=F+O18JDnzV4Vx43rC2huLxC7rf/u0Pw2ruYrUB3rS+sHLUUmJCZGaKX7QzEBbLUujX OhpkNfQaLIwzC4ObSUhHEaiyAp7njjDSeL9Crcqz0mt8PhJGOkXCQQRlaS7ek/Ad+y0R kimNc22G8f1QO/hx/ZF8zS75L06oAINcgQsZFNBIAxOgAC84nOSPq7h876qa/te+KH/k xgorYsSz//wjOsfqDivcRRtqXWSrOzEp3NGEU1GC4nczg5BArEnyFkwN5aLwZHS/U+ug aahi25W5dDh7Q0ViJI44+WhG7NrT4FI3VaTh7bhS2XYTOOkuTi/Gb/RObuY3zsOj9NB/ EO1A== X-Gm-Message-State: ALoCoQn9cvvQyAHd8OEMLf0MPFV50k7iANSuwrmkgGn+yVhEjahq2u7jHIhe6tzjziW69RQh6eDn X-Received: by 10.66.241.8 with SMTP id we8mr4127218pac.16.1398442397096; Fri, 25 Apr 2014 09:13:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.52 with SMTP id e49ls1650083qge.19.gmail; Fri, 25 Apr 2014 09:13:16 -0700 (PDT) X-Received: by 10.58.1.5 with SMTP id 5mr7462480vei.8.1398442396897; Fri, 25 Apr 2014 09:13:16 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id u5si1797875vdo.184.2014.04.25.09.13.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 09:13:16 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so4968436vcb.24 for ; Fri, 25 Apr 2014 09:13:16 -0700 (PDT) X-Received: by 10.52.136.35 with SMTP id px3mr24295vdb.66.1398442396818; Fri, 25 Apr 2014 09:13:16 -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.221.72 with SMTP id ib8csp109832vcb; Fri, 25 Apr 2014 09:13:16 -0700 (PDT) X-Received: by 10.224.112.74 with SMTP id v10mr12909442qap.28.1398442396187; Fri, 25 Apr 2014 09:13:16 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id u89si4090202qga.183.2014.04.25.09.13.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Apr 2014 09:13:16 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WdijE-0001dY-TD; Fri, 25 Apr 2014 16:11:56 +0000 Received: from mail-wi0-f180.google.com ([209.85.212.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WdiiI-0000S4-Vm for linux-arm-kernel@lists.infradead.org; Fri, 25 Apr 2014 16:10:59 +0000 Received: by mail-wi0-f180.google.com with SMTP id q5so2906807wiv.1 for ; Fri, 25 Apr 2014 09:10:36 -0700 (PDT) X-Received: by 10.180.14.199 with SMTP id r7mr4507606wic.0.1398442236743; Fri, 25 Apr 2014 09:10:36 -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 uy4sm11813046wjc.8.2014.04.25.09.10.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Apr 2014 09:10:35 -0700 (PDT) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 09/10] doc: arm64: add description of EFI stub support Date: Fri, 25 Apr 2014 17:09:13 +0100 Message-Id: <1398442154-19974-10-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398442154-19974-1-git-send-email-leif.lindholm@linaro.org> References: <1398442154-19974-1-git-send-email-leif.lindholm@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140425_091059_197525_9A9732E5 X-CRM114-Status: GOOD ( 16.83 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.180 listed in list.dnswl.org] Cc: mark.rutland@arm.com, matt.fleming@intel.com, ard.biesheuvel@linaro.org, catalin.marinas@arm.com, linux-doc@vger.kernel.org, roy.franz@linaro.org, msalter@redhat.com, grant.likely@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 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 beb754e..37fc4f6 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.