From 10bbcd0788bc73ec675eb06e6c84faab5aab4461 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Mon, 17 Feb 2020 12:02:23 +1100 Subject: [PATCH] core/platform: Add an explicit fast-reboot type The OPAL_CEC_REBOOT2 OPAL call allows a specific type of reboot to be requested. We can use this to allow the OS to request a fast-reboot explicitly rather than relying on nvram hacks to change the default behaviour. Signed-off-by: Oliver O'Halloran --- core/platform.c | 4 ++++ include/opal-api.h | 1 + 2 files changed, 5 insertions(+) diff --git a/core/platform.c b/core/platform.c index 97bc7cb6fa1e..99cf5c985399 100644 --- a/core/platform.c +++ b/core/platform.c @@ -116,6 +116,10 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag) opal_cec_reboot(); for (;;); break; + case OPAL_REBOOT_FAST: + prlog(PR_NOTICE, "Reboot: Fast reboot requested by OS\n"); + fast_reboot(); + break; default: prlog(PR_NOTICE, "OPAL: Unsupported reboot request %d\n", reboot_type); return OPAL_UNSUPPORTED; diff --git a/include/opal-api.h b/include/opal-api.h index 5b07dea1321b..e425d79f209a 100644 --- a/include/opal-api.h +++ b/include/opal-api.h @@ -1135,6 +1135,7 @@ enum { OPAL_REBOOT_PLATFORM_ERROR, OPAL_REBOOT_FULL_IPL, OPAL_REBOOT_MPIPL, + OPAL_REBOOT_FAST, }; /* Argument to OPAL_PCI_TCE_KILL */