From ff832044c09e8520d1b3475025af09c147b8d813 Mon Sep 17 00:00:00 2001 From: Tsung Yeung Date: Thu, 7 Feb 2019 12:08:29 -0500 Subject: Adjust STR enter sequence to enable immediate entry Change-Id: I4d873164914ae877ceba885f2621f6dc71b97d13 Original-Change-Id: Id6f2e59fbc3feb7cae69e39685b3c183fba6f2a1 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71532 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: PPE CI Tested-by: Hostboot CI Reviewed-by: Louis Stermole Reviewed-by: STEPHEN GLANCY Dev-Ready: STEPHEN GLANCY Reviewed-by: Matt Derksen Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75753 Reviewed-by: Christian R. Geddes Tested-by: Christian R. Geddes --- .../memory/lib/workarounds/nvdimm_workarounds.C | 33 ++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src/import/chips/p9/procedures/hwp') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C index a48bbaa6d..86e2cce75 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C @@ -32,7 +32,7 @@ // *HWP HWP Backup: Stephen Glancy // *HWP Team: Memory // *HWP Level: 3 -// *HWP Consumed by: FSP:HB +// *HWP Consumed by: FSP:SBE #include #include @@ -89,6 +89,13 @@ constexpr const uint64_t FARB5Q_REG[] = MCA_7_MBA_FARB5Q, }; +// MCB_CNTLQ +constexpr const uint64_t MCB_CNTLQ_REG[] = +{ + MCBIST_0_MCB_CNTLQ, + MCBIST_1_MCB_CNTLQ, +}; + constexpr uint8_t PORTS_PER_MODULE = 8; /// @@ -111,22 +118,32 @@ fapi2::ReturnCode self_refresh_entry( const fapi2::Target l_mbarpc0_data, l_mbastr0_data; + fapi2::buffer l_mbarpc0_data, l_mbastr0_data, l_mcbcntlq_data; constexpr uint64_t ENABLE = 1; constexpr uint64_t DISABLE = 0; - constexpr uint64_t MINALL_MAXALL = 0b000; - - // Step 1 - In MBARPC0Q, disable power domain control, set domain to MAXALL_MINALL, - // and enable minimum domain reduction + constexpr uint64_t MAXALL_MIN0 = 0b010; + constexpr uint64_t STOP = 1; + constexpr uint64_t PORTS_PER_MCBIST = 4; + constexpr uint64_t TIME_0 = 0; + const uint8_t l_mcbist = l_mca_pos < PORTS_PER_MCBIST ? 0 : 1; + + // Stop mcbist first otherwise it can kick the DIMM out of STR + FAPI_TRY(fapi2::getScom(i_target, MCB_CNTLQ_REG[l_mcbist], l_mcbcntlq_data)); + l_mcbcntlq_data.writeBit(STOP); + FAPI_TRY(fapi2::putScom(i_target, MCB_CNTLQ_REG[l_mcbist], l_mcbcntlq_data)); + + // Step 1 - In MBARPC0Q, disable power domain control, set domain to MAXALL_MIN0, + // and disable minimum domain reduction (allow immediate entry of STR) FAPI_TRY(fapi2::getScom(i_target, MBARPC0Q_REG[l_mca_pos], l_mbarpc0_data)); l_mbarpc0_data.writeBit(DISABLE); - l_mbarpc0_data.insertFromRight(MINALL_MAXALL); - l_mbarpc0_data.writeBit(ENABLE); + l_mbarpc0_data.insertFromRight(MAXALL_MIN0); + l_mbarpc0_data.writeBit(DISABLE); FAPI_TRY(fapi2::putScom(i_target, MBARPC0Q_REG[l_mca_pos], l_mbarpc0_data)); // Step 2 - In MBASTR0Q, enable STR entry FAPI_TRY(fapi2::getScom(i_target, MBASTR0Q_REG[l_mca_pos], l_mbastr0_data)); l_mbastr0_data.writeBit(ENABLE); + l_mbastr0_data.insertFromRight(TIME_0); FAPI_TRY(fapi2::putScom(i_target, MBASTR0Q_REG[l_mca_pos], l_mbastr0_data)); // Step 3 - In MBARPC0Q, enable power domain control. -- cgit v1.2.1