Skip to content

efi_loader: save global data pointer on RISC-V

Sean Anderson u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 of 3 patches 0 repliesNew

1 of 3 patches is in this archive. The cover letter announces 3.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3riscv: define function set_gd()+0 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] efi_loader: save global data pointer on RISC-V
Quoted 15 lines · Heinrich Schuchardt

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()

Quoted 8 lines
 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

Do we need to save tp as well? It is used by secondary harts to save the hartid for handle_ipi.

--Sean