riscv: efi: enable generic EFI compressed boot
authorArd Biesheuvel <ardb@kernel.org>
Mon, 2 May 2022 15:40:34 +0000 (17:40 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 20 Sep 2022 07:50:30 +0000 (09:50 +0200)
Wire up the generic EFI zboot support for RISC-V.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
arch/riscv/Makefile
arch/riscv/boot/.gitignore
arch/riscv/boot/Makefile

index 3fa8ef3..d63295e 100644 (file)
@@ -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))
 
index 0cea9f7..e1bc507 100644 (file)
@@ -4,4 +4,5 @@ Image.*
 loader
 loader.lds
 loader.bin
+vmlinuz*
 xipImage
index becd062..d1a49ad 100644 (file)
@@ -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