summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2018-12-06 14:10:56 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-02-15 19:43:25 -0600
commit855fc5f9694dcf1d6f0062ed91ae2fe587f7aecd (patch)
treef727880aee513c5af8253742ea0a1d16ab60b2d4 /src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
parent4097d46b73465d1bb5f53bd42eba593fdb1d50e2 (diff)
downloadtalos-hostboot-855fc5f9694dcf1d6f0062ed91ae2fe587f7aecd.tar.gz
talos-hostboot-855fc5f9694dcf1d6f0062ed91ae2fe587f7aecd.zip
Explorer_inband support: add response data buffer to getRSP
getRSP can check if a data response exists and then grab that data and load it into a vector. The caller is responsible for converting the data into big endian format for their expected response structure. Change-Id: Ie97488cde7036c230ab02610b5105e590c5d4249 RTC:186630 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69533 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69561 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
index 4e86dcc40..644fe8add 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
@@ -454,17 +454,33 @@ fapi_try_exit:
///
/// @param[in] i_target The Explorer chip to read data from
/// @param[out] o_rsp The response data read from the buffer
+/// @param[out] o_data Raw (little-endian) response data buffer portion
///
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
fapi2::ReturnCode getRSP(
const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
- host_fw_response_struct& o_rsp)
+ host_fw_response_struct& o_rsp, std::vector<uint8_t>& o_data)
{
std::vector<uint8_t> l_data(static_cast<int>(sizeof(o_rsp)));
FAPI_TRY(fapi2::getMMIO(i_target, EXPLR_IB_RSP_ADDR, 8, l_data));
FAPI_TRY(host_fw_response_struct_from_little_endian(i_target, l_data, o_rsp));
+ // If response data in buffer portion, return that too
+ if (o_rsp.response_length > 0)
+ {
+ // make sure expected size is a multiple of 8
+ o_data.resize( o_rsp.response_length +
+ (8 - (o_rsp.response_length % 8)) );
+
+ FAPI_TRY( fapi2::getMMIO(i_target, EXPLR_IB_DATA_ADDR, 8, o_data) );
+ }
+ else
+ {
+ // make sure no buffer data is returned
+ o_data.clear();
+ }
+
fapi_try_exit:
FAPI_DBG("%s Exiting with return code : 0x%08X...", mss::c_str(i_target), (uint64_t) fapi2::current_err);
return fapi2::current_err;
OpenPOWER on IntegriCloud