diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2018-12-06 14:10:56 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-02-15 19:43:25 -0600 |
commit | 855fc5f9694dcf1d6f0062ed91ae2fe587f7aecd (patch) | |
tree | f727880aee513c5af8253742ea0a1d16ab60b2d4 /src/import/chips/ocmb | |
parent | 4097d46b73465d1bb5f53bd42eba593fdb1d50e2 (diff) | |
download | talos-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')
3 files changed, 23 insertions, 4 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C index cc751ecd5..65acae295 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C @@ -40,7 +40,7 @@ /// /// @brief Initializes DRAM /// @param[in] i_target the controller -/// @return FAPI2_RC_SUCCESS iff ok +/// @return FAPI2_RC_SUCCESS if ok /// fapi2::ReturnCode exp_draminit(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target) { @@ -65,7 +65,8 @@ fapi2::ReturnCode exp_draminit(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP> // Read the response message from EXP-FW RESP buffer { host_fw_response_struct l_response; - FAPI_TRY( mss::exp::ib::getRSP(i_target, l_response), + std::vector<uint8_t> l_rsp_data; + FAPI_TRY( mss::exp::ib::getRSP(i_target, l_response, l_rsp_data), "Failed getRSP() for %s", mss::c_str(i_target) ); // Check if cmd was successful 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; diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H index 438bb43c5..b85ae784e 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H @@ -348,11 +348,13 @@ fapi2::ReturnCode getOCCfg( /// /// @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 +/// The size of this buffer will be a multiple of 8 /// /// @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) ; |