summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2018-02-27 23:51:45 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-03-22 10:00:57 -0400
commit3d7aee811e82959c8f250ce8190ffb739280f6ee (patch)
tree6ad3e9e46252d8709fceee7076e3977dc8be4657
parent3f639460a8f1b85cdc22539675b8e2e6bae4981e (diff)
downloadtalos-hostboot-3d7aee811e82959c8f250ce8190ffb739280f6ee.tar.gz
talos-hostboot-3d7aee811e82959c8f250ce8190ffb739280f6ee.zip
Inform OPAL of the state of the SBE after an attempt to restart
Inform OPAL of the state of the SBE after an attempt to restart, either it is disabled or enabled after retry, along with the processor ID of the SBE. Change-Id: I66a58e866c602c53f41f7cdfbd798f613d3b4dab RTC:180245 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54813 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/runtime/interface.h9
-rw-r--r--src/include/usr/sbeio/runtime/sbeio_vital_attn.H57
-rw-r--r--src/include/usr/sbeio/sbeioreasoncodes.H2
-rw-r--r--src/usr/sbeio/common/sbe_attn.C28
-rw-r--r--src/usr/sbeio/runtime/makefile1
-rw-r--r--src/usr/sbeio/runtime/sbeio_vital_attn.C97
-rw-r--r--src/usr/util/runtime/rt_fwreq_helper.C58
7 files changed, 247 insertions, 5 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index d7ad1beba..823f44eda 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -537,6 +537,7 @@ typedef struct hostInterfaces
HBRT_FW_MSG_TYPE_ERROR_LOG = 5,
HBRT_FW_MSG_HBRT_FSP_RESP = 6,
HBRT_FW_MSG_TYPE_I2C_LOCK = 7,
+ HBRT_FW_MSG_TYPE_SBE_STATE = 8,
};
struct hbrt_fw_msg // define struct hbrt_fw_msg
@@ -594,6 +595,14 @@ typedef struct hostInterfaces
} __attribute__ ((packed)) req_i2c_lock;
// This struct is sent from HBRT with
+ // io_type set to HBRT_FW_MSG_TYPE_SBE_STATE
+ struct
+ {
+ uint64_t i_procId; // processor ID of the SBE that is disabled/enabled
+ uint64_t i_state; // state of the SBE; 0 = disabled, 1 = enabled
+ } __attribute__ ((packed)) sbe_state;
+
+ // This struct is sent from HBRT with
// io_type set to HBRT_FW_MSG_HBRT_FSP_REQ or
// HBRT_FW_MSG_HBRT_FSP_RESP
// This struct sends/receives an MBox message to the FSP
diff --git a/src/include/usr/sbeio/runtime/sbeio_vital_attn.H b/src/include/usr/sbeio/runtime/sbeio_vital_attn.H
new file mode 100644
index 000000000..084e16ee4
--- /dev/null
+++ b/src/include/usr/sbeio/runtime/sbeio_vital_attn.H
@@ -0,0 +1,57 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/sbeio/runtime/sbeio_vital_attn.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] 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_MSG_SBEIO_VITAL_ATTN_H
+#define __SBE_MSG_SBEIO_VITAL_ATTN_H
+
+#include <errl/errlentry.H> // errlHndl_t
+#include <targeting/common/target.H> // TARGETING::TargetHandle_t
+
+namespace RT_SBEIO
+{
+ /**
+ * State of the SBE
+ */
+ enum SBE_STATE
+ {
+ SBE_DISABLED = 0x0000000000000000, // SBE restart failed, SBE disabled
+ SBE_ENABLED = 0x0000000000000001, // SBE restart successful, SBE enabled
+ };
+
+ /**
+ * @brief Inform OPAL the state of the SBE
+ *
+ * @details Inform OPAL the state of the SBE after trying a restart
+ *
+ * @param[in] i_procTarg HB processor target of the disabled/enabled SBE
+ * @param[in] i_sbeState state of the SBE, 0 = disabled, 1 = enabled
+ *
+ * @return nullptr upon success, pointer to ErrlEntry if an error occurred.
+ */
+ errlHndl_t vital_attn_inform_opal(TARGETING::TargetHandle_t i_procTarg,
+ SBE_STATE i_sbeState);
+
+} // end namespace RT_SBEIO
+
+#endif
diff --git a/src/include/usr/sbeio/sbeioreasoncodes.H b/src/include/usr/sbeio/sbeioreasoncodes.H
index cd4d97b4c..2bd07d553 100644
--- a/src/include/usr/sbeio/sbeioreasoncodes.H
+++ b/src/include/usr/sbeio/sbeioreasoncodes.H
@@ -56,6 +56,7 @@ enum sbeioModuleId
SBEIO_HANDLE_SBE_REG_VALUE = 0x0B,
SBEIO_GET_FFDC_HANDLER = 0x0C,
SBEIO_GET_SBE_RC = 0x0D,
+ SBEIO_RUNTIME_HANDLE_VITAL_ATTN = 0x0E,
};
/**
@@ -108,6 +109,7 @@ enum sbeioReasonCode
SBEIO_RT_NO_INTERFACE_POINTER = SBEIO_COMP_ID | 0x3A,
SBEIO_RT_NO_INTERFACE_FUNCTION = SBEIO_COMP_ID | 0x3B,
SBEIO_RT_NO_APPLY_ATTR_FUNCTION = SBEIO_COMP_ID | 0x3C,
+ SBEIO_RT_NULL_FIRMWARE_REQUEST_PTR = SBEIO_COMP_ID | 0x3D,
// SBE Unsecure Memory Region error codes
SBEIO_MEM_REGION_DOES_NOT_EXIST = SBEIO_COMP_ID | 0x50,
diff --git a/src/usr/sbeio/common/sbe_attn.C b/src/usr/sbeio/common/sbe_attn.C
index a6fcb0583..5ad8152e1 100644
--- a/src/usr/sbeio/common/sbe_attn.C
+++ b/src/usr/sbeio/common/sbe_attn.C
@@ -36,6 +36,9 @@
#include <p9_extract_sbe_rc.H>
#include <sbeio/sbeioreasoncodes.H>
#include <sbeio/sbe_retry_handler.H>
+#include <sbeio/runtime/sbeio_attr_override.H>
+#include <sbeio/runtime/sbeio_vital_attn.H>
+#include <initservice/initserviceif.H>
extern trace_desc_t* g_trac_sbeio;
@@ -57,6 +60,16 @@ namespace SBEIO
TRACFCOMP( g_trac_sbeio, "handleVitalAttn> Returned SBE PLID=0x%x",
l_sbePlid);
+#ifdef __HOSTBOOT_RUNTIME
+ // Inform OPAL, SBE is currently disabled
+ if (TARGETING::is_sapphire_load())
+ {
+ // Inform OPAL of the inoperable SBE
+ l_errhdl = RT_SBEIO::vital_attn_inform_opal(i_procTarg,
+ RT_SBEIO::SBE_DISABLED);
+ }
+#endif
+
// @todo - RTC:180242 - Restart SBE
SbeRetryHandler l_sbeObj = SbeRetryHandler(
@@ -68,8 +81,19 @@ namespace SBEIO
l_sbeObj.main_sbe_handler(i_procTarg);
- // @todo - RTC:180244 - Disable the OCC
- // @todo - RTC:180245 - Inform OPAL
+#ifdef __HOSTBOOT_RUNTIME
+ // Inform OPAL the state of the SBE after a retry
+ if (l_sbeObj.getSbeRestart())
+ {
+ if (TARGETING::is_sapphire_load())
+ {
+ l_errhdl = RT_SBEIO::vital_attn_inform_opal(i_procTarg,
+ RT_SBEIO::SBE_ENABLED);
+ }
+
+ // @todo - RTC:180244 - Disable the OCC
+ }
+#endif
TRACFCOMP( g_trac_sbeio,
EXIT_MRK "handleVitalAttn> ");
diff --git a/src/usr/sbeio/runtime/makefile b/src/usr/sbeio/runtime/makefile
index 13fbaed12..541ad0b77 100644
--- a/src/usr/sbeio/runtime/makefile
+++ b/src/usr/sbeio/runtime/makefile
@@ -47,6 +47,7 @@ EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/sbe/
## Objects unique to HBRT
OBJS += rt_sbeio.o
OBJS += sbeio_attr_override.o
+OBJS += sbeio_vital_attn.o
OBJS += ${SBEIO_COMMON_OBJS}
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/
diff --git a/src/usr/sbeio/runtime/sbeio_vital_attn.C b/src/usr/sbeio/runtime/sbeio_vital_attn.C
new file mode 100644
index 000000000..8498d2c61
--- /dev/null
+++ b/src/usr/sbeio/runtime/sbeio_vital_attn.C
@@ -0,0 +1,97 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/sbeio/runtime/sbeio_vital_attn.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] 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 */
+#include <sbeio/runtime/sbeio_vital_attn.H>
+
+#include <runtime/interface.h> // g_hostInterfaces
+#include <util/runtime/rt_fwreq_helper.H> // firmware_request_helper
+#include <sbeio/sbeioreasoncodes.H> // SBEIO_HANDLE_VITAL_ATTN
+
+extern trace_desc_t* g_trac_sbeio;
+
+using namespace ERRORLOG;
+using namespace SBEIO;
+using namespace TARGETING;
+
+namespace RT_SBEIO
+{
+ //------------------------------------------------------------------------
+ errlHndl_t vital_attn_inform_opal(TARGETING::TargetHandle_t i_procTarg,
+ SBE_STATE i_sbeState)
+ {
+ errlHndl_t l_err = nullptr;
+ do
+ {
+ if ((nullptr == g_hostInterfaces) ||
+ (nullptr == g_hostInterfaces->firmware_request))
+ {
+ TRACFCOMP( g_trac_sbeio, ERR_MRK"handleVitalAttn: "
+ "Hypervisor firmware_request interface not linked");
+
+ /*@
+ * @errortype
+ * @severity ERRL_SEV_INFORMATIONAL
+ * @moduleid SBEIO_RUNTIME_HANDLE_VITAL_ATTN
+ * @reasoncode SBEIO_RT_NULL_FIRMWARE_REQUEST_PTR
+ * @userdata1 HUID of target
+ * @userdata2 none
+ * @devdesc Unable to inform OPAL of SBE failure
+ */
+ l_err = new ErrlEntry( ERRL_SEV_INFORMATIONAL,
+ SBEIO_RUNTIME_HANDLE_VITAL_ATTN,
+ SBEIO_RT_NULL_FIRMWARE_REQUEST_PTR,
+ get_huid(i_procTarg),
+ 0, true);
+ break;
+ }
+
+ // Create the firmware_request request struct to send data
+ hostInterfaces::hbrt_fw_msg l_req_fw_msg;
+ uint64_t l_req_fw_msg_size = sizeof(l_req_fw_msg);
+ memset(&l_req_fw_msg, 0, l_req_fw_msg_size);
+
+ // Populate the firmware_request request struct with given data
+ l_req_fw_msg.io_type =
+ hostInterfaces::HBRT_FW_MSG_TYPE_SBE_STATE;
+ l_req_fw_msg.sbe_state.i_procId =
+ i_procTarg->getAttr<ATTR_HBRT_HYP_ID>();
+ l_req_fw_msg.sbe_state.i_state = i_sbeState;
+
+ // Create the firmware_request response struct to receive data
+ hostInterfaces::hbrt_fw_msg l_resp_fw_msg;
+ uint64_t l_resp_fw_msg_size = sizeof(l_resp_fw_msg);
+ memset(&l_resp_fw_msg, 0, l_resp_fw_msg_size);
+
+ // Make the firmware_request call
+ l_err = firmware_request_helper(l_req_fw_msg_size,
+ &l_req_fw_msg,
+ &l_resp_fw_msg_size,
+ &l_resp_fw_msg);
+ }
+ while(0);
+
+ return l_err;
+ } // end errlHndl_t vital_attn_inform_opal(...)
+
+} // end namespace RT_SBEIO
diff --git a/src/usr/util/runtime/rt_fwreq_helper.C b/src/usr/util/runtime/rt_fwreq_helper.C
index e4cf371d3..29e12e6e0 100644
--- a/src/usr/util/runtime/rt_fwreq_helper.C
+++ b/src/usr/util/runtime/rt_fwreq_helper.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2017 */
+/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -190,6 +190,32 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
}
break; // END case hostInterfaces::HBRT_FW_MSG_TYPE_I2C_LOCK:
+ case hostInterfaces::HBRT_FW_MSG_TYPE_SBE_STATE:
+ {
+ TRACFCOMP(g_trac_runtime,
+ ERR_MRK"FSP is doing a reset/reload, "
+ "sending SBE vital attn to OPAL failed. "
+ "retry:%d/%d, rc:%d, procId:0x%08x, "
+ "state(0=disabled, 1=enable):%d",
+ i,
+ HBRT_FW_REQUEST_RETRIES,
+ rc,
+ l_req_fw_msg->sbe_state.i_procId,
+ l_req_fw_msg->sbe_state.i_state);
+
+ // Pack user data 1 with Hypervisor return code and
+ // firmware request message type
+ l_userData1 = TWO_UINT32_TO_UINT64(rc,
+ l_req_fw_msg->io_type);
+
+ // Pack user data 2 with processor ID of SBE
+ // and state of the SBE
+ l_userData2 = TWO_UINT32_TO_UINT64(
+ l_req_fw_msg->sbe_state.i_procId,
+ l_req_fw_msg->sbe_state.i_state);
+ }
+ break; // END case hostInterfaces::HBRT_FW_MSG_TYPE_SBE_STATE:
+
default:
break;
} // END switch (l_req_fw_msg->io_type)
@@ -209,7 +235,8 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
MBOX message type (FSP MSG) ||
chipID
* @userdata2[32:63] SCOM data (HCODE Update) ||
- Message Type (FSP MSG)
+ Message Type (FSP MSG) ||
+ SBE state
* @devdesc The Firmware Request call failed
*/
l_err = new ErrlEntry(ERRL_SEV_INFORMATIONAL,
@@ -350,6 +377,30 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
l_userData2 = l_req_fw_msg->req_i2c_lock.i_chipId;
}
break; // END case hostInterfaces::HBRT_FW_MSG_TYPE_I2C_LOCK:
+
+ case hostInterfaces::HBRT_FW_MSG_TYPE_SBE_STATE:
+ {
+ TRACFCOMP(g_trac_runtime,
+ ERR_MRK"Failed sending SBE vital attn to OPAL. "
+ "rc:0x%X, procId:0x%08x, "
+ "state(0=disabled, 1=enable):%d",
+ rc,
+ l_req_fw_msg->sbe_state.i_procId,
+ l_req_fw_msg->sbe_state.i_state);
+
+ // Pack user data 1 with Hypervisor return code and
+ // firmware request message type
+ l_userData1 = TWO_UINT32_TO_UINT64(rc,
+ l_req_fw_msg->io_type);
+
+ // Pack user data 2 with processor ID of SBE
+ // and state of the SBE
+ l_userData2 = TWO_UINT32_TO_UINT64(
+ l_req_fw_msg->sbe_state.i_procId,
+ l_req_fw_msg->sbe_state.i_state);
+ }
+ break; // END case hostInterfaces::HBRT_FW_MSG_TYPE_SBE_STATE:
+
default:
break;
} // END switch (l_req_fw_msg->io_type)
@@ -369,7 +420,8 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
MBOX message type (FSP MSG) ||
chipId
* @userdata2[32:63] SCOM data (HCODE Update) ||
- Message Type (FSP MSG)
+ Message Type (FSP MSG) ||
+ SBE state
* @devdesc The Firmware Request call failed
*/
l_err = new ErrlEntry(ERRL_SEV_PREDICTIVE,
OpenPOWER on IntegriCloud