From patchwork Fri Jan 10 22:29:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 23119 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1F34B216DB for ; Fri, 10 Jan 2014 22:29:40 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id h16sf18915933oag.1 for ; Fri, 10 Jan 2014 14:29:39 -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=IG130ZSjn4nsruD5mp6VeNgTbSxtXXWGyXPRcijg8DY=; b=f9znFIL060FqE1q5ebDBNMUrrQXuncU8QzAbZQi+tVExotmLkD4eZVVNYi/CgwJZXH fYus04HgViH1aqtKImhvq4t+/mMZffXH2/kJ9z7PaQRZ1gRcyoPcBKcJyhzhmel7keIG Ol7kucXzr2tT0yxZ+jgNTcojw2PN/Ua0VLxDIQC1sHBn+l1XRWspJfTxUNyJRu4YQ1qH xPwBJtvb1ipwnrDgbZflpkMmjimNN+moj9lXcsC7L5CrL9iDUsB6coF7o+zcB/+LQ2Lx PnbX2SDTO2lOZXJ0Lm0VsVKRwAeKttZqsoQ3JAsz/PebS2cgQw147To00evI4/6K6SIr M3GQ== X-Gm-Message-State: ALoCoQlN/L65RAC81AEFXfuZ2Ybs1kMI1iXmex9KiB1yat8914OB4EEIHNatzPiWukkMrdyQfb+C X-Received: by 10.42.22.206 with SMTP id p14mr4183640icb.18.1389392979283; Fri, 10 Jan 2014 14:29:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.163 with SMTP id z3ls1826144qej.1.gmail; Fri, 10 Jan 2014 14:29:39 -0800 (PST) X-Received: by 10.52.27.170 with SMTP id u10mr126509vdg.74.1389392979174; Fri, 10 Jan 2014 14:29:39 -0800 (PST) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id sz9si5730700vdc.71.2014.01.10.14.29.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 14:29:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.179; Received: by mail-ve0-f179.google.com with SMTP id jw12so3857696veb.24 for ; Fri, 10 Jan 2014 14:29:39 -0800 (PST) X-Received: by 10.58.196.211 with SMTP id io19mr9620473vec.9.1389392979061; Fri, 10 Jan 2014 14:29:39 -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.59.13.131 with SMTP id ey3csp121820ved; Fri, 10 Jan 2014 14:29:38 -0800 (PST) X-Received: by 10.49.53.100 with SMTP id a4mr12411578qep.44.1389392978514; Fri, 10 Jan 2014 14:29:38 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTP id g2si5280956qaz.49.2014.01.10.14.29.37 for ; Fri, 10 Jan 2014 14:29:38 -0800 (PST) Received-SPF: pass (google.com: domain of msalter@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0AMTXkV009660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Jan 2014 17:29:34 -0500 Received: from deneb.redhat.com (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0AMTQfh004120; Fri, 10 Jan 2014 17:29:32 -0500 From: Mark Salter To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, Catalin Marinas , Will Deacon , matt.fleming@intel.com, Leif Lindholm , roy.franz@linaro.org, patches@linaro.org, Grant Likely , Mark Salter , linux-doc@vger.kernel.org, Rob Landley Subject: [PATCH 5/6] doc: arm64: add description of EFI stub support Date: Fri, 10 Jan 2014 17:29:09 -0500 Message-Id: <1389392950-22457-6-git-send-email-msalter@redhat.com> In-Reply-To: <1389392950-22457-1-git-send-email-msalter@redhat.com> References: <1389392950-22457-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: msalter@redhat.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.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 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: , Add explanation of arm64 EFI stub and kernel image header changes needed to masquerade as a PE/COFF application. Signed-off-by: Mark Salter 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 a55a0cd..d8ad0c1 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.