summaryrefslogtreecommitdiffstats
path: root/src/usr/fsi
diff options
context:
space:
mode:
authorMike Baiocchi <baiocchi@us.ibm.com>2013-04-18 18:27:18 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-05-15 16:22:18 -0500
commitd24018889b89a67b6680673026c69ac57be07ccf (patch)
tree76c5a6325322101404d21941220b7925cb3c46a3 /src/usr/fsi
parent5d96619743f5d668edf515979190a77011867f48 (diff)
downloadtalos-hostboot-d24018889b89a67b6680673026c69ac57be07ccf.tar.gz
talos-hostboot-d24018889b89a67b6680673026c69ac57be07ccf.zip
Add FSI FFDC Data Collection
To address the request to update present detect error log, we've added getFsiFFDC() and related functions. We've called these functions in the fail paths of the present detect functions. Change-Id: I763bf4056c35ebebdf7a0f2d4d3d31862a4d0091 RTC: 66865 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4116 Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/fsi')
-rw-r--r--src/usr/fsi/fsidd.C162
-rw-r--r--src/usr/fsi/fsidd.H27
-rw-r--r--src/usr/fsi/fsipres.C27
3 files changed, 212 insertions, 4 deletions
diff --git a/src/usr/fsi/fsidd.C b/src/usr/fsi/fsidd.C
index c718f1ab9..feb733786 100644
--- a/src/usr/fsi/fsidd.C
+++ b/src/usr/fsi/fsidd.C
@@ -270,6 +270,26 @@ bool isSlavePresent( TARGETING::Target* i_target )
}
}
+
+/**
+ * @brief Add FFDC for the target to an error log
+ */
+void getFsiFFDC(FSI::fsiFFDCType_t i_ffdc_type, errlHndl_t &i_log,
+ TARGETING::Target* i_target)
+{
+ if ( (i_target == NULL) || (i_log == NULL) )
+ {
+ // NULL target or error log - can't collect data
+ return;
+ }
+ else
+ {
+ Singleton<FsiDD>::instance().getFsiFFDC(i_ffdc_type,
+ i_log, i_target);
+ }
+}
+
+
}; //end FSI namespace
@@ -581,6 +601,148 @@ errlHndl_t FsiDD::initializeHardware()
return l_err;
}
+/**
+ * @brief Add FFDC for the target to an error log
+ */
+void FsiDD::getFsiFFDC(FSI::fsiFFDCType_t i_ffdc_type, errlHndl_t &io_log,
+ TARGETING::Target* i_target)
+{
+ TRACDCOMP( g_trac_fsi, "FSI::getFFDC>" );
+
+ // Local Variables
+ uint8_t * i_data_ptr = NULL;
+ uint32_t i_ffdc_byte_len = 0;
+ bool i_merge = false;
+ uint64_t l_slaveEnableIndex=0;
+ uint64_t l_byte_index = 0;
+
+ // Check Type -- Not doing anything unique right now
+ if ( ! (i_ffdc_type == FSI::FSI_FFDC_PRESENCE_FAIL ) ||
+ (i_ffdc_type == FSI::FSI_FFDC_READWRITE_FAIL) )
+ {
+ // Unsupported FSI FFDC type, so don't add FFDC section
+ TRACFCOMP( g_trac_fsi, "FSI::getFFDC> Incorect i_ffdc_type (%d) "
+ "Not Adding FFDC section!",
+ i_ffdc_type);
+
+ return;
+ }
+
+ // Add target to error log
+ if (i_target != NULL)
+ {
+ ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(io_log);
+ }
+
+ // Add Master Target to Log
+ if (iv_master != NULL)
+ {
+ ERRORLOG::ErrlUserDetailsTarget(iv_master).addToLog(io_log);
+ }
+
+ // Information to capture
+ // 1) FsiChipInfo_t associated with this target
+ // 2) Size of iv_slaves[]
+ // 3) iv_slaves[]
+ // 4) uint64_t -- slave enable Index
+ i_ffdc_byte_len = sizeof(FsiChipInfo_t) +
+ sizeof(uint32_t) +
+ sizeof(iv_slaves) +
+ sizeof(uint64_t);
+
+ i_data_ptr = static_cast<uint8_t*>(malloc(i_ffdc_byte_len));
+
+
+ // Collect the data
+ FsiChipInfo_t l_fsi_chip_info = getFsiInfo(i_target);
+
+ l_slaveEnableIndex = getSlaveEnableIndex (l_fsi_chip_info.master,
+ l_fsi_chip_info.type);
+
+
+ TRACFCOMP( g_trac_fsi,
+ "FSI::getFFDC> i_ffdc_byte_len =%d, i_data_ptr=%p,"
+ " sizeof: FsiChipInfo_t=%d, iv_slaves=%d, u32=%d "
+ "u64=%d, l_slaveEnableIndex=0x%x", i_ffdc_byte_len,
+ i_data_ptr, sizeof(FsiChipInfo_t), sizeof(iv_slaves),
+ sizeof(uint32_t), sizeof(uint64_t), l_slaveEnableIndex);
+
+
+ // Copy Data into memory bloack
+ l_byte_index = 0;
+
+ // FsiChipInfo_t
+ memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index),
+ &l_fsi_chip_info, sizeof(FsiChipInfo_t));
+
+ l_byte_index += sizeof(FsiChipInfo_t);
+
+
+ // Size of iv_slaves[]
+ const uint32_t l_so_iv_slaves = sizeof(iv_slaves);
+ memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index),
+ &l_so_iv_slaves, sizeof(uint32_t));
+
+ l_byte_index += sizeof(uint32_t);
+
+
+ // iv_slaves[]
+ memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index),
+ &iv_slaves, sizeof(iv_slaves));
+
+ l_byte_index += sizeof(iv_slaves);
+
+
+ // getSlaveEnable Index
+ memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index),
+ &l_slaveEnableIndex, sizeof(uint64_t));
+
+ l_byte_index += sizeof(uint64_t);
+
+
+ // Check we didn't go too far or too short
+ if (l_byte_index != i_ffdc_byte_len)
+ {
+ TRACFCOMP( g_trac_fsi, "FSI::getFFDC> Byte Length Mismatch: "
+ "Not Adding FFDC section!"
+ "l_byte_index=%d, i_ffdc_byte_len=%d",
+ l_byte_index, i_ffdc_byte_len);
+
+ // Free malloc'ed memory
+ if (i_data_ptr != NULL)
+ {
+ free(i_data_ptr);
+ }
+
+ return;
+ }
+
+ // Actual call to log the data
+ ERRORLOG::ErrlUD * l_pUD = (io_log)->addFFDC(FSI_COMP_ID,
+ i_data_ptr,
+ i_ffdc_byte_len,
+ FsiFFDC_Ver1,
+ FsiFFDC_CapData_1,
+ i_merge);
+
+ // Check for success
+ if (l_pUD == NULL)
+ {
+ // Failure to add FFDC section
+ TRACFCOMP( g_trac_fsi, "FSI::getFFDC> FAILURE TO ADD FFDC" );
+
+ // Add errl trace
+ (io_log)->collectTrace("ERR");
+ }
+ else
+ {
+ TRACFCOMP( g_trac_fsi, "FSI::getFFDC> FFDC Successfully added "
+ "(%d bytes)", i_ffdc_byte_len );
+ }
+
+ return;
+
+}
/********************
Internal Methods
diff --git a/src/usr/fsi/fsidd.H b/src/usr/fsi/fsidd.H
index 69cdf1d3a..59534b822 100644
--- a/src/usr/fsi/fsidd.H
+++ b/src/usr/fsi/fsidd.H
@@ -30,6 +30,20 @@
#include <usr/devicefw/driverif.H>
#include <attributestructs.H>
#include <sys/task.h>
+#include <usr/fsi/fsiif.H>
+
+
+
+/* Defines for FsiDD::getFsiFFDC() */
+enum ErrlVersion
+{
+ FsiFFDC_Ver1 = 1,
+};
+
+enum ErrlSubsect
+{
+ FsiFFDC_CapData_1 = 1,
+};
/** @file fsidd.H
@@ -100,6 +114,19 @@ class FsiDD
*/
bool isSlavePresent( TARGETING::Target* i_target );
+ /**
+ * @brief Add FFDC for the target to an error log
+ *
+ * @param[in] i_ffdc_type Type of FFDC to add
+ * @param[in,out] io_log Error Log to add FFDC to
+ * @param[in] i_target FSI Target
+ *
+ * @return void
+ */
+ void getFsiFFDC( FSI::fsiFFDCType_t i_ffdc_type,
+ errlHndl_t &io_log ,
+ TARGETING::Target* i_target);
+
protected:
/**
* @brief Constructor
diff --git a/src/usr/fsi/fsipres.C b/src/usr/fsi/fsipres.C
index d1c9b076c..26859196a 100644
--- a/src/usr/fsi/fsipres.C
+++ b/src/usr/fsi/fsipres.C
@@ -30,8 +30,10 @@
#include <hwas/common/hwasCallout.H>
#include <targeting/common/predicates/predicatectm.H>
+
extern trace_desc_t* g_trac_fsi;
+
namespace FSI
{
@@ -160,6 +162,7 @@ errlHndl_t procPresenceDetect(DeviceFW::OperationType i_opType,
}
}
+
// Finally compare the 2 methods
if( fsi_present != mvpd_present )
{
@@ -196,6 +199,14 @@ errlHndl_t procPresenceDetect(DeviceFW::OperationType i_opType,
l_errl->plid(l_saved_plid);
}
+ // Add FFDC for the target to an error log
+ getFsiFFDC( FSI_FFDC_PRESENCE_FAIL, l_errl, i_target);
+
+
+ // Add FSI and VPD trace
+ l_errl->collectTrace("FSI");
+ l_errl->collectTrace("VPD");
+
// commit this log and move on
errlCommit( l_errl,
FSI_COMP_ID );
@@ -322,6 +333,7 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType,
}
}
+
// Finally compare the 2 methods
if( fsi_present != cvpd_present )
{
@@ -332,16 +344,16 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType,
/*@
* @errortype
* @moduleid FSI::MOD_FSIPRES_MEMBPRESENCEDETECT
- * @reasoncode FSI::RC_FSI_MVPD_MISMATCH
- * @userdata1 HUID of processor
+ * @reasoncode FSI::RC_FSI_CVPD_MISMATCH
+ * @userdata1 HUID of membuffer
* @userdata2[0:31] FSI Presence
* @userdata2[32:63] VPD Presence
- * @devdesc presenceDetect> FSI and MVPD do not agree
+ * @devdesc presenceDetect> FSI and CVPD do not agree
*/
l_errl =
new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
FSI::MOD_FSIPRES_MEMBPRESENCEDETECT,
- FSI::RC_FSI_MVPD_MISMATCH,
+ FSI::RC_FSI_CVPD_MISMATCH,
TARGETING::get_huid(i_target),
TWO_UINT32_TO_UINT64(
fsi_present,
@@ -359,6 +371,13 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType,
l_errl->plid(l_saved_plid);
}
+ // Add FFDC for the target to an error log
+ getFsiFFDC( FSI_FFDC_PRESENCE_FAIL, l_errl, i_target);
+
+ // Add FSI and VPD trace
+ l_errl->collectTrace("FSI");
+ l_errl->collectTrace("VPD");
+
// commit this log and move on
errlCommit( l_errl,
FSI_COMP_ID );
OpenPOWER on IntegriCloud