summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorAndre Marin <aamarin@us.ibm.com>2018-08-10 08:29:49 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2018-10-30 10:42:21 -0500
commita77117372feee4284c7f7eee0d3e8102ec180cba (patch)
tree21ca6ccc7b128f2394ca0abb81f2c024d3fd9020 /src/import
parentb6c4337484ca890679a7213b8d7c393d7e80a08a (diff)
downloadtalos-hostboot-a77117372feee4284c7f7eee0d3e8102ec180cba.tar.gz
talos-hostboot-a77117372feee4284c7f7eee0d3e8102ec180cba.zip
Implement exp_check_for_ready
Change-Id: I122bb5e71f8a01f7e769f99f5b8d26d6559404dd Original-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/68125 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/i2c/exp_i2c.H19
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 81525afa1..c6dd2b7df 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
OpenPOWER on IntegriCloud