diff mbox series

[v5,7/8] riscv: efi: enable generic EFI compressed boot

Message ID 20220910081152.2238369-8-ardb@kernel.org
State Accepted
Commit f55793403c53ffaaaca43948498ed2b8896d9615
Headers show
Series efi: implement generic compressed boot support | expand

Commit Message

Ard Biesheuvel Sept. 10, 2022, 8:11 a.m. UTC
Wire up the generic EFI zboot support for RISC-V.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/riscv/Makefile        | 6 +++++-
 arch/riscv/boot/.gitignore | 1 +
 arch/riscv/boot/Makefile   | 6 ++++++
 3 files changed, 12 insertions(+), 1 deletion(-)

Comments

Conor Dooley Sept. 16, 2022, 7:09 a.m. UTC | #1
On 10/09/2022 09:11, Ard Biesheuvel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Wire up the generic EFI zboot support for RISC-V.
> 
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

As promised:
Tested-by: Conor Dooley <conor.dooley@microchip.com>

> ---
>   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
> --
> 2.35.1
>
diff mbox series

Patch

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