summaryrefslogtreecommitdiffstats
path: root/src/include/usr/sbeio
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2017-10-12 14:33:16 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-12-08 09:55:12 -0500
commit351f3287bba4fbf53d3d9d0701c1c4f0023d8cfe (patch)
tree23da1b55927101ff6680530d76bfec9ed37c6f4c /src/include/usr/sbeio
parentb801fd1a776fe7198359f9c2cb28c227d98a7f52 (diff)
downloadtalos-hostboot-351f3287bba4fbf53d3d9d0701c1c4f0023d8cfe.tar.gz
talos-hostboot-351f3287bba4fbf53d3d9d0701c1c4f0023d8cfe.zip
Create base class structure for SbeRetryHandler
This commit restructures the sbe_extract_rc_handler code into its own class. Change-Id: Ib6ecb1a67353b060a6578b13da951b276bc93ca7 RTC:180961 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48511 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/sbeio')
-rw-r--r--src/include/usr/sbeio/sbe_extract_rc_handler.H157
-rw-r--r--src/include/usr/sbeio/sbe_retry_handler.H205
2 files changed, 205 insertions, 157 deletions
diff --git a/src/include/usr/sbeio/sbe_extract_rc_handler.H b/src/include/usr/sbeio/sbe_extract_rc_handler.H
deleted file mode 100644
index db22267f5..000000000
--- a/src/include/usr/sbeio/sbe_extract_rc_handler.H
+++ /dev/null
@@ -1,157 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/include/usr/sbeio/sbe_extract_rc_handler.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef __SBE_EXTRACT_RC_HANDLER_H
-#define __SBE_EXTRACT_RC_HANDLER_H
-
-#include <isteps/hwpisteperror.H>
-#include <p9_extract_sbe_rc.H>
-#include <p9_get_sbe_msg_register.H>
-
-enum SBE_REG_RETURN
-{
- FUNCTION_ERROR = 0, // Error returned from HWP
- SBE_AT_RUNTIME = 1, // SBE is at runtime and booted
- SBE_FAILED_TO_BOOT = 2, // SBE has failed to boot
-};
-
-/**
- * @brief This is the switch case that handles the different actions needed for
- * each output of the proc_extract_sbe_rc HWP.
- *
- * @param[in] i_target - current proc target
- * @param[in] i_current_error - The most recent return value from HWP
- *
- * @return - NULL
- */
-void proc_extract_sbe_handler( TARGETING::Target * i_target,
- uint8_t i_current_error);
-
-/**
- * @brief This function handles the call to the p9_get_sbe_msg_handler.
- * It determines what state the SBE is in and returns an enum
- * that describes the future actions needed.
- *
- * @param[in] i_target - current proc target
- *
- * @return - SBE_REG_RETURN enum value describing the action needed next
- */
-SBE_REG_RETURN check_sbe_reg(TARGETING::Target * i_target);
-
-/**
- * @brief This function handles the SBE register value and the actions that
- * go along with it. The state machine is handled separately, but
- * every other instance of check_sbe_reg should be accompanied
- * by this handler function.
- *
- * @param[in] i_target - current proc target
- * @param[in] i_sbe_reg - returned enum value from check_sbe_reg
- * @param[in] i_current_sbe_error - current sbe conditions value
- * @param[in] i_fromStateMachine - if we are coming from state machine
- * functions or not.
- *
- * @return - sbe returned action
- */
-P9_EXTRACT_SBE_RC::RETURN_ACTION handle_sbe_reg_value(
- TARGETING::Target * i_target,
- SBE_REG_RETURN i_sbe_reg,
- P9_EXTRACT_SBE_RC::RETURN_ACTION i_current_sbe_error,
- bool i_fromStateMachine);
-
-/**
- * @brief This function handles the HWP calls and error logs
- * associated with them
- *
- * @param[in] i_target - current proc target
- * @param[in] i_fromStateMachine - true: from state machine, false: not
- * @param[in] i_current_condition - current sbe conditions value
- *
- * @return - sbe returned action
- *
- */
-P9_EXTRACT_SBE_RC::RETURN_ACTION handle_sbe_restart(
- TARGETING::Target * i_target,
- bool i_fromStateMachine,
- P9_EXTRACT_SBE_RC::RETURN_ACTION i_current_condition);
-
-/**
- * @brief This function handles the SBE timeout and loops
- * required to start it.
- *
- * @param[out] o_sbeReg - pointer to the sbe register
- * @param[in] i_target - current proc target
- * @param[out] o_returnAction - sbe returned action
- *
- * @return - error, NULL if no error
- */
-
-errlHndl_t sbe_timeout_handler(sbeMsgReg_t * o_sbeReg,
- TARGETING::Target * i_target,
- SBE_REG_RETURN * o_returnAction);
-
-/**
- * @brief This is the switch case that identifies the action needed for the RC
- * value in an SBE FFDC package.
- *
- * @param[in] i_rc - RC value from SBE FFDC package
- *
- * @return - pass(0) or specific returned SBE action
- */
-P9_EXTRACT_SBE_RC::RETURN_ACTION action_for_ffdc_rc( uint32_t i_rc);
-
-/**
- * @brief This function handles getting the SBE FFDC.
- *
- * @param[in] i_target - current proc target
- *
- * @return - bool for flow control on return to caller, if false, caller should
- * go on with the processing flow, if true, caller should interrupt
- * the processing flow and get out of loop or current iteration
- */
-
-bool sbe_get_ffdc_handler(TARGETING::Target * i_target);
-
-/**
- * @brief This function handles the SBE failed to boot error.
- *
- * @param[in] i_target - current proc target
- * @param[in] i_sbeReg - sbe register
- *
- * @return - NULL
- */
-
-void sbe_boot_fail_handler(TARGETING::Target * i_target,
- sbeMsgReg_t i_sbeReg);
-
-/**
- * @brief This function deals with the mask needed to switch
- * boot side on the SBE for a given proc
- *
- * @param[in] i_target - current proc target
- *
- * @return - error, NULL if no error
- */
-errlHndl_t switch_sbe_sides(TARGETING::Target * i_target);
-
-#endif
diff --git a/src/include/usr/sbeio/sbe_retry_handler.H b/src/include/usr/sbeio/sbe_retry_handler.H
new file mode 100644
index 000000000..3cbfb654c
--- /dev/null
+++ b/src/include/usr/sbeio/sbe_retry_handler.H
@@ -0,0 +1,205 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/sbeio/sbe_retry_handler.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __SBE_EXTRACT_DD_H
+#define __SBE_EXTRACT_DD_H
+
+#include <isteps/hwpisteperror.H>
+#include <p9_extract_sbe_rc.H>
+#include <p9_get_sbe_msg_register.H>
+
+namespace SBEIO
+{
+
+class SbeRetryHandler
+{
+ public:
+
+ /**
+ * @brief Get the instance of this class
+ *
+ * @return the instance of SbeRetryHandler
+ */
+ NEVER_INLINE static SbeRetryHandler& getInstance();
+
+ /**
+ * @brief Constructor
+ */
+ SbeRetryHandler();
+
+ /**
+ * @brief Destructor
+ */
+ ~SbeRetryHandler();
+
+ enum SBE_REG_RETURN
+ {
+ HWP_ERROR = 0, // Error returned from HWP
+ SBE_AT_RUNTIME = 1, // SBE is at runtime and booted
+ SBE_FAILED_TO_BOOT = 2, // SBE has failed to boot
+ };
+
+ /**
+ * @brief This function handles the SBE timeout and loops
+ * required to start it.
+ *
+ * @param[out] o_sbeReg - pointer to the sbe register
+ * @param[in] i_target - current proc target
+ * @param[out] o_returnAction - sbe returned action
+ *
+ * @return - error, NULL if no error
+ */
+
+ errlHndl_t sbe_timeout_handler(sbeMsgReg_t * o_sbeReg,
+ TARGETING::Target * i_target,
+ SBE_REG_RETURN * o_returnAction);
+
+ /**
+ * @brief This function handles getting the SBE FFDC.
+ *
+ * @param[in] i_target - current proc target
+ *
+ * @return - bool for flow control on return to caller, if false,
+ * caller should go on with the processing flow, if true,
+ * caller should interrupt the processing flow and get out
+ * of loop or current iteration
+ */
+
+ bool sbe_get_ffdc_handler(TARGETING::Target * i_target);
+
+ /**
+ * @brief This function handles the SBE failed to boot error.
+ *
+ * @param[in] i_target - current proc target
+ * @param[in] i_sbeReg - sbe register
+ *
+ * @return - NULL
+ */
+
+ void sbe_boot_fail_handler(TARGETING::Target * i_target,
+ sbeMsgReg_t i_sbeReg);
+
+ /*
+ * @brief This function handles the HWP calls and error logs
+ * associated with them
+ *
+ * @param[in] i_target - current proc target
+ * @param[in] i_fromStateMachine - true: from state machine, false: not
+ * @param[in] i_current_condition - current sbe conditions value
+ *
+ * @return - sbe returned action
+ *
+ */
+ P9_EXTRACT_SBE_RC::RETURN_ACTION handle_sbe_restart(
+ TARGETING::Target * i_target,
+ bool i_fromStateMachine,
+ P9_EXTRACT_SBE_RC::RETURN_ACTION i_current_condition);
+
+ /**
+ * @brief This function deals with the mask needed to switch
+ * boot side on the SBE for a given proc
+ *
+ * @param[in] i_target - current proc target
+ *
+ * @return - error, NULL if no error
+ */
+ errlHndl_t switch_sbe_sides(TARGETING::Target * i_target);
+
+ /**
+ * @brief This is the switch case that handles the different actions
+ * needed for each output of the proc_extract_sbe_rc HWP.
+ *
+ * @param[in] i_target - current proc target
+ * @param[in] i_current_error - The most recent return value from HWP
+ *
+ * @return - NULL
+ */
+ void proc_extract_sbe_handler( TARGETING::Target * i_target,
+ uint8_t i_current_error);
+
+ private:
+
+ /**
+ * @brief This function handles the SBE register value and the actions
+ * that go along with it. The state machine is handled
+ * separately, but every other instance of check_sbe_reg should
+ * be accompanied by this handler function.
+ *
+ * @param[in] i_target - current proc target
+ * @param[in] i_sbe_reg - enum value from check_sbe_reg
+ * @param[in] i_current_sbe_error - current sbe conditions value
+ * @param[in] i_fromStateMachine - if we are coming from state machine
+ * functions or not.
+ *
+ * @return - sbe returned action
+ */
+ P9_EXTRACT_SBE_RC::RETURN_ACTION handle_sbe_reg_value(
+ TARGETING::Target * i_target,
+ SBE_REG_RETURN i_sbe_reg,
+ P9_EXTRACT_SBE_RC::RETURN_ACTION i_current_sbe_error,
+ bool i_fromStateMachine);
+
+ /**
+ * @brief This is the switch case that identifies the action needed
+ * for the RC value in an SBE FFDC package.
+ *
+ * @param[in] i_rc - RC value from SBE FFDC package
+ *
+ * @return - pass(0) or specific returned SBE action
+ */
+ P9_EXTRACT_SBE_RC::RETURN_ACTION action_for_ffdc_rc( uint32_t i_rc);
+
+ /**
+ * @brief This function handles the call to the p9_get_sbe_msg_handler.
+ * It determines what state the SBE is in and returns an enum
+ * that describes the future actions needed.
+ *
+ * @param[in] i_target - current proc target
+ *
+ * @return - SBE_REG_RETURN enum value describing the action needed
+ */
+ SBE_REG_RETURN check_sbe_reg(TARGETING::Target * i_target);
+
+ /************************** Class Elements **************************/
+
+ /*
+ * @brief True if we successfully restarted the SBE
+ */
+ bool iv_sbeRestarted;
+
+ /*
+ * @brief True if we switched to the other side of the SBE
+ */
+ bool iv_sbeOtherSide;
+
+ /*
+ * @brief True if we logged an error during the SBE restart process
+ */
+ bool iv_sbeErrorLogged;
+
+
+}; // End of class SbeRetryHandler
+
+} // End of namespace SBEIO
+#endif
OpenPOWER on IntegriCloud