]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - arch/arm64/include/asm/efi.h
genirq/msi: Drop artificial PCI dependency
[mirror_ubuntu-zesty-kernel.git] / arch / arm64 / include / asm / efi.h
CommitLineData
f84d0275
MS
1#ifndef _ASM_EFI_H
2#define _ASM_EFI_H
3
4#include <asm/io.h>
f7d92489 5#include <asm/mmu_context.h>
e15dd494 6#include <asm/neon.h>
ee6cab5d 7#include <asm/ptrace.h>
f7d92489 8#include <asm/tlbflush.h>
f84d0275
MS
9
10#ifdef CONFIG_EFI
11extern void efi_init(void);
f84d0275
MS
12#else
13#define efi_init()
f84d0275
MS
14#endif
15
f7d92489 16int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
bd264d04 17int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
789957ef 18
489f80f7 19#define arch_efi_call_virt_setup() \
e15dd494 20({ \
e15dd494 21 kernel_neon_begin(); \
f3cdfd23 22 efi_virtmap_load(); \
e15dd494
AB
23})
24
80e75596 25#define arch_efi_call_virt(p, f, args...) \
e15dd494 26({ \
f3cdfd23 27 efi_##f##_t *__f; \
80e75596 28 __f = p->f; \
489f80f7
MR
29 __f(args); \
30})
31
32#define arch_efi_call_virt_teardown() \
33({ \
f3cdfd23 34 efi_virtmap_unload(); \
e15dd494
AB
35 kernel_neon_end(); \
36})
37
ee6cab5d
MR
38#define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT)
39
a13b0077
AB
40/* arch specific definitions used by the stub code */
41
42/*
43 * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from
44 * start of kernel and may not cross a 2MiB boundary. We set alignment to
45 * 2MiB so we know it won't cross a 2MiB boundary.
46 */
47#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */
48#define MAX_FDT_OFFSET SZ_512M
49
fc372064
AB
50#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)
51#define __efi_call_early(f, ...) f(__VA_ARGS__)
52#define efi_is_64bit() (true)
a13b0077 53
57fdb89a
AB
54#define alloc_screen_info(x...) &screen_info
55#define free_screen_info(x...)
56
9822504c
AB
57static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
58{
59}
60
1bd0abb0
AB
61#define EFI_ALLOC_ALIGN SZ_64K
62
f3cdfd23 63/*
60305db9 64 * On ARM systems, virtually remapped UEFI runtime services are set up in two
f3cdfd23
AB
65 * distinct stages:
66 * - The stub retrieves the final version of the memory map from UEFI, populates
67 * the virt_addr fields and calls the SetVirtualAddressMap() [SVAM] runtime
68 * service to communicate the new mapping to the firmware (Note that the new
69 * mapping is not live at this time)
60305db9
AB
70 * - During an early initcall(), the EFI system table is permanently remapped
71 * and the virtual remapping of the UEFI Runtime Services regions is loaded
72 * into a private set of page tables. If this all succeeds, the Runtime
73 * Services are enabled and the EFI_RUNTIME_SERVICES bit set.
f3cdfd23 74 */
f3cdfd23 75
f7d92489
AB
76static inline void efi_set_pgd(struct mm_struct *mm)
77{
78 switch_mm(NULL, mm, NULL);
79}
80
f3cdfd23
AB
81void efi_virtmap_load(void);
82void efi_virtmap_unload(void);
83
f84d0275 84#endif /* _ASM_EFI_H */