From c5c795757a97971ef61548997991880a527122ae Mon Sep 17 00:00:00 2001 From: Jacob Harvey Date: Tue, 16 May 2017 14:57:06 -0500 Subject: Clear DLL CNTL ERROR and FIR bits for workaround Change-Id: Ib9527d5a349806373242100891a3f29741094d55 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40590 Dev-Ready: JACOB L. HARVEY Reviewed-by: Thi N. Tran Reviewed-by: Louis Stermole Reviewed-by: STEPHEN GLANCY Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40599 Reviewed-by: Hostboot Team Tested-by: Jenkins OP Build CI Reviewed-by: Daniel M. Crowell --- .../chips/p9/procedures/hwp/memory/lib/fir/check.C | 1 + .../hwp/memory/lib/workarounds/dll_workarounds.C | 42 ++++++++++++++++++++-- .../hwp/memory/lib/workarounds/dll_workarounds.H | 8 +++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C index 4daa01102..ce0497058 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C @@ -105,6 +105,7 @@ fapi2::ReturnCode during_phy_reset( const fapi2::Target& i_t fapi2::buffer l_phyfir_mask; l_phyfir_mask.setBit() .setBit() + .setBit() .setBit() .setBit() .setBit() diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C index 78b981343..38fe32402 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C @@ -32,9 +32,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -139,6 +141,33 @@ namespace workarounds namespace dll { +/// +/// @brief Clears the DLL firs +/// @param[in] i_target the MCA target +/// @return FAPI2_RC_SUCCESS if the scoms don't fail +/// @note Need to clear the DLL firs when we notice a DLL fail for workarounds +/// +fapi2::ReturnCode clear_dll_fir( const fapi2::Target& i_target ) +{ + fapi2::buffer l_phyfir_data; + + fir::reg l_mca_fir_reg(i_target, fapi2::current_err); + FAPI_TRY(fapi2::current_err, "%s unable to create fir::reg for 0x%016llx", mss::c_str(i_target), + MCA_IOM_PHY0_DDRPHY_FIR_REG); + + FAPI_TRY(l_mca_fir_reg.clear()); // bit 56 + FAPI_TRY(l_mca_fir_reg.clear()); // bit 58 + + FAPI_TRY( mss::getScom(i_target, MCA_IOM_PHY0_DDRPHY_FIR_REG, l_phyfir_data), + "Failed getScom() operation on %s reg 0x%016llx", + mss::c_str(i_target), MCA_IOM_PHY0_DDRPHY_FIR_REG); + + FAPI_INF("%s PHY FIR register is now 0x%016llx", mss::c_str(i_target), l_phyfir_data); + +fapi_try_exit: + return fapi2::current_err; +} + /// /// @brief Checks if CAL_ERROR and CAL_ERROR_FINE bits are set /// @param[in] i_dll_cntrl_data DLL CNTRL data @@ -362,6 +391,7 @@ fapi_try_exit: template< > fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target& i_target) { + constexpr uint64_t SKIP_VREG = 0b10; for( const auto& p : mss::find_targets(i_target) ) @@ -383,13 +413,17 @@ fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target(); + l_read.clearBit(); + + FAPI_DBG("%s new setting for DLL CNTRL register is 0x%016llx", mss::c_str(p), l_read); FAPI_TRY(mss::putScom(p, d, l_read), "Failed putScom() operation on %s reg 0x%016llx", @@ -399,6 +433,8 @@ fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target& i_target ); + /// /// @brief Checks if CAL_ERROR and CAL_ERROR_FINE bits are set /// @param[in] i_dll_cntrl_data DLL CNTRL data -- cgit v1.2.1