All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] boot/grub2: add RISC-V 64bit EFI support
@ 2023-12-23 19:41 Julien Olivain
  2023-12-23 19:41 ` [Buildroot] [PATCH 2/2] configs/qemu_riscv64_virt_efi: new defconfig Julien Olivain
  2023-12-23 21:29 ` [Buildroot] [PATCH v2 1/2] boot/grub2: add RISC-V 64bit EFI support Julien Olivain
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Olivain @ 2023-12-23 19:41 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Julien Olivain, Thomas Petazzoni

Grub can be built as a RISC-V UEFI application since commit [1]. This
commit was first included in grub version 2.04.

This commit enables this support.

[1] https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=f1957dc8a3347278a095bc8f44197662559a8ba3

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 boot/grub2/Config.in | 10 ++++++++++
 boot/grub2/grub2.mk  |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index f05f33ccc7..7c235e96f7 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -4,6 +4,7 @@ config BR2_TARGET_GRUB2_ARCH_SUPPORTS
 	default y if BR2_x86_64
 	default y if BR2_arm
 	default y if BR2_aarch64
+	default y if BR2_RISCV_64
 	depends on BR2_USE_MMU
 
 config BR2_TARGET_GRUB2
@@ -102,6 +103,15 @@ config BR2_TARGET_GRUB2_ARM64_EFI
 	  Aarch64 platform and you want to boot Grub 2 as an EFI
 	  application.
 
+config BR2_TARGET_GRUB2_RISCV64_EFI
+	bool "riscv64-efi"
+	depends on BR2_RISCV_64
+	select BR2_TARGET_GRUB2_HAS_EFI_BOOT
+	help
+	  Select this option if the platform you're targetting is a
+	  64bit RISC-V platform and you want to boot Grub 2 as an EFI
+	  application.
+
 if BR2_TARGET_GRUB2_HAS_LEGACY_BOOT
 
 comment "Options for the x86 legacy BIOS or ARM U-Boot support"
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index b9be826885..679eac5f46 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -93,6 +93,15 @@ GRUB2_BUILTIN_CONFIG_arm64-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
 GRUB2_BUILTIN_MODULES_arm64-efi = $(GRUB2_BUILTIN_MODULES_EFI)
 GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM64_EFI) += arm64-efi
 
+GRUB2_IMAGE_riscv64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootriscv64.efi
+GRUB2_CFG_riscv64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
+GRUB2_PREFIX_riscv64-efi = /EFI/BOOT
+GRUB2_TARGET_riscv64-efi = riscv64
+GRUB2_PLATFORM_riscv64-efi = efi
+GRUB2_BUILTIN_CONFIG_riscv64-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
+GRUB2_BUILTIN_MODULES_riscv64-efi = $(GRUB2_BUILTIN_MODULES_EFI)
+GRUB2_TUPLES-$(BR2_TARGET_GRUB2_RISCV64_EFI) += riscv64-efi
+
 # Grub2 is kind of special: it considers CC, LD and so on to be the
 # tools to build the host programs and uses TARGET_CC, TARGET_CFLAGS,
 # TARGET_CPPFLAGS, TARGET_LDFLAGS to build the bootloader itself.
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-12-29 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-23 19:41 [Buildroot] [PATCH 1/2] boot/grub2: add RISC-V 64bit EFI support Julien Olivain
2023-12-23 19:41 ` [Buildroot] [PATCH 2/2] configs/qemu_riscv64_virt_efi: new defconfig Julien Olivain
2023-12-23 21:29 ` [Buildroot] [PATCH v2 1/2] boot/grub2: add RISC-V 64bit EFI support Julien Olivain
2023-12-23 21:29   ` [Buildroot] [PATCH v2 2/2] configs/qemu_riscv64_virt_efi: new defconfig Julien Olivain
2023-12-24 16:57     ` Yann E. MORIN
2023-12-24 16:56   ` [Buildroot] [PATCH v2 1/2] boot/grub2: add RISC-V 64bit EFI support Yann E. MORIN
2023-12-24 16:58   ` Yann E. MORIN
2023-12-29 15:47     ` Julien Olivain
2023-12-29 20:47       ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.