summaryrefslogtreecommitdiff
path: root/arch/loongarch/include/asm/efi.h
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-08-19 13:20:37 +0300
committerArd Biesheuvel <ardb@kernel.org>2022-09-06 12:19:34 +0300
commitead384d956345681e1ddf97890d5e15ded015f07 (patch)
treeaa03bbe0c8e154a3743f28b7eccb281912c20dec /arch/loongarch/include/asm/efi.h
parent568035b01cfb107af8d2e4bd2fb9aea22cf5b868 (diff)
downloadlinux-ead384d956345681e1ddf97890d5e15ded015f07.tar.xz
efi/loongarch: Add efistub booting support
This patch adds efistub booting support, which is the standard UEFI boot protocol for LoongArch to use. We use generic efistub, which means we can pass boot information (i.e., system table, memory map, kernel command line, initrd) via a light FDT and drop a lot of non-standard code. We use a flat mapping to map the efi runtime in the kernel's address space. In efi, VA = PA; in kernel, VA = PA + PAGE_OFFSET. As a result, flat mapping is not identity mapping, SetVirtualAddressMap() is still needed for the efi runtime. Tested-by: Xi Ruoyao <xry111@xry111.site> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> [ardb: change fpic to fpie as suggested by Xi Ruoyao] Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'arch/loongarch/include/asm/efi.h')
-rw-r--r--arch/loongarch/include/asm/efi.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/loongarch/include/asm/efi.h b/arch/loongarch/include/asm/efi.h
index 9d44c6948be1..174567b00ddb 100644
--- a/arch/loongarch/include/asm/efi.h
+++ b/arch/loongarch/include/asm/efi.h
@@ -17,9 +17,16 @@ void efifb_setup_from_dmi(struct screen_info *si, const char *opt);
#define arch_efi_call_virt_teardown()
#define EFI_ALLOC_ALIGN SZ_64K
+#define EFI_RT_VIRTUAL_OFFSET CSR_DMW0_BASE
-struct screen_info *alloc_screen_info(void);
-void free_screen_info(struct screen_info *si);
+static inline struct screen_info *alloc_screen_info(void)
+{
+ return &screen_info;
+}
+
+static inline void free_screen_info(struct screen_info *si)
+{
+}
static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr)
{