From patchwork Sat Sep 10 08:11:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 605121 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3D55ECAAD5 for ; Sat, 10 Sep 2022 08:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbiIJINS (ORCPT ); Sat, 10 Sep 2022 04:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiIJIMx (ORCPT ); Sat, 10 Sep 2022 04:12:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAC2B89820; Sat, 10 Sep 2022 01:12:45 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id B37D9B80A1F; Sat, 10 Sep 2022 08:12:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEDABC433D7; Sat, 10 Sep 2022 08:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662797562; bh=lwtkWqnCdC5DTCxRNKDZAmqT7xFGdg5/mD/OyTi+jns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZOdk3K0+fDQSXUkVV1UQVNrKkF1z8VQ6IrRebarYpJKGMhIIDynbV00pEBvpcWFmd VJzD7vjT5pcn/L9XYHw4UvjYf8LVH9ZvOr8yt15syG7AGhnXifpWmopBXwUHSdxVss /vqExpAel4cYuMHw4XKkKRbaarz8vLoNphuAwFfyfu4WX46MfuBxLc6nRVHq4zF1Ax oCNhJf/MQ/4YHX0D1Hio3LI3p/dxJNCfwwuPki071rG+Ip1n5cjRFcOV/IrefGaUju LeDc4EUuXjurHcERtalJCfsqfs9XFYbaAHjpGyVf2eVLFZ/uYCR5mH9fNDgZMnxtb/ npXste2NcsNZQ== 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 8/8] loongarch: efi: enable generic EFI compressed boot Date: Sat, 10 Sep 2022 10:11:52 +0200 Message-Id: <20220910081152.2238369-9-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=2133; i=ardb@kernel.org; h=from:subject; bh=lwtkWqnCdC5DTCxRNKDZAmqT7xFGdg5/mD/OyTi+jns=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjHEbHfhsOWC6jY9/BchEKckyY8ye89Us81pOZvd6I L0O/jheJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYxxGxwAKCRDDTyI5ktmPJHjpC/ 9PvwfHLVyV0gx543xJ5aj4rBRcRSIT4OzOblDa0pQC7alXcteRi8zXtxqMIClOF/fRR7HSGL9OQboo /Ar/6F8I8a9KV6h9sNHvXjbskBYyKgRCClAd4En7AXgFKHMTNxqgjaC9v0p+08bgbQeydxvBCai3cQ QMxx0WwWc3EphmiSZ0qvEqIvvbvpiSealSogkU/3iQDSimCQnMNbz/KwBVNwhzcWkSdJhSiRy/aYlv J+T7mGNGhmKibk3CIxGnwr18XZVtvcoyt+psuBvIjncvaKOfL4yEXDW1wwqcNdtRkrZodh2NjGGDNm 2hWVmS/y/iAIfvM8SQ+t8jI7GcLYlwfYPDQzWaJGlff6Cudh6KPWr4EfodCkaQkkHJ1cXlN7tzVuOf 4GXm7IVOIjutmPpxx8QoZgVP0X5f9emhSDvpGgdIJdVaU0m6N/1ShIRPNyCIBFiWMVwN262gGluvgP 0yQtENAuDQtau0At5ub3UBxUl2pZm0SUJFlpMEcRUl4zI= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Wire up the generic EFI zboot support for LoongArch64 Signed-off-by: Ard Biesheuvel --- arch/loongarch/Kconfig | 1 + arch/loongarch/Makefile | 4 ++-- arch/loongarch/boot/.gitignore | 1 + arch/loongarch/boot/Makefile | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index fca106a8b8af..f960dbbfb62d 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -55,6 +55,7 @@ config LOONGARCH select BUILDTIME_TABLE_SORT select COMMON_CLK select EFI + select EFI_ZBOOT select GENERIC_CLOCKEVENTS select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index 4bc47f47cfd8..357ed2a771bf 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -10,7 +10,7 @@ KBUILD_DEFCONFIG := loongson3_defconfig ifndef CONFIG_EFI_STUB KBUILD_IMAGE := $(boot)/vmlinux.elf else -KBUILD_IMAGE := $(boot)/vmlinux.efi +KBUILD_IMAGE := $(boot)/vmlinuz.efi endif # @@ -93,7 +93,7 @@ vdso_install: all: $(notdir $(KBUILD_IMAGE)) -vmlinux.elf vmlinux.efi: vmlinux +vmlinux.elf vmlinux.efi vmlinuz.efi: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(bootvars-y) $(boot)/$@ install: diff --git a/arch/loongarch/boot/.gitignore b/arch/loongarch/boot/.gitignore index 49423ee96ef3..e5dc594dc4b6 100644 --- a/arch/loongarch/boot/.gitignore +++ b/arch/loongarch/boot/.gitignore @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only vmlinux* +vmlinuz* diff --git a/arch/loongarch/boot/Makefile b/arch/loongarch/boot/Makefile index fecf34f50e56..4e1c374c5782 100644 --- a/arch/loongarch/boot/Makefile +++ b/arch/loongarch/boot/Makefile @@ -18,3 +18,9 @@ $(obj)/vmlinux.elf: vmlinux FORCE targets += vmlinux.efi $(obj)/vmlinux.efi: vmlinux FORCE $(call if_changed,objcopy) + +EFI_ZBOOT_PAYLOAD := vmlinux.efi +EFI_ZBOOT_BFD_TARGET := elf64-loongarch +EFI_ZBOOT_MACH_TYPE := LOONGARCH64 + +include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot