summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H
diff options
context:
space:
mode:
authorMark Pizzutillo <Mark.Pizzutillo@ibm.com>2019-09-16 17:08:27 -0400
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-10-17 15:27:03 -0500
commit8f549e7548fb45819fc4fd8637448f428f14eec1 (patch)
tree0bd9d8d0361ba7e511794ff4b6e1ea75f2b0ccde /src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H
parent70b54e6ae12665ccc0070e896039faadd52333f7 (diff)
downloadtalos-hostboot-8f549e7548fb45819fc4fd8637448f428f14eec1.tar.gz
talos-hostboot-8f549e7548fb45819fc4fd8637448f428f14eec1.zip
Add code and workarounds for *_omi_setup and *_omi_train for Swift
Change-Id: I139357a553e621b25b46bee6303357c712b67be2 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83848 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Dev-Ready: Steven B Janssen <janssens@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Christian R Geddes <crgeddes@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83905 Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com> Tested-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H38
1 files changed, 33 insertions, 5 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 60fd07529..c430c650e 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
@@ -295,11 +295,39 @@ inline fapi2::ReturnCode boot_config(const fapi2::Target<fapi2::TARGET_TYPE_OCMB
// The command takes ~300ms and we poll for around 100ms, so wait 250ms here
FAPI_TRY( fapi2::delay( (mss::DELAY_1MS * 250), 200) );
- // Poll for status response
- // Note: the EXP_FW_BOOT_CONFIG command trains the OMI, which takes a
- // significant amount of time. We're waiting 1ms between polls, and poll for 100 loops,
- // which totals at least 100ms
- FAPI_TRY(fw_status(i_target, DELAY_1MS, 100));
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Check that the FW status code returns a busy status (expected for exp_omi_train)
+///
+/// @param[in] i_target OCMB
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff busy and no error code, else, error code
+///
+inline fapi2::ReturnCode check_fw_status_busy(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target)
+{
+ uint8_t l_status = ~(0);
+
+ std::vector<uint8_t> l_data;
+ FAPI_TRY(get_fw_status(i_target, l_data));
+
+ FAPI_TRY(status::get_status_code(i_target, l_data, l_status));
+
+ // Post bootconfig1, we should see a busy status until p9a_omi_train is kicked off (setting axone to AUTO_TRAIN)
+ // explorer will return busy status until then. if we have another status, then we may not have executed bootconfig1
+ // or some previous command correctly, so we should check it here
+ // After p9a_omi_train, exp_omi_train_check will check fw_status for success (in addition to checking training completion)
+ // to make sure things went smoothly
+ FAPI_ASSERT( l_status == status_codes::FW_BUSY,
+ fapi2::MSS_EXP_I2C_FW_BOOT_CONFIG_STATUS_CODE_INVALID().
+ set_TARGET(i_target).
+ set_STATUS_CODE(l_status).
+ set_CMD_ID(FW_STATUS),
+ "Status code did not return BUSY (%d) as expected post BOOT_CONFIG1, received (%d) for " TARGIDFORMAT ,
+ status_codes::FW_BUSY, l_status, TARGID );
+
+ return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
OpenPOWER on IntegriCloud