summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTsung Yeung <tyeung@us.ibm.com>2018-10-31 08:57:43 -0400
committerChristian R. Geddes <crgeddes@us.ibm.com>2018-11-02 16:43:59 -0500
commit25102e0add227ca3bd781fe33cb8fba8d65394c3 (patch)
treee7f48a305b7df8080622251966514bba0dc61e48
parent28ee0f739fe2725c7cf4cf599a432fc7f2403e60 (diff)
downloadtalos-hostboot-25102e0add227ca3bd781fe33cb8fba8d65394c3.tar.gz
talos-hostboot-25102e0add227ca3bd781fe33cb8fba8d65394c3.zip
P9: Disable Maint Address Mode After Self-Refresh Exit on NVDIMM
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>
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C26
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H9
2 files changed, 35 insertions, 0 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 81cb6e69d..2c579a4ef 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
@@ -67,6 +67,27 @@ 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
/// Specialization for TARGET_TYPE_MCA
@@ -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));
@@ -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;
}
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 b434abc3b..e6e97759d 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
@@ -43,6 +43,15 @@ 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
/// @param[in] i_target the target associated with this subroutine
OpenPOWER on IntegriCloud