Add startHostMpReboot support to PHAL based booting
Add support for setting the boot type as MPIPL to skip the
normal reboot and execute memory preserving reboot specific
steps.
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I477a01f2d0d3c3574a3e1335be666703b71713ab
diff --git a/procedures/phal/start_host.cpp b/procedures/phal/start_host.cpp
index 39229f4..33917ea 100644
--- a/procedures/phal/start_host.cpp
+++ b/procedures/phal/start_host.cpp
@@ -117,7 +117,7 @@
* to kick off a boot.
* @return void
*/
-void startHost()
+void startHost(enum ipl_type iplType = IPL_TYPE_NORMAL)
{
// add callback methods for debug traces and for boot failures
openpower::pel::addBootErrorCallbacks();
@@ -146,6 +146,9 @@
openpower::pel::detail::processBootErrorCallback(false);
throw std::runtime_error("Boot initialization failed");
}
+
+ ipl_set_type(iplType);
+
// To clear trace if success
openpower::pel::detail::processBootErrorCallback(true);
@@ -174,7 +177,27 @@
}
}
-REGISTER_PROCEDURE("startHost", startHost);
+/**
+ * @brief Starts the reboot with type memory preserving reboot.
+ * @return void
+ */
+void startHostMpReboot()
+{
+ // set ipl type as mpipl
+ startHost(IPL_TYPE_MPIPL);
+}
+
+/**
+ * @brief Starts the normal boot type.
+ * @return void
+ */
+void startHostNormal()
+{
+ startHost();
+}
+
+REGISTER_PROCEDURE("startHost", startHostNormal);
+REGISTER_PROCEDURE("startHostMpReboot", startHostMpReboot);
} // namespace phal
} // namespace openpower