summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2018-09-25 14:05:36 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-10-23 11:44:55 -0500
commita45ace1ec733a7a3f17988715a43e06c1cc414f5 (patch)
tree9e2881af1c5704b2913319275e096fb9cf81278b /src/usr/initservice
parentc9d3c11613e9a47cf380b0cc60900eeb419d5e72 (diff)
downloadtalos-hostboot-a45ace1ec733a7a3f17988715a43e06c1cc414f5.tar.gz
talos-hostboot-a45ace1ec733a7a3f17988715a43e06c1cc414f5.zip
Send Attn chip list for monitoring
Need to let ATTN know that they need to start monitoring non-primary processors and centaurs after we determine they are functional. Change-Id: Ia33ddc87a94c0ca972accb2d6078c2f9f2e7bd2c CQ: SW446697 CMVC-Prereq: 1070543 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66717 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: Christian R Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/initservice')
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C127
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.H13
2 files changed, 140 insertions, 0 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 08e2391f6..a1d00a10f 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -1496,6 +1496,126 @@ errlHndl_t IStepDispatcher::sendSyncPoint()
return err;
}
+errlHndl_t IStepDispatcher::sendAttnMonitorChipIdMsg(
+ const std::vector<TARGETING::ATTR_HUID_type> & i_huid_list )
+{
+ errlHndl_t l_err = NULL;
+
+ TRACFCOMP(g_trac_initsvc,
+ ENTER_MRK"IStepDispatcher::sendAttnMonitorChipIdMsg");
+
+ if( !iv_spBaseServicesEnabled )
+ {
+ TRACFCOMP( g_trac_initsvc,
+ INFO_MRK"sendAttnMonitorChipIdMsg: The ATTN service runs on the "
+ "FSP and no FSP was found so we are skipping sending message to "
+ "ATTN service.");
+ }
+ else if (i_huid_list.empty())
+ {
+ TRACFCOMP( g_trac_initsvc, INFO_MRK"sendAttnMonitorChipIdMsg: empty huid list" );
+ }
+ else
+ {
+ INITSERVICE::attn_chipid_msg * l_data_ptr = nullptr;
+
+ msg_t * myMsg = msg_allocate();
+ myMsg->type = INITSERVICE::ATTN_MONITOR_CHIPID_LIST;
+
+ // Contains the full size of the extra_data field of myMsg
+ // extra_data includes attn_chipid_msg + list of HUIDs.
+ // attn_chipid_msg.data is the start of the huid list so
+ // need to remove that variable's size from the total
+ uint16_t l_total_size =
+ (sizeof(INITSERVICE::attn_chipid_msg) - sizeof(l_data_ptr->data)) +
+ (sizeof(TARGETING::ATTR_HUID_type) * i_huid_list.size());
+
+ myMsg->data[0] = 0;
+ myMsg->data[1] = l_total_size;
+ myMsg->extra_data = MBOX::allocate(l_total_size);
+
+ l_data_ptr = reinterpret_cast<INITSERVICE::attn_chipid_msg *>
+ (myMsg->extra_data);
+
+ // total chip huid's in list
+ l_data_ptr->chipIdCount = i_huid_list.size();
+
+ // data length in bytes of the list (sizeof(huid) * Number of huids)
+ l_data_ptr->size = sizeof(TARGETING::ATTR_HUID_type) *
+ i_huid_list.size();
+
+ // now fill in the list with huids
+ std::copy(i_huid_list.begin(), i_huid_list.end(), &(l_data_ptr->data));
+
+ TRACFCOMP( g_trac_initsvc,
+ "sendAttnMonitorChipIdMsg: Sending ATTN_MONITOR_CHIPID_LIST"
+ " (0x%.8X) msg", myMsg->type );
+ TRACFBIN(g_trac_initsvc, "msg data", myMsg->extra_data, myMsg->data[1]);
+
+ // send message to alert ATTN to start monitoring these chips
+ l_err = MBOX::sendrecv(HWSVRQ, myMsg);
+ if (l_err)
+ {
+ TRACFCOMP(g_trac_initsvc,
+ ERR_MRK"sendAttnMonitorChipIdMsg: error 0x%.8X from msg send",
+ l_err->reasonCode() );
+ l_err->collectTrace("INITSVC", 1024);
+
+ // clean up any allocated memory of failed msg
+ if((myMsg != nullptr) && (myMsg->extra_data != nullptr))
+ {
+ free( myMsg->extra_data );
+ myMsg->extra_data = nullptr;
+ }
+ }
+ else
+ {
+ // Check if msg failed at the FSP level by looking at data[0]
+ // A non-zero value implies something went wrong
+ if (myMsg->data[0] != HWSVR_MSG_SUCCESS)
+ {
+ TRACFCOMP(g_trac_initsvc, ERR_MRK"sendAttnMonitorChipIdMsg: "
+ "msg failed at HWSV/ATTN level, see plid %.8X",
+ myMsg->data[0] );
+
+ /*@
+ * @errortype
+ * @reasoncode ISTEP_ATTN_MONITOR_MSG_FAILED
+ * @severity ERRORLOG::ERRL_SEV_PREDICTIVE
+ * @moduleid ISTEP_INITSVC_MOD_ID
+ * @userdata1 PLID of failure on FSP
+ * @userdata2 Number of huids in msg
+ * @devdesc sendAttnMonitorChipIdMsg failed at
+ * the FSP level. Potential checkstops
+ * may not be properly handled.
+ * @custdesc Firmware error during boot
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_PREDICTIVE,
+ ISTEP_INITSVC_MOD_ID,
+ ISTEP_ATTN_MONITOR_MSG_FAILED,
+ myMsg->data[0],
+ i_huid_list.size(),
+ ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);
+ l_err->collectTrace("INITSVC", 1024);
+
+ // Use the same plid as the HWSV/ATTN error
+ l_err->plid(myMsg->data[0]);
+ }
+ }
+
+ // msg cleanup
+ // NOTE: extra_data is cleaned up by the receiver
+ msg_free(myMsg);
+ myMsg = nullptr;
+ }
+
+ TRACFCOMP( g_trac_initsvc,
+ EXIT_MRK"IStepDispatcher::sendAttnMonitorChipIdMsg");
+
+ return l_err;
+}
+
// ----------------------------------------------------------------------------
// IStepDispatcher::sendIstepCompleteMsg()
// ----------------------------------------------------------------------------
@@ -2544,6 +2664,13 @@ errlHndl_t sendSyncPoint()
return IStepDispatcher::getTheInstance().sendSyncPoint();
}
+errlHndl_t sendAttnMonitorChipIdMsg(
+ const std::vector<TARGETING::ATTR_HUID_type> & i_huid_list)
+{
+ return IStepDispatcher::getTheInstance().
+ sendAttnMonitorChipIdMsg(i_huid_list);
+}
+
void sendProgressCode(bool i_needsLock)
{
errlHndl_t err = NULL;
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H
index fa50501ee..bf8950c75 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.H
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H
@@ -36,6 +36,7 @@
/******************************************************************************/
#include <stdint.h>
#include <time.h>
+#include <vector>
#include <util/singleton.H>
#include <sys/msg.h>
#include <sys/sync.h>
@@ -254,6 +255,18 @@ public:
*/
int getNextIStep(uint8_t& io_istep, uint8_t& io_substep);
+ /**
+ * @brief Send attn_chipid_msg to alert ATTN code on the FSP to
+ * start monitoring these chips
+ *
+ * param[in] i_huid_list - HUID list of chips for ATTN to watch
+ *
+ * @return errlHndl_t - NULL if successful,
+ * otherwise a pointer to the error log.
+ */
+ errlHndl_t sendAttnMonitorChipIdMsg(
+ const std::vector<TARGETING::ATTR_HUID_type> & i_huid_list );
+
protected:
/**
OpenPOWER on IntegriCloud