From patchwork Fri Apr 4 18:45:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 27858 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF85120369 for ; Fri, 4 Apr 2014 18:46:21 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id pa12sf7693851veb.0 for ; Fri, 04 Apr 2014 11:46:21 -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=ScQ60ZkVFvjcpchD+07N32b71c+0tIecL6gOmx5GCQMHOF2vMX9Wr6MR/XsfZ3uex5 q/n57ku6LxC+pduuuYUWYRN+JsOUk9/JvPvC3Lzf38WgttPvAQ2+TGbJcpPtnMIqKVeF Bopz3LaXKS2gXHI2N5xmcuMlCYgVQUMvV3plGQVYK4rpLu7WN9HiaNTpA3RyIHcACJDb f2yr5d8N/eYSnsc+mLRhjCE+ScnwcxQi3WlYN8i5XtunevX2zh8vMTXPkCbyB1eLNUtr VVbptcjRJ3uij2J0H5aW/I+vB0bJ0BFKC85hn5l1XqSI5iPuY/WXUu0FYVkksmupJGTg u5sw== X-Gm-Message-State: ALoCoQkI3d7A9Sm+Oua5E3z6OAosqLvSqzNt1ZgM0sw+TTHeVF80hCYcPbZNGzpKW2Zzu+2M9Dvm X-Received: by 10.59.10.40 with SMTP id dx8mr4645825ved.26.1396637181740; Fri, 04 Apr 2014 11:46:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.18.241 with SMTP id 104ls1136532qgf.24.gmail; Fri, 04 Apr 2014 11:46:21 -0700 (PDT) X-Received: by 10.220.198.197 with SMTP id ep5mr3550756vcb.21.1396637181649; Fri, 04 Apr 2014 11:46:21 -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 y12si1870729vcn.193.2014.04.04.11.46.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 11:46:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so3486679vcb.38 for ; Fri, 04 Apr 2014 11:46:21 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr6247462vec.15.1396637181527; Fri, 04 Apr 2014 11:46:21 -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.12.8 with SMTP id v8csp136321vcv; Fri, 4 Apr 2014 11:46:19 -0700 (PDT) X-Received: by 10.66.253.33 with SMTP id zx1mr16791219pac.28.1396637179362; Fri, 04 Apr 2014 11:46:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tc5si2503083pab.19.2014.04.04.11.46.18; Fri, 04 Apr 2014 11:46:18 -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 S1754204AbaDDSqJ (ORCPT + 27 others); Fri, 4 Apr 2014 14:46:09 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:47498 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754174AbaDDSqE (ORCPT ); Fri, 4 Apr 2014 14:46:04 -0400 Received: by mail-we0-f175.google.com with SMTP id q58so3816653wes.20 for ; Fri, 04 Apr 2014 11:46:03 -0700 (PDT) X-Received: by 10.194.119.168 with SMTP id kv8mr22256018wjb.41.1396637163213; Fri, 04 Apr 2014 11:46:03 -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 cu6sm3899626wjb.8.2014.04.04.11.46.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Apr 2014 11:46:02 -0700 (PDT) From: Leif Lindholm To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mark Salter , Leif Lindholm , linux-doc@vger.kernel.org, Rob Landley Subject: [PATCH v3 07/10] doc: arm64: add description of EFI stub support Date: Fri, 4 Apr 2014 19:45:10 +0100 Message-Id: <1396637113-22790-8-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396637113-22790-1-git-send-email-leif.lindholm@linaro.org> References: <1396637113-22790-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.179 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.