From patchwork Wed Feb 5 17:04:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 24208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D26C120675 for ; Wed, 5 Feb 2014 17:06:03 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oy12sf1415827veb.6 for ; Wed, 05 Feb 2014 09:06:03 -0800 (PST) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=s8n/GO8n/2RyXmdJ9lwG++dACU6LcQwKENz9Xu6dkOg=; b=mwklatAnMz/v6tNap96pGxc5bdWxGrJOSt/32OPsxhTAGn5H862zSHVLhQPi4WI6Iu lquAKEq8gA8QpNxPwHsqYnpSnIAPimdDEuft1qwEYyMG6+HtPOIGeVNNKv2kMScgyTz0 db3YBowSH/Q/WBy08aoSb+S+WtayVXx8SkqhfHBOKzC/1IezGoWPxwGfvxRa4nBYzzId +tVGprGZU8LPrZvBv/vPnQ0ywof2zphulSeHLtYGXV9Rv8Y0BFoYemRb7yun1T7hys5Z msC9jhIunGgKbyQns0IBArTlQk0MTPDREQwvQhur5qj23BprnxDBPXOst7WmyBUydzXe s19w== X-Gm-Message-State: ALoCoQlBzd5/JvQxkYAjVG5Y7LeXI8hkpBWV5AMCsav216Uvxd1iamWIWWLqadhp/YCub7alemT4 X-Received: by 10.58.155.36 with SMTP id vt4mr18354358veb.31.1391619963023; Wed, 05 Feb 2014 09:06:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.101 with SMTP id k92ls186820qgf.78.gmail; Wed, 05 Feb 2014 09:06:02 -0800 (PST) X-Received: by 10.59.6.7 with SMTP id cq7mr1772895ved.14.1391619962898; Wed, 05 Feb 2014 09:06:02 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id tt2si9845543vdc.48.2014.02.05.09.06.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:06:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so530393veb.2 for ; Wed, 05 Feb 2014 09:06:02 -0800 (PST) X-Received: by 10.52.164.39 with SMTP id yn7mr1433855vdb.25.1391619962828; Wed, 05 Feb 2014 09:06:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp64668vcz; Wed, 5 Feb 2014 09:06:00 -0800 (PST) X-Received: by 10.180.87.9 with SMTP id t9mr17467598wiz.36.1391619935209; Wed, 05 Feb 2014 09:05:35 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id u13si9776392wie.14.2014.02.05.09.05.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of leif.lindholm@linaro.org) client-ip=209.85.212.175; Received: by mail-wi0-f175.google.com with SMTP id hm4so792660wib.14 for ; Wed, 05 Feb 2014 09:05:34 -0800 (PST) X-Received: by 10.194.188.80 with SMTP id fy16mr2247125wjc.30.1391619934786; Wed, 05 Feb 2014 09:05:34 -0800 (PST) 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 p1sm47427211wie.1.2014.02.05.09.05.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Feb 2014 09:05:34 -0800 (PST) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: patches@linaro.org, Mark Salter , Leif Lindholm , linux-doc@vger.kernel.org, Rob Landley Subject: [PATCH 18/22] doc: arm64: add description of EFI stub support Date: Wed, 5 Feb 2014 17:04:09 +0000 Message-Id: <1391619853-10601-19-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.org> References: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.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.128.171 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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.