aboutsummaryrefslogtreecommitdiff
path: root/common/board_r.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt2019-04-10 00:32:07 +0200
committerHeinrich Schuchardt2019-04-12 22:00:42 +0200
commite7ac009b0063b8e9bafa5c39cacab4948ae8238d (patch)
treea18f4661bcd7a4329b9494a64977d53111f9d343 /common/board_r.c
parent2337741fb4379754340149f2d4fdaf8071274826 (diff)
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>
Diffstat (limited to 'common/board_r.c')
-rw-r--r--common/board_r.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/board_r.c b/common/board_r.c
index 472987d5d52..1ad44bbe3f7 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -154,6 +154,13 @@ static int initr_reloc_global_data(void)
gd->fdt_blob += gd->reloc_off;
#endif
#ifdef CONFIG_EFI_LOADER
+ /*
+ * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
+ * As this register may be overwritten by an EFI payload we save it here
+ * and restore it on every callback entered.
+ */
+ efi_save_gd();
+
efi_runtime_relocate(gd->relocaddr, NULL);
#endif