summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorCorey Swenson <cswenson@us.ibm.com>2019-09-06 01:34:02 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-09-13 10:31:13 -0500
commitce0d29c96c4619e07819760b84c32f0eb7812b5c (patch)
treede182dcffb261d02515b6f6324bdea41d37d4d0d /src/include/usr
parent8ab48e774cbea9bfec5461d8fd63b4fc7f249c3b (diff)
downloadtalos-hostboot-ce0d29c96c4619e07819760b84c32f0eb7812b5c.tar.gz
talos-hostboot-ce0d29c96c4619e07819760b84c32f0eb7812b5c.zip
Add vendor log data to FFDC for all NVDIMM HW errors
Read vendor log data from NVDIMM Do checksum compare Add to error log as string Change-Id: I41a295bf54d031c978b59fe1f59c98507fbeec81 CQ:SW473585 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83383 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/isteps/nvdimm/nvdimm.H105
-rw-r--r--src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H4
2 files changed, 106 insertions, 3 deletions
diff --git a/src/include/usr/isteps/nvdimm/nvdimm.H b/src/include/usr/isteps/nvdimm/nvdimm.H
index 9512e5c89..ce79e9026 100644
--- a/src/include/usr/isteps/nvdimm/nvdimm.H
+++ b/src/include/usr/isteps/nvdimm/nvdimm.H
@@ -144,7 +144,7 @@ void nvdimm_getNvdimmList(TARGETING::TargetHandleList &o_nvdimmList);
*
* @param[in] i_nvdimm - nvdimm target with NV controller
*
- * @return errlHndl_t - Null if successful, otherwise a pointer to
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
* the error log.
*/
errlHndl_t nvdimmEraseNF(TARGETING::Target *i_nvdimm);
@@ -177,7 +177,7 @@ bool nvdimmInErrorState(TARGETING::Target *i_nvdimm);
*
* @param[in] i_state - true to arm, false to disarm
*
- * @return errlHndl_t - Null if successful, otherwise a pointer to
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
* the error log.
*/
errlHndl_t nvdimmChangeArmState(TARGETING::Target *i_nvdimm, bool i_state);
@@ -240,7 +240,7 @@ bool nvDimmEsCheckHealthStatus(const TARGETING::TargetHandleList
bool nvDimmEsCheckHealthStatusOnSystem();
-/*
+/**
* @brief Check the NVM (non-volatile memory)/flash health status of the
* individual NVDIMMs supplied in list.
*
@@ -311,11 +311,107 @@ enum nvdimm_protection_t
* - ERROR states updated per NVDIMM
* - OCC state updated per PROC
* @param i_state Protection state of NVDIMM
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
*/
errlHndl_t notifyNvdimmProtectionChange(TARGETING::Target* i_target,
const nvdimm_protection_t i_state);
/**
+ * @brief Get operational unit operation timeout
+ *
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[out] o_timeout - operation timeout
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
+ */
+errlHndl_t getOperOpsTimeout(TARGETING::Target* i_nvdimm,
+ uint16_t& o_timeout);
+
+/**
+ * @brief Wait for operational unit operation to complete
+ *
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[in] i_cmd - operational unit ops command
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
+ */
+errlHndl_t waitOperOpsComplete(TARGETING::Target* i_nvdimm,
+ uint8_t i_cmd);
+
+
+/**
+ * @brief Get the vendor log unit
+ *
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[in] i_unitId - vendor log unit id
+ *
+ * @param[out] o_unitData - vendor log unit data
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
+ */
+errlHndl_t getLogPerUnit(TARGETING::Target* i_nvdimm,
+ uint16_t i_unitId,
+ std::vector<uint8_t>& o_unitData);
+
+/**
+ * @brief Calculate host CRC
+ *
+ * @param[in] i_data - host data
+ *
+ * @param[in] i_data_size - data size
+ *
+ * @return crc
+ */
+uint16_t crc16(const uint8_t * i_data, int i_size);
+
+
+/**
+ * @brief Get operational unit crc
+ *
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[out] o_crc - nvdimm hw crc
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
+ */
+errlHndl_t getOperUnitCrc(TARGETING::Target* i_nvdimm, uint16_t& o_crc);
+
+
+/**
+ * @brief Compare host and nvdimm checksum
+ *
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[in] i_unitData - data sent to the nvdimm by the host
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
+ */
+errlHndl_t compareCksum(TARGETING::Target* i_nvdimm,
+ std::vector<uint8_t>& i_unitData);
+
+
+/**
+ * @brief Function to add NVDIMM vendor log data to errorlog FFDC
+ *
+ * @param[in] i_nvdimm - nvdimm target
+ *
+ * @param[inout] io_err - error log to add FFDC data
+ *
+ */
+void nvdimmAddVendorLog(TARGETING::Target *i_nvdimm, errlHndl_t& io_err);
+
+
+/**
* @brief Function to add some NVDIMM Page 4 status regs to errorlog FFDC
* PANIC_CNT Counts FPGA firmware events
* PARITY_ERROR_COUNT Counts FPGA SRAM parity errors
@@ -342,6 +438,9 @@ void nvdimmAddPage4Regs(TARGETING::Target *i_nvdimm, errlHndl_t& io_err);
* - Waits for the ongoing backup to complete
* - Disarms the trigger for draminit
* @param i_target nvdimm target
+ *
+ * @return errlHndl_t - nullptr if successful, otherwise a pointer to
+ * the error log.
*/
errlHndl_t nvdimm_init(TARGETING::Target *i_nvdimm);
diff --git a/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H b/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
index ad5c6be50..72b77d835 100644
--- a/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
+++ b/src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
@@ -104,6 +104,8 @@ enum nvdimmModuleId
NVDIMM_MODULE_HEALTH_STATUS_CHECK = 0x36,
NVDIMM_SET_EVENT_NOTIFICATION = 0x37,
NVDIMM_NVM_HEALTH_CHECK = 0x38, // Health check on the NVM (non-volatile memory)/flash
+ NVDIMM_WAIT_OPER_OPS_COMPLETE = 0x39,
+ NVDIMM_COMPARE_CKSUM = 0x3A,
};
/**
@@ -192,6 +194,8 @@ enum nvdimmReasonCode
NVDIMM_ES_LIFETIME_MIN_REQ_NOT_MET = NVDIMM_COMP_ID | 0x4B, // !< pertains to ES_LIFETIME; BPM does not meet minimum requirement for a new BPM
NVDIMM_ES_HEALTH_CHECK_NEVER_INITIATED = NVDIMM_COMP_ID | 0x4C, // !< An ES health check was never initiated at start of IPL
NVDIMM_NVM_HEALTH_CHECK_FAILED = NVDIMM_COMP_ID | 0x4D, // !< An NVM health check on the NVDIMM failed
+ NVDIMM_VENDOR_LOG_TIMEOUT = NVDIMM_COMP_ID | 0x4E, // Vendor log for FFDC timeout
+ NVDIMM_VENDOR_LOG_CKSUM_FAILED = NVDIMM_COMP_ID | 0x4F, // Vendor log for FFDC checksum fail
};
enum UserDetailsTypes
OpenPOWER on IntegriCloud