[PATCH 0/3] efi_loader: save global data pointer on RISC-V

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Sep 10 13:00:45 CEST 2020


On the RISC-V platform register gp (x3) is used as global data pointer in
U-Boot. When executing a UEFI binary we cannot assume that the payload
will restore the register before calling the UEFI API. So U-Boot must
take care of saving the register value before invoking the payload and
restoring it whenever the API is called or the payload returns.

On some system like the Sipeed Maix we do not have a UEFI runtime reset
implementation. Hence we call do_reset() in the UEFI selftest. Here too we
need to restore the global data pointer before invoking the U-Boot API.

Heinrich Schuchardt (3):
  riscv: define function set_gd()
  efi_loader: save global data pointer on RISC-V
  efi_selftest: restore gd before do_reset()

 arch/riscv/include/asm/global_data.h |  9 +++++
 lib/efi_loader/efi_boottime.c        | 54 ++++++++++++++--------------
 lib/efi_selftest/efi_selftest.c      |  6 ++--
 3 files changed, 40 insertions(+), 29 deletions(-)

--
2.28.0



More information about the U-Boot mailing list