summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps/ucd
diff options
context:
space:
mode:
authorMatthew Raybuck <matthew.raybuck@ibm.com>2019-03-28 10:41:20 -0500
committerNicholas E. Bofferding <bofferdn@us.ibm.com>2019-03-29 22:24:18 -0500
commitb445b93fc21ee80515090087e063fd74b8d508a3 (patch)
tree8d16ef93fb3327fb07e607727030d414229a5821 /src/usr/isteps/ucd
parenta98d9a843a71d635456674bc55062552ecaa2cbc (diff)
downloadtalos-hostboot-b445b93fc21ee80515090087e063fd74b8d508a3.tar.gz
talos-hostboot-b445b93fc21ee80515090087e063fd74b8d508a3.zip
Handle bad PEC from UCD device op
The current UCD code doesn't have any error handling for a bad PEC byte instead it is just ignored. This will add the necessary error handling to the retry code for bad PEC bytes. Change-Id: I8d9960a203b5864812bcaa0019087bb3dcff0c53 RTC:205982 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75174 Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/usr/isteps/ucd')
-rw-r--r--src/usr/isteps/ucd/updateUcdFlash.C71
1 files changed, 31 insertions, 40 deletions
diff --git a/src/usr/isteps/ucd/updateUcdFlash.C b/src/usr/isteps/ucd/updateUcdFlash.C
index f71727a72..4c90540fe 100644
--- a/src/usr/isteps/ucd/updateUcdFlash.C
+++ b/src/usr/isteps/ucd/updateUcdFlash.C
@@ -122,7 +122,7 @@ private:
const uint8_t i_modId,
const uint16_t i_reasonCode,
const uint64_t i_user1,
- const uint64_t i_user2)
+ const uint64_t i_user2) const
{
errlHndl_t err = nullptr;
@@ -175,7 +175,7 @@ private:
const DeviceFW::I2C_SUBOP i_smbusOpType,
void * const io_buffer,
size_t& io_bufferLength,
- const uint8_t * const i_cmd = nullptr)
+ const uint8_t * const i_cmd = nullptr) const
{
assert(io_buffer != nullptr, "io_buffer must not be nullptr");
errlHndl_t err = nullptr;
@@ -257,13 +257,13 @@ private:
* @return boolean true if the error is retryable.
* Otherwise, false.
*/
- bool errorIsRetryable(const uint16_t i_reasonCode)
+ bool errorIsRetryable(const uint16_t i_reasonCode) const
{
- //@TODO RTC 205982 Handle Bad PEC byte.
bool retryable = false;
if ( (i_reasonCode == I2C::I2C_NACK_ONLY_FOUND)
- || (i_reasonCode == I2C::I2C_CMD_COMP_TIMEOUT))
+ || (i_reasonCode == I2C::I2C_CMD_COMP_TIMEOUT)
+ || (i_reasonCode == I2C::I2C_BAD_PEC_BYTE))
{
retryable = true;
}
@@ -331,19 +331,14 @@ private:
auto page = i_page;
size_t size = sizeof(page);
const auto expSize = size;
+ uint8_t cmd = PAGE;
+
+ pError = attemptDeviceOp(DeviceFW::WRITE,
+ DeviceFW::I2C_SMBUS_BYTE,
+ &page,
+ size,
+ &cmd);
- pError = deviceOp(DeviceFW::WRITE,
- iv_pI2cMaster,
- &page,
- size,
- DEVICE_I2C_SMBUS_BYTE(iv_i2cInfo.engine,
- iv_i2cInfo.port,
- iv_i2cInfo.devAddr,
- PAGE,
- iv_i2cInfo.i2cMuxBusSelector,
- &iv_i2cInfo.i2cMuxPath));
-
- // @TODO RTC 205982: Handle the PEC byte if it exists.
if(pError)
{
TRACFCOMP(g_trac_ucd, ERR_MRK
@@ -457,19 +452,14 @@ public:
size_t size = sizeof(mfrStatus.value);
const auto expSize = size;
+ uint8_t cmd = MFR_STATUS;
+
+ pError = attemptDeviceOp(DeviceFW::READ,
+ DeviceFW::I2C_SMBUS_BLOCK,
+ &mfrStatus.value,
+ size,
+ &cmd);
- pError = deviceOp(DeviceFW::READ,
- iv_pI2cMaster,
- &mfrStatus.value,
- size,
- DEVICE_I2C_SMBUS_BLOCK(iv_i2cInfo.engine,
- iv_i2cInfo.port,
- iv_i2cInfo.devAddr,
- MFR_STATUS,
- iv_i2cInfo.i2cMuxBusSelector,
- &iv_i2cInfo.i2cMuxPath));
-
- // @TODO RTC 205982: Handle the PEC byte if it exists.
if (pError)
{
TRACFCOMP(g_trac_ucd, ERR_MRK
@@ -1242,14 +1232,16 @@ public:
} // end of updateUcdFlash()
- //@TODO RTC 205982 Include bad pec byte RC in description
/*
* @brief This function will attempt to perform a deviceOp three times
* using the supplied parameters to select the appropriate
* operation. If an error is encountered during an attempt it
* will be handled in terms of retryable versus non-retryable.
- * A retryable error has a return code of either:
- * I2C_NACK_ONLY_FOUND, I2C_CMD_COMP_TIMEOUT, or a bad pec byte.
+ * A retryable error has a return code of:
+ * > I2C_NACK_ONLY_FOUND
+ * > I2C_CMD_COMP_TIMEOUT
+ * > I2C_BLOCK_READ_BAD_PEC_BYTE
+ * > I2C_READ_BYTE_WORD_BAD_PEC_BYTE
* If these errors are encountered they will not be returned by
* the function unless the operation fails three times then the
* final error will be returned as a non-retryable error.
@@ -1283,7 +1275,7 @@ public:
const DeviceFW::I2C_SUBOP i_smbusOpType,
void * const io_buffer,
size_t& io_bufferLength,
- const uint8_t * const i_cmd = nullptr)
+ const uint8_t * const i_cmd = nullptr) const
{
assert(io_buffer != nullptr, "io_buffer must not be nullptr");
@@ -1316,7 +1308,6 @@ public:
break;
}
-
// Retry Error Handling Section
if (pUcdError == nullptr)
{
@@ -1716,17 +1707,15 @@ errlHndl_t updateAllUcdFlashImages(
const auto position = pI2cMasterTarget->
getAttr<TARGETING::ATTR_POSITION>();
- // @TODO RTC 205982 Reset UCD if needed to put it in a good state
-
Ucd ucd(powerSequencer);
- pError=ucd.initialize();
+ pError = ucd.initialize();
if(pError)
{
TRACFCOMP(g_trac_ucd,ERR_MRK
"updateAllUcdFlashImages: Failed in Ucd::initialize() for UCD "
"with HUID of 0x%08X",
TARGETING::get_huid(powerSequencer));
- // @TODO: RTC 205982 mark non-functional, more FFDC
+
pError->collectTrace(UCD_COMP_NAME);
errlCommit(pError,UCD_COMP_ID);
break;
@@ -1802,7 +1791,7 @@ errlHndl_t updateAllUcdFlashImages(
deviceIds.add("Expected device ID",tocEntry.deviceId);
deviceIds.add("Actual device ID",deviceId);
deviceIds.addToLog(pError);
- // @TODO: RTC 205982 set non-functional, deconfig
+
pError->collectTrace(UCD_COMP_NAME);
errlCommit(pError,UCD_COMP_ID);
nextUcd=true;
@@ -1874,7 +1863,7 @@ errlHndl_t updateAllUcdFlashImages(
"updateUcdFlash for UCD with HUID of "
" 0x%08X.",
TARGETING::get_huid(powerSequencer));
- // @TODO: RTC 205982 Deconfigure UCD, call it out, etc.
+
pError->collectTrace(UCD_COMP_NAME);
errlCommit(pError,UCD_COMP_ID);
break;
@@ -1890,6 +1879,8 @@ errlHndl_t updateAllUcdFlashImages(
TARGETING::get_huid(powerSequencer));
pError->collectTrace(UCD_COMP_NAME);
errlCommit(pError,UCD_COMP_ID);
+
+ break;
}
TRACFCOMP(g_trac_ucd,INFO_MRK
OpenPOWER on IntegriCloud