Commit e7ac009b0063b8e9bafa5c39cacab4948ae8238d
1 parent
2337741fb4
Exists in
smarc_8mq_lf_v2020.04
and in
9 other branches
efi_loader: move efi_save_gd() call to board_r.c
The first functions of the UEFI sub-system are invoked before reaching the U-Boot shell, e.g. efi_set_bootdev(), efi_dp_from_name(), efi_dp_from_file(). We should be able to print out device paths for debugging purposes here. When printing device paths via printf("%pD\n", dp) this invokes functions defined as EFIAPI. So efi_save_gd() must be called beforehand. So let's move the efi_save_gd() call to function initr_reloc_global_data(() in board_r.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Showing 3 changed files with 7 additions and 10 deletions Side-by-side Diff
common/board_r.c
... | ... | @@ -154,6 +154,13 @@ |
154 | 154 | gd->fdt_blob += gd->reloc_off; |
155 | 155 | #endif |
156 | 156 | #ifdef CONFIG_EFI_LOADER |
157 | + /* | |
158 | + * On the ARM architecture gd is mapped to a fixed register (r9 or x18). | |
159 | + * As this register may be overwritten by an EFI payload we save it here | |
160 | + * and restore it on every callback entered. | |
161 | + */ | |
162 | + efi_save_gd(); | |
163 | + | |
157 | 164 | efi_runtime_relocate(gd->relocaddr, NULL); |
158 | 165 | #endif |
159 | 166 |
lib/efi_driver/efi_uclass.c
... | ... | @@ -300,9 +300,6 @@ |
300 | 300 | struct driver *drv; |
301 | 301 | efi_status_t ret = EFI_SUCCESS; |
302 | 302 | |
303 | - /* Save 'gd' pointer */ | |
304 | - efi_save_gd(); | |
305 | - | |
306 | 303 | debug("EFI: Initializing EFI driver framework\n"); |
307 | 304 | for (drv = ll_entry_start(struct driver, driver); |
308 | 305 | drv < ll_entry_end(struct driver, driver); ++drv) { |
lib/efi_loader/efi_setup.c
... | ... | @@ -21,13 +21,6 @@ |
21 | 21 | efi_status_t ret = EFI_SUCCESS; |
22 | 22 | |
23 | 23 | /* |
24 | - * On the ARM architecture gd is mapped to a fixed register (r9 or x18). | |
25 | - * As this register may be overwritten by an EFI payload we save it here | |
26 | - * and restore it on every callback entered. | |
27 | - */ | |
28 | - efi_save_gd(); | |
29 | - | |
30 | - /* | |
31 | 24 | * Variable PlatformLang defines the language that the machine has been |
32 | 25 | * configured for. |
33 | 26 | */ |