summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/efi.h
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-09-17 15:37:15 -0700
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-10-02 14:31:28 -0700
commitb91540d52a08b65eb6a2b09132e1bd54fa82754c (patch)
tree4396a594b47ee9036c88bfa5ec740a99005435a1 /arch/riscv/include/asm/efi.h
parentd7071743db31b4f6898b1c742e4b451bb4bc4b02 (diff)
RISC-V: Add EFI runtime services
This patch adds EFI runtime service support for RISC-V. Signed-off-by: Atish Patra <atish.patra@wdc.com> [ardb: - Remove the page check] Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/efi.h')
-rw-r--r--arch/riscv/include/asm/efi.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/efi.h b/arch/riscv/include/asm/efi.h
index bf6a40e20a8e..7542282f1141 100644
--- a/arch/riscv/include/asm/efi.h
+++ b/arch/riscv/include/asm/efi.h
@@ -5,11 +5,28 @@
#ifndef _ASM_EFI_H
#define _ASM_EFI_H
+#include <asm/csr.h>
#include <asm/io.h>
#include <asm/mmu_context.h>
#include <asm/ptrace.h>
#include <asm/tlbflush.h>
+#ifdef CONFIG_EFI
+extern void efi_init(void);
+#else
+#define efi_init()
+#endif
+
+int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
+int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
+
+#define arch_efi_call_virt_setup() efi_virtmap_load()
+#define arch_efi_call_virt_teardown() efi_virtmap_unload()
+
+#define arch_efi_call_virt(p, f, args...) p->f(args)
+
+#define ARCH_EFI_IRQ_FLAGS_MASK (SR_IE | SR_SPIE)
+
/* on RISC-V, the FDT may be located anywhere in system RAM */
static inline unsigned long efi_get_max_fdt_addr(unsigned long image_addr)
{
@@ -32,4 +49,7 @@ static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
{
}
+void efi_virtmap_load(void);
+void efi_virtmap_unload(void);
+
#endif /* _ASM_EFI_H */