procedures/phal/start_host: Initialized libpdbg, libekb and libipl
Currently ipl_init is initializing libpdbg and libekb but
as per recent design changes, phal expecting all phal library
initialization should just happen in application rather than
doing via ipl_init. so, same support added in this patch.
ipl_init expecting boot mode explicitly from application so,
setting IPL_AUTOBOOT (continuous ipling) to boot the system.
Signed-off-by: Ramesh Iyyar <rameshi1@in.ibm.com>
Change-Id: I38026082cfa2fb21e042b50ddb7c627956a317be
diff --git a/procedures/phal/start_host.cpp b/procedures/phal/start_host.cpp
index a5e7bea..3899924 100644
--- a/procedures/phal/start_host.cpp
+++ b/procedures/phal/start_host.cpp
@@ -1,5 +1,10 @@
+extern "C" {
+#include <libpdbg.h>
+}
+
#include "phalerror/phal_error.hpp"
+#include <libekb.H>
#include <libipl.H>
#include <phosphor-logging/log.hpp>
@@ -21,12 +26,32 @@
// add callback methods for debug traces and for boot failures
openpower::pel::addBootErrorCallbacks();
- // callback method will be called upon failure which will create the PEL
- if (ipl_init() != 0)
+ if (!pdbg_targets_init(NULL))
+ {
+ log<level::ERR>("pdbg_targets_init failed");
+ openpower::pel::detail::processBootErrorCallback(false);
+ throw std::runtime_error("pdbg target initialization failed");
+ }
+ // To clear trace if success
+ openpower::pel::detail::processBootErrorCallback(true);
+
+ if (libekb_init())
+ {
+ log<level::ERR>("libekb_init failed");
+ openpower::pel::detail::processBootErrorCallback(false);
+ throw std::runtime_error("libekb initialization failed");
+ }
+ // To clear trace if success
+ openpower::pel::detail::processBootErrorCallback(true);
+
+ if (ipl_init(IPL_AUTOBOOT) != 0)
{
log<level::ERR>("ipl_init failed");
+ openpower::pel::detail::processBootErrorCallback(false);
throw std::runtime_error("Boot initialization failed");
}
+ // To clear trace if success
+ openpower::pel::detail::processBootErrorCallback(true);
// callback method will be called upon failure which will create the PEL
int rc = ipl_run_major(0);