summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLouis Stermole <stermole@us.ibm.com>2019-05-09 15:54:50 -0400
committerRaja Das <rajadas2@in.ibm.com>2019-07-26 00:57:32 -0500
commit713899e891639e6dbc6940754b82202aeddaab38 (patch)
treee1b22da6c8dbcec33dc00ed58ca7fbc9f64e5061 /src
parentfee0ceed21ba96ae7446d7b2af1299f9349135ca (diff)
downloadtalos-sbe-713899e891639e6dbc6940754b82202aeddaab38.tar.gz
talos-sbe-713899e891639e6dbc6940754b82202aeddaab38.zip
Add retry of EXP_FW_STATUS when status is FW_BUSY
Change-Id: If0d48114122246c2d221fb197274a6f31598f118 Original-Change-Id: Ic6b962fd4afdcce617ebb893b307ad5cc95086b8 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77203 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Glenn Miles <milesg@ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H50
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H1
-rw-r--r--src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml20
3 files changed, 65 insertions, 6 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H
index fc191b8d..9bbaa4f9 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H
@@ -59,15 +59,27 @@ namespace check
/// @param[in] i_target the OCMB target
/// @param[in] i_cmd_id the command ID
/// @param[in] i_data data to check from EXP_FW_STATUS
+/// @param[out] o_busy true if explorer returns FW_BUSY status, false otherwise
///
inline fapi2::ReturnCode status_code( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const uint8_t i_cmd_id,
- const std::vector<uint8_t>& i_data )
+ const std::vector<uint8_t>& i_data,
+ bool& o_busy )
{
+ // Set o_busy to false just in case we don't make it to where we check it
+ o_busy = false;
+
// Set to a high number to make sure check for SUCCESS (== 0) isn't a fluke
uint8_t l_status = ~(0);
FAPI_TRY( status::get_status_code(i_target, i_data, l_status) );
+ // We need to try again if we get a FW_BUSY status, so set the flag
+ if (l_status == status_codes::FW_BUSY)
+ {
+ o_busy = true;
+ return fapi2::FAPI2_RC_SUCCESS;
+ }
+
// Technically many cmds have their own status code decoding..but SUCCESS is always 0.
// If it's anything else we can just look up the status code
FAPI_ASSERT( l_status == status_codes::SUCCESS,
@@ -127,11 +139,37 @@ fapi_try_exit:
///
inline fapi2::ReturnCode fw_status(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target)
{
- std::vector<uint8_t> l_data;
-
- // Get data and check for errors
- FAPI_TRY(get_fw_status(i_target, l_data));
- FAPI_TRY( check::status_code(i_target, FW_STATUS, l_data) );
+ constexpr uint64_t NUM_LOOPS = 50;
+ // So, why aren't we using the memory team's polling API?
+ // This is a base function that will be utilized by the platform code
+ // As such, we don't want to pull in more libraries than we need to: it would cause extra dependencies
+ // So, we're decomposing the polling library below
+ bool l_busy = true;
+ uint64_t l_loop = 0;
+
+ // Loop until we max our our loop count or get a doorbell response
+ for(; l_loop < NUM_LOOPS && l_busy; ++l_loop)
+ {
+ std::vector<uint8_t> l_data;
+ FAPI_TRY(get_fw_status(i_target, l_data));
+ FAPI_TRY( check::status_code(i_target, FW_STATUS, l_data, l_busy) );
+
+ if (l_busy)
+ {
+ FAPI_INF( "%s reutrned FW_BUSY status. Retrying...", mss::c_str(i_target) );
+ FAPI_TRY( fapi2::delay( DELAY_100NS, 200) );
+ }
+ }
+
+ FAPI_DBG("%s stopped on loop%u/%u. %s",
+ mss::c_str(i_target), l_loop, NUM_LOOPS, (l_busy ? "FW_BUSY" : "SUCCESS"));
+
+ // Check that Explorer is not still in FW_BUSY state
+ FAPI_ASSERT( !l_busy,
+ fapi2::MSS_EXP_I2C_FW_STATUS_BUSY().
+ set_TARGET(i_target),
+ "Polling timeout on FW_STATUS command (still FW_BUSY) for %s",
+ mss::c_str(i_target) );
fapi_try_exit:
return fapi2::current_err;
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H
index c59cea94..20776385 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/shared/exp_consts.H
@@ -217,6 +217,7 @@ enum status_codes
SUCCESS = 0x00,
ADDRESS_OUT_OF_RANGE = 0x01,
ADDRESS_PROHIBITED = 0x02,
+ FW_BUSY = 0xFE,
};
///
diff --git a/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml b/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml
index f48742f8..f0d67789 100644
--- a/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml
+++ b/src/import/chips/ocmb/explorer/procedures/xml/error_info/mss_exp_errors.xml
@@ -118,6 +118,26 @@
</hwpError>
<hwpError>
+ <rc>RC_MSS_EXP_I2C_FW_STATUS_BUSY</rc>
+ <description>
+ Received FW_BUSY status after polling timeout for
+ command ID EXP_FW_STATUS
+ </description>
+ <ffdc>STATUS_CODE</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>MEDIUM</priority>
+ </callout>
+ <callout>
+ <target>TARGET</target>
+ <priority>HIGH</priority>
+ </callout>
+ <deconfigure>
+ <target>TARGET</target>
+ </deconfigure>
+ </hwpError>
+
+ <hwpError>
<rc>RC_MSS_EXP_I2C_POLLING_TIMEOUT</rc>
<description>
Polling the explorer I2C slave interface for an ACK
OpenPOWER on IntegriCloud