From 574186ea098a9e9dbb6de4ffa44e9489f3125e01 Mon Sep 17 00:00:00 2001 From: Louis Stermole Date: Tue, 14 May 2019 14:13:41 -0400 Subject: Clear Explorer outbound doorbell after reading cmd response Change-Id: I0952417923bcd1aedd1d707896e3293e30214455 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77351 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: STEPHEN GLANCY Reviewed-by: Mark Pizzutillo Reviewed-by: ANDRE A. MARIN Reviewed-by: Thi N. Tran Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77368 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes --- .../explorer/procedures/hwp/memory/exp_inband.C | 21 +++++++++++++++++++++ .../explorer/procedures/hwp/memory/exp_inband.H | 7 +++++++ 2 files changed, 28 insertions(+) (limited to 'src/import/chips/ocmb/explorer/procedures/hwp') 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 46a0c04b5..5f56f5242 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 @@ -502,6 +502,25 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Clears outbound (response ready) door bell bit +/// @param[in] i_target the OCMB target on which to operate +/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. +/// +fapi2::ReturnCode clear_outbound_doorbell(const fapi2::Target& i_target) +{ + fapi2::buffer l_data; + + // Doorbell is cleared by writing a '1' to the doorbell bit + l_data.setBit(); + + FAPI_DBG("%s Clearing outbound doorbell...", mss::c_str(i_target)); + FAPI_TRY(fapi2::putScom(i_target, EXPLR_MIPS_TO_OCMB_INTERRUPT_REGISTER1, l_data)); + +fapi_try_exit: + return fapi2::current_err; +} + /// @brief Reads a response from the response buffer /// /// @param[in] i_target The Explorer chip to read data from @@ -547,6 +566,8 @@ fapi2::ReturnCode getRSP( o_data.clear(); } + FAPI_TRY(clear_outbound_doorbell(i_target)); + 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 989910f21..88921392d 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 @@ -359,6 +359,13 @@ fapi2::ReturnCode getOCCfg( /// fapi2::ReturnCode poll_for_response_ready(const fapi2::Target& i_target); +/// +/// @brief Clears outbound (response ready) door bell bit +/// @param[in] i_target the OCMB target on which to operate +/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. +/// +fapi2::ReturnCode clear_outbound_doorbell(const fapi2::Target& i_target); + /// @brief Reads a response from the response buffer /// /// @param[in] i_target The Explorer chip to read data from -- cgit v1.2.1