Skip to content

Commit

Permalink
P9: Disable Maint Address Mode After Self-Refresh Exit on NVDIMM
Browse files Browse the repository at this point in the history
maint_addr_mode is set to enable during self-refresh exit. If the post restore
transition continues with maint_addr_mode enabled, the remaining of the post
restore operations would corrupt the MRS values on other DIMMs on the same
MCBIST

Change-Id: I62dbe4c6f21464e3a777a09c11ed2f03dadb0256
CQ:SW450243
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68213
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: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68237
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>
  • Loading branch information
Tsung Yeung authored and crgeddes committed Nov 2, 2018
1 parent 28ee0f7 commit 25102e0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ namespace mss
namespace nvdimm
{

///
/// @brief Disable maintenance address mode
/// Specialization for TARGET_TYPE_MCBIST
/// @param[in] i_target the target associated with this subroutine
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
template<>
fapi2::ReturnCode maint_addr_mode_off( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
{
typedef mcbistTraits<TARGET_TYPE_MCBIST> TT;
fapi2::buffer<uint64_t> l_data;

FAPI_TRY( mss::getScom(i_target, TT::MCBAGRAQ_REG, l_data), "%s Failed getScom", mss::c_str(i_target) );
l_data.clearBit<TT::MAINT_ADDR_MODE_EN>();

FAPI_TRY( mss::putScom(i_target, TT::MCBAGRAQ_REG, l_data), "%s Failed putScom", mss::c_str(i_target) );

fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Helper for self_refresh_exit(). Uses memdiag to read the port to force
/// CKE back to high. Stolen from mss_lab_memdiags.C
Expand Down Expand Up @@ -172,6 +193,7 @@ template< >
fapi2::ReturnCode self_refresh_exit( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target )
{
fapi2::buffer<uint64_t> l_mbarpc0_data, l_mbastr0_data;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);

// Step 1 - In MBARPC0Q, disable power domain control
FAPI_TRY(mss::mc::read_mbarpc0(i_target, l_mbarpc0_data));
Expand All @@ -186,6 +208,10 @@ fapi2::ReturnCode self_refresh_exit( const fapi2::Target<fapi2::TARGET_TYPE_MCA>
// Step 3 - Run memdiags to read the port to force CKE back to high
FAPI_TRY(self_refresh_exit_helper(i_target));

// maint_addr_mode could be enabled by the helper. Disable it before exiting
// otherwise it will introduce problem to other DIMMs on the same MCBIST
FAPI_TRY(maint_addr_mode_off(l_mcbist));

fapi_try_exit:
return fapi2::current_err;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ namespace mss
namespace nvdimm
{

///
/// @brief Disable maintenance address mode
/// @tparam T the target type associated with this subroutine
/// @param[in] i_target the target associated with this subroutine
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
template< fapi2::TargetType T >
fapi2::ReturnCode maint_addr_mode_off( const fapi2::Target<T>& i_target );

///
/// @brief Helper for self_refresh_exit().
/// @tparam T the target type associated with this subroutine
Expand Down

0 comments on commit 25102e0

Please sign in to comment.