From patchwork Mon Jun 16 15:14:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 31975 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E400020E7A for ; Mon, 16 Jun 2014 15:23:37 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id hy10sf20721725vcb.5 for ; Mon, 16 Jun 2014 08:23:37 -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=+mUEg57+AauTr1mT0FQAaHj+EVMVLibqqW/hJTdLO28=; b=SJrUsOc5EYJ1LwYajuRWjKsVty+KA+XhOYi7cuNpoOIxk84PpNi5dqT5z8oAkyT9Cj u/GKaKAff7Td+gkc10d3oEApX6K56CDkyMPGxGdIThdvsES+AX+22zbg7o5aYQ8rxukk jHkJ5eo2tjioeO7XvtzpLjVWhiDjmopwRFf8eXbL5YGFw+ciUJhWNQ2uZTuBVMmXta+5 En+MPZ9qXh4hPlucixn2D3MF9DeklELBxqgcxeFE9CfV13q619C3LTdAgJGlpSti7+AH G+Dx+9sI956LA8XA2FbptdQWhm5/+9RiR7GOX6QbDjSUyXS7Sb4/s16e1yzq4TvS/CwJ 467A== X-Gm-Message-State: ALoCoQl8zOhmL5G0LOvPwVoWTZ/MixWSqotHZdWej8dtMJmGko89t17ZAfDjeYQgPQRWBgGakw+H X-Received: by 10.236.136.231 with SMTP id w67mr1845087yhi.37.1402932217756; Mon, 16 Jun 2014 08:23:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.247 with SMTP id l110ls4242437qgf.90.gmail; Mon, 16 Jun 2014 08:23:37 -0700 (PDT) X-Received: by 10.58.128.229 with SMTP id nr5mr105791veb.76.1402932217635; Mon, 16 Jun 2014 08:23:37 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id 3si4225728vcs.47.2014.06.16.08.23.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so5066032vcb.16 for ; Mon, 16 Jun 2014 08:23:37 -0700 (PDT) X-Received: by 10.58.112.65 with SMTP id io1mr622565veb.61.1402932217562; Mon, 16 Jun 2014 08:23:37 -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.221.54.6 with SMTP id vs6csp142400vcb; Mon, 16 Jun 2014 08:23:37 -0700 (PDT) X-Received: by 10.140.87.243 with SMTP id r106mr25214593qgd.75.1402932217131; Mon, 16 Jun 2014 08:23:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id n7si13602173qas.81.2014.06.16.08.23.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jun 2014 08:23:37 -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 1WwYgT-0003R0-F1; Mon, 16 Jun 2014 15:18:57 +0000 Received: from mail-we0-f169.google.com ([74.125.82.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwYcm-0007DD-B2 for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2014 15:15:09 +0000 Received: by mail-we0-f169.google.com with SMTP id t60so5953374wes.28 for ; Mon, 16 Jun 2014 08:14:45 -0700 (PDT) X-Received: by 10.180.90.145 with SMTP id bw17mr28538430wib.43.1402931684924; Mon, 16 Jun 2014 08:14:44 -0700 (PDT) Received: from ards-macbook-pro.guests.st.com (29-39.80-90.static-ip.oleane.fr. [90.80.39.29]) by mx.google.com with ESMTPSA id wj4sm19157731wjc.23.2014.06.16.08.14.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:14:44 -0700 (PDT) From: Ard Biesheuvel To: matt.fleming@intel.com, x86@kernel.org Subject: [RFC PATCH 2/4] efi/arm64: efistub: move shared dependencies to Date: Mon, 16 Jun 2014 17:14:46 +0200 Message-Id: <1402931688-23597-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1402931688-23597-1-git-send-email-ard.biesheuvel@linaro.org> References: <1402931688-23597-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140616_081508_611061_C7EE8C35 X-CRM114-Status: GOOD ( 12.20 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 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 [74.125.82.169 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.169 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-efi@vger.kernel.org, Ard Biesheuvel , catalin.marinas@arm.com, leif.lindholm@linaro.org, roy.franz@linaro.org, hpa@zytor.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) 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 This moves definitions depended upon both by code under arch/arm64/boot and under drivers/firmware/efi to . This is in preparation of turning the stub code under drivers/firmware/efi into a static library. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/efi.h | 13 +++++++++++++ arch/arm64/kernel/efi-stub.c | 11 +---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index 5a46c4e7f539..9eac34a2725a 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -11,4 +11,17 @@ extern void efi_idmap_init(void); #define efi_idmap_init() #endif + +/* arch specific definitions used by the stub code */ + +/* + * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from + * start of kernel and may not cross a 2MiB boundary. We set alignment to + * 2MiB so we know it won't cross a 2MiB boundary. + */ +#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */ +#define MAX_FDT_OFFSET SZ_512M + +#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__) + #endif /* _ASM_EFI_H */ diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c index 7aa7155a9740..23cbde4324b1 100644 --- a/arch/arm64/kernel/efi-stub.c +++ b/arch/arm64/kernel/efi-stub.c @@ -10,19 +10,10 @@ * */ #include +#include #include #include -/* - * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from - * start of kernel and may not cross a 2MiB boundary. We set alignment to - * 2MiB so we know it won't cross a 2MiB boundary. - */ -#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */ -#define MAX_FDT_OFFSET SZ_512M - -#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__) - static void efi_char16_printk(efi_system_table_t *sys_table_arg, efi_char16_t *str);