From c4a4b8552f80c1ce8b0e70fcfae58c74091fbb63 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Wed, 18 Jun 2025 19:20:31 +0100 Subject: [PATCH] boot/grub2: Introduce loongarch64-efi target loongarch64-efi target presents in GRUB can be utilised by any EFI compatible LoongArch64 machine to boot kernel. Signed-off-by: Jiaxun Yang Reviewed-by: Romain Naour Signed-off-by: Julien Olivain --- 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 ecee9ef74c..3a50ec0ad7 100644 --- a/boot/grub2/Config.in +++ b/boot/grub2/Config.in @@ -5,6 +5,7 @@ config BR2_TARGET_GRUB2_ARCH_SUPPORTS default y if BR2_arm default y if BR2_aarch64 default y if BR2_RISCV_64 + default y if BR2_loongarch64 depends on BR2_USE_MMU menuconfig BR2_TARGET_GRUB2 @@ -112,6 +113,15 @@ config BR2_TARGET_GRUB2_RISCV64_EFI 64bit RISC-V platform and you want to boot Grub 2 as an EFI application. +config BR2_TARGET_GRUB2_LOONGARCH64_EFI + bool "loongarch64-efi" + depends on BR2_loongarch64 + select BR2_TARGET_GRUB2_HAS_EFI_BOOT + help + Select this option if the platform you're targetting is a + 64bit LoongArch 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 22d609c004..4562e57a4f 100644 --- a/boot/grub2/grub2.mk +++ b/boot/grub2/grub2.mk @@ -102,6 +102,15 @@ 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_IMAGE_loongarch64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootloongarch64.efi +GRUB2_CFG_loongarch64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg +GRUB2_PREFIX_loongarch64-efi = /EFI/BOOT +GRUB2_TARGET_loongarch64-efi = loongarch64 +GRUB2_PLATFORM_loongarch64-efi = efi +GRUB2_BUILTIN_CONFIG_loongarch64-efi = $(GRUB2_BUILTIN_CONFIG_EFI) +GRUB2_BUILTIN_MODULES_loongarch64-efi = $(GRUB2_BUILTIN_MODULES_EFI) +GRUB2_TUPLES-$(BR2_TARGET_GRUB2_LOONGARCH64_EFI) += loongarch64-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.