Skip to content

Commit

Permalink
Add vendor log data to FFDC for all NVDIMM HW errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cvswen authored and dcrowell77 committed Sep 13, 2019
1 parent 8ab48e7 commit ce0d29c
Show file tree
Hide file tree
Showing 8 changed files with 827 additions and 3 deletions.
105 changes: 102 additions & 3 deletions src/include/usr/isteps/nvdimm/nvdimm.H
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -311,10 +311,106 @@ 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
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 4 additions & 0 deletions src/include/usr/isteps/nvdimm/nvdimmreasoncodes.H
Expand Up @@ -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,
};

/**
Expand Down Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions src/usr/isteps/nvdimm/bpm_update.C
Expand Up @@ -739,6 +739,7 @@ errlHndl_t Bpm::issueCommand(const uint8_t i_command,
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -867,6 +868,7 @@ errlHndl_t Bpm::issueCommand(const uint8_t i_command,
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}
}
Expand Down Expand Up @@ -1163,6 +1165,7 @@ errlHndl_t Bpm::inUpdateMode()
TRACFCOMP(g_trac_bpm, "Bpm::inUpdateMode(): "
"Failed to read error status register");
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand All @@ -1189,6 +1192,7 @@ errlHndl_t Bpm::inUpdateMode()
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -1252,6 +1256,7 @@ errlHndl_t Bpm::enterUpdateMode()
TARGETING::get_huid(iv_nvdimm));
infoErrl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
ERRORLOG::errlCommit(infoErrl, BPM_COMP_ID);

} while(0);
Expand Down Expand Up @@ -1346,6 +1351,7 @@ errlHndl_t Bpm::exitUpdateMode()
HWAS::SRCI_PRIORITY_HIGH);
infoErrl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
ERRORLOG::errlCommit(infoErrl, BPM_COMP_ID);

} while(0);
Expand Down Expand Up @@ -1508,6 +1514,7 @@ errlHndl_t Bpm::updateFirmware(BpmFirmwareLidImage i_image)
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);

// Change the state of iv_attemptAnotherUpdate to signal
// if another update attempt should occur.
Expand Down Expand Up @@ -1698,6 +1705,7 @@ errlHndl_t Bpm::enterBootstrapLoaderMode()
errl->addPartCallout(iv_nvdimm,
HWAS::BPM_PART_TYPE,
HWAS::SRCI_PRIORITY_HIGH);
nvdimmAddVendorLog(iv_nvdimm, errl);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
break;
Expand Down Expand Up @@ -1795,6 +1803,7 @@ errlHndl_t Bpm::setupPayload(payload_t & o_payload,
TARGETING::get_huid(iv_nvdimm));
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -2141,6 +2150,7 @@ errlHndl_t Bpm::writeViaScapRegister(uint8_t const i_reg, uint8_t const i_data)
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -2236,6 +2246,7 @@ errlHndl_t Bpm::writeViaScapRegister(uint8_t const i_reg, uint8_t const i_data)
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -2308,6 +2319,7 @@ errlHndl_t Bpm::disableWriteProtection()
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -2482,6 +2494,7 @@ errlHndl_t Bpm::writeToMagicRegisters(
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -2578,6 +2591,7 @@ errlHndl_t Bpm::dumpSegment(uint16_t const i_segmentCode,
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);

break;
}
Expand Down Expand Up @@ -2702,6 +2716,7 @@ errlHndl_t Bpm::dumpSegment(uint16_t const i_segmentCode,
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
setAttemptAnotherUpdate();
break;
}
Expand Down Expand Up @@ -3169,6 +3184,7 @@ errlHndl_t Bpm::getResponse(uint8_t * const o_responseData,
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -3348,6 +3364,7 @@ errlHndl_t Bpm::blockWrite(payload_t i_payload)
HWAS::BPM_PART_TYPE,
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddVendorLog(iv_nvdimm, errl);

}

Expand Down Expand Up @@ -3432,6 +3449,7 @@ errlHndl_t Bpm::blockWriteRetry(payload_t i_payload)
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);

}

Expand Down Expand Up @@ -3504,6 +3522,7 @@ errlHndl_t Bpm::waitForCommandStatusBitReset(
HWAS::SRCI_PRIORITY_HIGH);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -3547,6 +3566,7 @@ errlHndl_t Bpm::waitForCommandStatusBitReset(
TARGETING::get_huid(iv_nvdimm));
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;

}
Expand Down Expand Up @@ -3611,6 +3631,7 @@ errlHndl_t Bpm::verifyGoodBpmState()
status.full);
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
}

return errl;
Expand Down Expand Up @@ -3664,6 +3685,7 @@ errlHndl_t Bpm::waitForBusyBit()
TARGETING::get_huid(iv_nvdimm));
errl->collectTrace(BPM_COMP_NAME);
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down Expand Up @@ -3972,6 +3994,7 @@ errlHndl_t Bpm::checkFirmwareCrc()
0),
TARGETING::get_huid(iv_nvdimm));
nvdimmAddPage4Regs(iv_nvdimm,errl);
nvdimmAddVendorLog(iv_nvdimm, errl);
break;
}

Expand Down

0 comments on commit ce0d29c

Please sign in to comment.