From patchwork Wed Apr 22 17:24:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 11504303 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 938BB81 for ; Wed, 22 Apr 2020 17:24:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3FC3B2098B for ; Wed, 22 Apr 2020 17:24:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jqOq2VyM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="tWSrbFlu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FC3B2098B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lbeqJkGGchDRZygCmuyt+7OR0EfBDHaVNpp9oBS99Qg=; b=jqOq2VyMlonezD 0CXA4ZRCnq9Fi00EfI3RggbySlkfj+Xe4i9JU0Afj0r3QtzG/L5qqR2+38YRLzKVwWlgmQUXOmGrH 9CRX0fhTLrx7ipjkC/ek/RM0aA8o5Scz3iZdN7n/wPR+2C2k7FvXBkPUOcaPP9xojTJh2g9qihtkK wZ5RBTuR9KFI0W86R2nORpBXA6DmiK6Pwpwrzo0A1wGZsK6x7Dp8cQBBt9SRp/jckqjobNnhKeu6H +ArXKjAjcDhUu+Aj8ZT001XkZdVp3ugKO7oPqcyqnWO6314u+pQydXCUt00vxnd2LsHZfiZoJlMrn O6O6G+WoTLqTGjSgzZww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRJ7A-0004VV-Uf; Wed, 22 Apr 2020 17:24:48 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRJ76-0004Qa-6i for linux-riscv@lists.infradead.org; Wed, 22 Apr 2020 17:24:45 +0000 Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96CF42082E; Wed, 22 Apr 2020 17:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587576283; bh=gG6njuZNXvWtpI2Xiu55BPhnh2uc/oKogGgx7w4dS9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tWSrbFluMqNVf7PIP0eCEZ4tXJIb7Q9A7ISPSAoc2OAhHTeHWz66iRGaR+GxAiqdP 1kA0MqyFMoI0+sWRbCynmQY8AStqFKTnE/c7JsmN/h1jlT1qaJW/uEDhfnUvl+5atG JBW43la+kIsKVT0IVnRtOU2L8yncsnN4E75Xpklk= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Subject: [PATCH v5 3/7] efi/libstub/riscv: add arch specific efi.h header file Date: Wed, 22 Apr 2020 19:24:10 +0200 Message-Id: <20200422172414.6662-4-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200422172414.6662-1-ardb@kernel.org> References: <20200422172414.6662-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200422_102444_308679_631A22B5 X-CRM114-Status: UNSURE ( 8.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Atish Patra , Palmer Dabbelt , Paul Walmsley , linux-riscv@lists.infradead.org, Ard Biesheuvel Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org From: Atish Patra Add the arch specific efi.h header defining the RISC-V specific glue for the EFI stub code. Signed-off-by: Atish Patra Reviewed-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20200421033336.9663-4-atish.patra@wdc.com [ardb: - split off from 'RISC-V: Add EFI stub support' - drop unused definition of VA_BITS_MIN ] Signed-off-by: Ard Biesheuvel --- arch/riscv/include/asm/efi.h | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/arch/riscv/include/asm/efi.h b/arch/riscv/include/asm/efi.h new file mode 100644 index 000000000000..3dc495a937da --- /dev/null +++ b/arch/riscv/include/asm/efi.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ +#ifndef _ASM_EFI_H +#define _ASM_EFI_H + +#include +#include +#include +#include + +/* on RISC-V, the FDT may be located anywhere in system RAM */ +static inline unsigned long efi_get_max_fdt_addr(unsigned long dram_base) +{ + return ULONG_MAX; +} + +/* Load initrd at enough distance from DRAM start */ +static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base, + unsigned long image_addr) +{ + return dram_base + SZ_256M; +} + +#define efi_bs_call(func, ...) efi_system_table()->boottime->func(__VA_ARGS__) +#define efi_rt_call(func, ...) efi_system_table()->runtime->func(__VA_ARGS__) +#define efi_is_native() (true) + +#define efi_table_attr(inst, attr) (inst->attr) + +#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__) + +#define alloc_screen_info(x...) (&screen_info) +extern char stext_offset[]; + +static inline void free_screen_info(struct screen_info *si) +{ +} + +#endif /* _ASM_EFI_H */