diff options
author | Andre Marin <aamarin@us.ibm.com> | 2018-08-10 08:29:49 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2019-01-10 21:41:26 -0600 |
commit | 09fc729a0e4981d78c31287f4d493284c25343ee (patch) | |
tree | 8bb714d90ac8b9be45b5aa31d559ca8f5955a26b /src/import/chips/ocmb | |
parent | 77c7728ea9e7885e7db57ab8bcd9f49fbbe2335c (diff) | |
download | talos-sbe-09fc729a0e4981d78c31287f4d493284c25343ee.tar.gz talos-sbe-09fc729a0e4981d78c31287f4d493284c25343ee.zip |
Implement exp_check_for_ready
Change-Id: I11e80e70c411ec0f5a1891e078b669f176658c34
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/61972
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: RYAN P. KING <rpking@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69957
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb')
-rw-r--r-- | src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H | 19 |
1 files changed, 19 insertions, 0 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 b1836a03..21b7f30e 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 @@ -149,6 +149,25 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Checks if the I2C interface returns an ACK +/// @param[in] i_target the OCMB target +/// @return FAPI2_RC_SUCCESS iff okay +/// +inline fapi2::ReturnCode is_ready(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target) +{ + // We send a simple but valid command to poll the I2C + // Arbitrarily send an EXP_FW_STATUS command id + size_t l_size = 0; + std::vector<uint8_t> l_cmd_id; + fw_status_setup(l_size, l_cmd_id); + + // We just ignore the data. We'll see FAPI2_RC_SUCCESS if + // the I2C returns an ACK. + std::vector<uint8_t> l_data; + return fapi2::getI2c(i_target, l_size, l_cmd_id, l_data); +} + }// i2c }// exp }// mss |