PHAL: refactor startHostNormal procedure
selectBootSeeprom function not working correctly due to
order of calling this function in startHostNormal procedure path.
This function should be called after phal_init.
This refactor help to fix the function invoking order in regular
ipl path. Also added PEL log for any Boot initialisation failure
Tested: verified regular and mpipl boot.
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: I9f6688dfdc6a3d69f4480127cf4b052cf0c99131
diff --git a/procedures/phal/start_host.cpp b/procedures/phal/start_host.cpp
index 37a14ef..db323ca 100644
--- a/procedures/phal/start_host.cpp
+++ b/procedures/phal/start_host.cpp
@@ -6,6 +6,7 @@
#include "attributes_info.H"
#include "extensions/phal/common_utils.hpp"
+#include "extensions/phal/create_pel.hpp"
#include "extensions/phal/phal_error.hpp"
#include "util.hpp"
@@ -178,20 +179,25 @@
{
phal_init();
ipl_set_type(iplType);
+ if (iplType == IPL_TYPE_NORMAL)
+ {
+ // Update SEEPROM side only for NORMAL boot
+ selectBootSeeprom();
+ }
+ setClkNETerminationSite();
}
catch (const std::exception& ex)
{
- log<level::ERR>("Exception raised during init PHAL",
+ log<level::ERR>("Exception raised during ipl initialisation",
entry("EXCEPTION=%s", ex.what()));
+ openpower::pel::createPEL("org.open_power.PHAL.Error.Boot");
openpower::pel::detail::processBootError(false);
- throw std::runtime_error("PHAL initialization failed");
+ throw std::runtime_error("IPL initialization failed");
}
// To clear trace if success
openpower::pel::detail::processBootError(true);
- setClkNETerminationSite();
-
// callback method will be called upon failure which will create the PEL
int rc = ipl_run_major(0);
if (rc > 0)
@@ -217,23 +223,7 @@
*/
void startHostNormal()
{
- // Run select seeprom before poweron
- try
- {
- selectBootSeeprom();
-
- // To clear trace as it is success
- openpower::pel::detail::processBootError(true);
- }
- catch (const std::exception& ex)
- {
- // create PEL in failure
- openpower::pel::detail::processBootError(false);
- log<level::ERR>("SEEPROM selection failed", entry("ERR=%s", ex.what()));
- throw ex;
- }
-
- startHost();
+ startHost(IPL_TYPE_NORMAL);
}
REGISTER_PROCEDURE("startHost", startHostNormal)