.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Linaro Ltd <ard.biesheuvel@linaro.org> |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 as |
---|
6 | | - * published by the Free Software Foundation. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #ifndef __ASM_ARM_EFI_H |
---|
.. | .. |
---|
16 | 13 | #include <asm/highmem.h> |
---|
17 | 14 | #include <asm/mach/map.h> |
---|
18 | 15 | #include <asm/mmu_context.h> |
---|
19 | | -#include <asm/pgtable.h> |
---|
20 | 16 | #include <asm/ptrace.h> |
---|
21 | 17 | |
---|
22 | 18 | #ifdef CONFIG_EFI |
---|
.. | .. |
---|
53 | 49 | |
---|
54 | 50 | /* arch specific definitions used by the stub code */ |
---|
55 | 51 | |
---|
56 | | -#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__) |
---|
57 | | -#define __efi_call_early(f, ...) f(__VA_ARGS__) |
---|
58 | | -#define efi_call_runtime(f, ...) sys_table_arg->runtime->f(__VA_ARGS__) |
---|
59 | | -#define efi_is_64bit() (false) |
---|
60 | | - |
---|
61 | | -#define efi_table_attr(table, attr, instance) \ |
---|
62 | | - ((table##_t *)instance)->attr |
---|
63 | | - |
---|
64 | | -#define efi_call_proto(protocol, f, instance, ...) \ |
---|
65 | | - ((protocol##_t *)instance)->f(instance, ##__VA_ARGS__) |
---|
66 | | - |
---|
67 | | -struct screen_info *alloc_screen_info(efi_system_table_t *sys_table_arg); |
---|
68 | | -void free_screen_info(efi_system_table_t *sys_table, struct screen_info *si); |
---|
| 52 | +struct screen_info *alloc_screen_info(void); |
---|
| 53 | +void free_screen_info(struct screen_info *si); |
---|
69 | 54 | |
---|
70 | 55 | static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt) |
---|
71 | 56 | { |
---|
.. | .. |
---|
81 | 66 | #define MAX_UNCOMP_KERNEL_SIZE SZ_32M |
---|
82 | 67 | |
---|
83 | 68 | /* |
---|
84 | | - * The kernel zImage should preferably be located between 32 MB and 128 MB |
---|
85 | | - * from the base of DRAM. The min address leaves space for a maximal size |
---|
86 | | - * uncompressed image, and the max address is due to how the zImage decompressor |
---|
87 | | - * picks a destination address. |
---|
| 69 | + * phys-to-virt patching requires that the physical to virtual offset fits |
---|
| 70 | + * into the immediate field of an add/sub instruction, which comes down to the |
---|
| 71 | + * 24 least significant bits being zero, and so the offset should be a multiple |
---|
| 72 | + * of 16 MB. Since PAGE_OFFSET itself is a multiple of 16 MB, the physical |
---|
| 73 | + * base should be aligned to 16 MB as well. |
---|
88 | 74 | */ |
---|
89 | | -#define ZIMAGE_OFFSET_LIMIT SZ_128M |
---|
90 | | -#define MIN_ZIMAGE_OFFSET MAX_UNCOMP_KERNEL_SIZE |
---|
| 75 | +#define EFI_PHYS_ALIGN SZ_16M |
---|
91 | 76 | |
---|
92 | | -/* on ARM, the FDT should be located in the first 128 MB of RAM */ |
---|
93 | | -static inline unsigned long efi_get_max_fdt_addr(unsigned long dram_base) |
---|
| 77 | +/* on ARM, the FDT should be located in a lowmem region */ |
---|
| 78 | +static inline unsigned long efi_get_max_fdt_addr(unsigned long image_addr) |
---|
94 | 79 | { |
---|
95 | | - return dram_base + ZIMAGE_OFFSET_LIMIT; |
---|
| 80 | + return round_down(image_addr, EFI_PHYS_ALIGN) + SZ_512M; |
---|
96 | 81 | } |
---|
97 | 82 | |
---|
98 | 83 | /* on ARM, the initrd should be loaded in a lowmem region */ |
---|
99 | | -static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base, |
---|
100 | | - unsigned long image_addr) |
---|
| 84 | +static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr) |
---|
101 | 85 | { |
---|
102 | | - return dram_base + SZ_512M; |
---|
| 86 | + return round_down(image_addr, EFI_PHYS_ALIGN) + SZ_512M; |
---|
103 | 87 | } |
---|
104 | 88 | |
---|
| 89 | +struct efi_arm_entry_state { |
---|
| 90 | + u32 cpsr_before_ebs; |
---|
| 91 | + u32 sctlr_before_ebs; |
---|
| 92 | + u32 cpsr_after_ebs; |
---|
| 93 | + u32 sctlr_after_ebs; |
---|
| 94 | +}; |
---|
| 95 | + |
---|
105 | 96 | #endif /* _ASM_ARM_EFI_H */ |
---|