From patchwork Sat Sep 10 08:11:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12972464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 57271ECAAD5 for ; Sat, 10 Sep 2022 08:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aobo1rSpG3fcYKv/BLc93wghz7vScOWS0o5CgwLVobk=; b=B9Qpf6zzJ2hVNp x42Gqw2R2Og9I/WylovgSisD0B0dUj6Du5z455y+unZtXIPhdP1xQFCDv+B6tJMeXG8+Y2jRFxXhN ewIvO3lJNAPqbX28YD+23fGqm+l7JR/wYKaeARXq4UoUozrKuooyN21hJ1BiWjzl+c6/Se47ZE4x4 40m1TghFjirK+rYQFsdTn3MW9lVtefvzLaDmjt2SyKWuxX0MQzXiAQnGRZ8cs955nQgZvn5Z6J1DM Xea+beXoysvhnBO8CFUmqGDAAkifAsbdIiCJejhK6quEextcdrchseFSsFhRYC5cUGJheHwR36Dn/ +gsvgSuTv8sPGRpHFkzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWvd1-008cTY-Vx; Sat, 10 Sep 2022 08:14:16 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWvbd-008bkS-7C for linux-arm-kernel@lists.infradead.org; Sat, 10 Sep 2022 08:12:50 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 235ABCE08C7; Sat, 10 Sep 2022 08:12:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5963C433C1; Sat, 10 Sep 2022 08:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662797558; bh=0ouOP9xoTyJITAHyjmd8EH9dpexRXhxT+Iu2CyWbYy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uTjLsKgqX4XgLP7eSw0YZ90daypxBIDpGt7QPTKfv2sOxzcERUydbu0rue603CG3t hJA0stKux6PRL2dD+TkB4RXwcQ90jqBaE6eY8vHMvWlGOGtOVSJEUOG4jm09hS6LmX nZ06ulaXoiRviEzl2LmBOpjjkZFXnGqG0EUJNus5yZti6EeOrTbxH+OisdmYQjosei PvH1Neq2XeyF5XvNt2bpmcjKH62K1M7Ees8VrfUffxQj9gQyGARqvrKOHlOWN5Ssel cc0zoWQFtaHWrwT0xnMQGWPhqQQ5rwNd/vuNcnfJIxwHyzsa2HSvMXjUzyMHyKtAs7 0O4v8QKO+4hrA== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , "James E.J. Bottomley" , Matthew Garrett , Peter Jones , Ilias Apalodimas , Heinrich Schuchardt , AKASHI Takahiro , Palmer Dabbelt , Atish Patra , Arnd Bergmann , Huacai Chen , Xi Ruoyao , Lennart Poettering , Jeremy Linton , Will Deacon , Catalin Marinas Subject: [PATCH v5 7/8] riscv: efi: enable generic EFI compressed boot Date: Sat, 10 Sep 2022 10:11:51 +0200 Message-Id: <20220910081152.2238369-8-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220910081152.2238369-1-ardb@kernel.org> References: <20220910081152.2238369-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1646; i=ardb@kernel.org; h=from:subject; bh=0ouOP9xoTyJITAHyjmd8EH9dpexRXhxT+Iu2CyWbYy0=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjHEbGB0Nn9/B7FM1mxtDBajVOlkYZ+FfmjrQThfjS iiauInaJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYxxGxgAKCRDDTyI5ktmPJKdoC/ wMslwiCbB31366kUv9bXKX1pHHEq8Hs8mYWyHuPRLsV1z35J+nLhUciUF2gQsF7gXh7Kwugree/Gbz Xkwj8HZFplsRLN0BvvrU/WRZQFMmFAQJMh1BavDk2PlVCxIYXM1YGBATfuPG5sYGlmAV1FkxuxkAl+ by/j6GcydAkvWwSIj5onum8WGptJRp5iKHSlbMk8mX/bN+tpa45zue0H8FVnlo5F64erQaTB7904ho //Hd4XpUlPWvcSx2q4n7wywXBvUAPrIcvRy/WxXNXXxMs9yXOkzT9tMBWQCoZDjDG+QEH4IcAwc9cP jH2s6E2/tLOvQGK40nLjZ7s/KkDVKy2S+OfpnriiL7o0QgTZSUHg+b8b4F6oet62kSBK5GuPQSb0/5 lRa8dnwNHoWc6CIzKm2+HEsAukTWUQPTPTz889UgsF4qYssn7zm0yQM0u91dC9PrYBImV/J1GTkuO+ 4e0eXWSVYB/rZn3d9pC67BXkz50pgALmkYA7He4l6NhSA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220910_011249_647089_D6F33F7E X-CRM114-Status: GOOD ( 10.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Wire up the generic EFI zboot support for RISC-V. Signed-off-by: Ard Biesheuvel Tested-by: Conor Dooley --- arch/riscv/Makefile | 6 +++++- arch/riscv/boot/.gitignore | 1 + arch/riscv/boot/Makefile | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 3fa8ef336822..d63295e21373 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -136,10 +136,14 @@ ifneq ($(CONFIG_XIP_KERNEL),y) ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAAN),yy) KBUILD_IMAGE := $(boot)/loader.bin else +ifeq ($(CONFIG_EFI_ZBOOT),) KBUILD_IMAGE := $(boot)/Image.gz +else +KBUILD_IMAGE := $(boot)/vmlinuz.efi +endif endif endif -BOOT_TARGETS := Image Image.gz loader loader.bin xipImage +BOOT_TARGETS := Image Image.gz loader loader.bin xipImage vmlinuz.efi all: $(notdir $(KBUILD_IMAGE)) diff --git a/arch/riscv/boot/.gitignore b/arch/riscv/boot/.gitignore index 0cea9f7fa9d5..e1bc507e8cb2 100644 --- a/arch/riscv/boot/.gitignore +++ b/arch/riscv/boot/.gitignore @@ -4,4 +4,5 @@ Image.* loader loader.lds loader.bin +vmlinuz* xipImage diff --git a/arch/riscv/boot/Makefile b/arch/riscv/boot/Makefile index becd0621071c..d1a49adcb1d7 100644 --- a/arch/riscv/boot/Makefile +++ b/arch/riscv/boot/Makefile @@ -58,3 +58,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE $(obj)/loader.bin: $(obj)/loader FORCE $(call if_changed,objcopy) + +EFI_ZBOOT_PAYLOAD := Image +EFI_ZBOOT_BFD_TARGET := elf$(BITS)-littleriscv +EFI_ZBOOT_MACH_TYPE := RISCV$(BITS) + +include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot