[Concept,16/18] efi: app: Support proper reset options

Message ID 20250902152158.2285264-17-sjg@u-boot.org
State New
Headers
Series efi: Improve integration of the app with a Shim environment |

Commit Message

Simon Glass Sept. 2, 2025, 3:21 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

At present reset just exits the U-Boot app and returns to the caller.
Add support for proper warm and cold resets, with 'hot' reset preserving
the current behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 lib/efi_client/efi_app.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
  

Patch

diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c
index 6b8b53fbb41..88e04f1084b 100644
--- a/lib/efi_client/efi_app.c
+++ b/lib/efi_client/efi_app.c
@@ -250,7 +250,17 @@  static void efi_exit(void)
 
 static int efi_sysreset_request(struct udevice *dev, enum sysreset_t type)
 {
-	efi_exit();
+	struct efi_priv *priv = efi_get_priv();
+
+	switch (type) {
+	case SYSRESET_WARM:
+		priv->run->reset_system(EFI_RESET_WARM, EFI_SUCCESS, 0, NULL);
+		break;
+	case SYSRESET_HOT:
+	default:
+		efi_exit();
+		break;
+	}
 
 	return -EINPROGRESS;
 }