From e4f3215be242c86080e0355b36a3d236b26db8fc Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 8 Dec 2014 14:42:29 +0100 Subject: efi: add proper reset hook This allows to actually reset the system from barebox instead of dropping back into the EFI firmware. Signed-off-by: Lucas Stach Signed-off-by: Sascha Hauer --- arch/efi/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/efi/efi/efi.c b/arch/efi/efi/efi.c index 7de8ec82e8..af3fc4366b 100644 --- a/arch/efi/efi/efi.c +++ b/arch/efi/efi/efi.c @@ -248,7 +248,7 @@ console_initcall(efi_console_init); void reset_cpu(unsigned long addr) { - BS->exit(efi_parent_image, EFI_SUCCESS, 0, NULL); + RT->reset_system(EFI_RESET_WARM, EFI_SUCCESS, 0, NULL); while(1); } -- cgit v1.2.3 From 23746e7e027689c22eaafaea27743b8756e7de8c Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 8 Dec 2014 14:42:30 +0100 Subject: efi: move exit to EFI into own command Adds a command to drop back into the calling EFI process. Signed-off-by: Lucas Stach Signed-off-by: Sascha Hauer --- arch/efi/efi/efi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'arch') diff --git a/arch/efi/efi/efi.c b/arch/efi/efi/efi.c index af3fc4366b..c1efe1d8ae 100644 --- a/arch/efi/efi/efi.c +++ b/arch/efi/efi/efi.c @@ -341,3 +341,19 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table) return EFI_SUCCESS; } + +static int do_efiexit(int argc, char *argv[]) +{ + return BS->exit(efi_parent_image, EFI_SUCCESS, 0, NULL); +} + +BAREBOX_CMD_HELP_START(efiexit) +BAREBOX_CMD_HELP_TEXT("Leave barebox and return to the calling EFI process\n") +BAREBOX_CMD_HELP_END + +BAREBOX_CMD_START(efiexit) + .cmd = do_efiexit, + BAREBOX_CMD_DESC("Usage: efiexit") + BAREBOX_CMD_GROUP(CMD_GRP_MISC) + BAREBOX_CMD_HELP(cmd_efiexit_help) +BAREBOX_CMD_END -- cgit v1.2.3