From: Heinrich Schuchardt Date: Wed, 2 Dec 2020 15:22:11 +0000 (+0100) Subject: sandbox: implement runtime system reset X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=9c54729c77c4664474c43b53e545f919e2504e8c;p=u-boot.git sandbox: implement runtime system reset Implement a reset function that we can call after ExitBootServices(), when all driver model devices are gone. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index f6c98545e0..fe494aef75 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -406,6 +407,15 @@ void state_show(struct sandbox_state *state) printf("\n"); } +void __efi_runtime EFIAPI efi_reset_system( + enum efi_reset_type reset_type, + efi_status_t reset_status, + unsigned long data_size, void *reset_data) +{ + os_fd_restore(); + os_relaunch(os_argv); +} + void sandbox_reset(void) { /* Do this here while it still has an effect */ diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 8746e10032..073d90c802 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -233,7 +233,8 @@ config EFI_HAVE_RUNTIME_RESET # bool "Reset runtime service is available" bool default y - depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || SYSRESET_X86 + depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET || \ + SANDBOX || SYSRESET_X86 config EFI_GRUB_ARM32_WORKAROUND bool "Workaround for GRUB on 32bit ARM"