diff options
author | Tsung Yeung <tyeung@us.ibm.com> | 2019-04-08 22:11:40 -0400 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-04-15 09:33:47 -0500 |
commit | fa0064292733ea0c5091de493ea52845ba8d9ecd (patch) | |
tree | a1ab4e8e2e4d3aaad21579e5706c47d2d2053406 /src/import/chips/p9/procedures/hwp/memory/lib/dimm | |
parent | 7c4068b510e172eb973b8e460ee432e7e8bc8275 (diff) | |
download | talos-hostboot-fa0064292733ea0c5091de493ea52845ba8d9ecd.tar.gz talos-hostboot-fa0064292733ea0c5091de493ea52845ba8d9ecd.zip |
Ignore refresh overrun fir NVDIMM during post-restore sequence
While CCS is running (ccs_addr_sel_mux=1) mainline refreshes could get
queued up and later released 1 cycle apart, causing the refresh overrun
fir. Mask this error during post-restore sequence so it doesn't get called
out later.
Change-Id: Iac0f998bfcc807d6f5fa2e6a57ec07a7afa5cc60
CQ:SW462190
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75692
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
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: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75696
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/dimm')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C | 14 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H | 69 |
2 files changed, 79 insertions, 4 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C index b35c5084f..869e18f25 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -70,7 +70,6 @@ namespace mss namespace nvdimm { - /// /// @brief Wrapper to read MAINT_ADDR_MODE_EN /// Specialization for TARGET_TYPE_MCA @@ -593,6 +592,7 @@ template<> fapi2::ReturnCode post_restore_transition( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target ) { mss::states l_maint_addr_enabled = mss::states::LOW; + mss::states l_refresh_overrun_mask = mss::states::OFF; const bool NVDIMM_WORKAROUND = true; FAPI_TRY(get_maint_addr_mode_en(i_target, l_maint_addr_enabled)); @@ -604,6 +604,10 @@ fapi2::ReturnCode post_restore_transition( const fapi2::Target<fapi2::TARGET_TYP FAPI_TRY(change_maint_addr_mode_en(i_target, mss::states::LOW)); } + // Save the current mask value and mask the refresh overrun error + FAPI_TRY(get_refresh_overrun_mask(i_target, l_refresh_overrun_mask)); + FAPI_TRY(change_refresh_overrun_mask(i_target, mss::states::ON)); + // Restore the rcd FAPI_TRY( rcd_restore( i_target ) ); @@ -619,9 +623,13 @@ fapi2::ReturnCode post_restore_transition( const fapi2::Target<fapi2::TARGET_TYP // Latch in the rank averaged vref value FAPI_TRY(wr_vref_latch(i_target)); - //Restore main_addr_mode_en to previous setting + // Restore main_addr_mode_en to previous setting FAPI_TRY(change_maint_addr_mode_en(i_target, l_maint_addr_enabled)); + // Restore the refresh overrun mask to previous and clear the fir + FAPI_TRY(clear_refresh_overrun_fir(i_target)); + FAPI_TRY(change_refresh_overrun_mask(i_target, l_refresh_overrun_mask)); + fapi_try_exit: return fapi2::current_err; } diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H index 5df44c13c..a3c4914a4 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -38,12 +38,79 @@ #include <lib/shared/mss_const.H> #include <lib/ccs/ccs.H> #include <lib/phy/dp16.H> +#include <lib/mc/port.H> namespace mss { namespace nvdimm { +/// +/// @brief get refresh overrun fir mask +/// @param[in] i_target the target associated with this subroutine +/// @param[out] i_state the state to change to +/// @return FAPI2_RC_SUCCESS iff setup was successful +/// +inline fapi2::ReturnCode get_refresh_overrun_mask( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, + mss::states& o_state ) +{ + typedef portTraits<mss::mc_type::NIMBUS> TT; + fapi2::buffer<uint64_t> l_data; + + FAPI_TRY( mss::getScom(i_target, TT::CALFIRMASK, l_data), + "%s Failed getScom", mss::c_str(i_target) ); + + o_state = l_data.getBit<TT::CALFIRMASK_REFRESH_OVERRUN>() ? mss::states::ON : mss::states::OFF; + +fapi_try_exit: + return fapi2::current_err; +} + +/// +/// @brief change refresh overrun fir mask +/// @param[in] i_target the target associated with this subroutine +/// @param[in] i_state the state to change to +/// @return FAPI2_RC_SUCCESS iff setup was successful +/// +inline fapi2::ReturnCode change_refresh_overrun_mask( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, + const mss::states i_state ) +{ + typedef portTraits<mss::mc_type::NIMBUS> TT; + fapi2::buffer<uint64_t> l_data; + + FAPI_TRY( mss::getScom(i_target, TT::CALFIRMASK, l_data), + "%s Failed getScom", mss::c_str(i_target) ); + + l_data.writeBit<TT::CALFIRMASK_REFRESH_OVERRUN>(i_state); + + FAPI_TRY( mss::putScom(i_target, TT::CALFIRMASK, l_data), + "%s Failed putScom", mss::c_str(i_target) ); + +fapi_try_exit: + return fapi2::current_err; +} + +/// +/// @brief Clear the refresh overrun fir +/// @param[in] i_target the target associated with this subroutine +/// @return FAPI2_RC_SUCCESS iff setup was successful +/// +inline fapi2::ReturnCode clear_refresh_overrun_fir( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target ) +{ + typedef portTraits<mss::mc_type::NIMBUS> TT; + fapi2::buffer<uint64_t> l_data; + + FAPI_TRY( mss::getScom(i_target, TT::CALFIRQ, l_data), + "%s Failed getScom", mss::c_str(i_target) ); + + l_data.clearBit<TT::CALFIRQ_REFRESH_OVERRUN>(); + + FAPI_TRY( mss::putScom(i_target, TT::CALFIRQ, l_data), + "%s Failed putScom", mss::c_str(i_target) ); + +fapi_try_exit: + return fapi2::current_err; +} /// /// @brief Wrapper to read MAINT_ADDR_MODE_EN |