summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/workarounds
diff options
context:
space:
mode:
authorLouis Stermole <stermole@us.ibm.com>2018-02-01 15:40:03 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-02-25 22:13:32 -0500
commitd64041888fed00dca09fc88ecc4efab6d30aa34e (patch)
treec414d2f3d7ed91dba9ce594fb449f2c42508af33 /src/import/chips/p9/procedures/hwp/memory/lib/workarounds
parentdef84fb4f7405be98194198ad404217ee21ab321 (diff)
downloadtalos-hostboot-d64041888fed00dca09fc88ecc4efab6d30aa34e.tar.gz
talos-hostboot-d64041888fed00dca09fc88ecc4efab6d30aa34e.zip
Add callout for when the DIMM to NEST freq ratio exceeds 1.5
Change-Id: I4d3e9db7d6bc6900b518397d41e87890dc1d5b0f CQ: SW416091 RTC: 186535 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53226 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53239 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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/workarounds')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.C79
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.H35
2 files changed, 114 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.C
index 96bb34185..40b6ed54c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.C
@@ -22,3 +22,82 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file workarounds/freq_workarounds.C
+/// @brief Frequency related workarounds
+///
+// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+
+#include <mss.H>
+#include <lib/workarounds/freq_workarounds.H>
+#include <lib/utils/assert_noexit.H>
+
+namespace mss
+{
+
+namespace workarounds
+{
+
+///
+/// @brief Ensures the ratio between DIMM and NEST frequencies is within allowable limit
+/// @param[in] i_target - the MCBIST target to check
+/// @param[in] i_dimm_speed - dimm speed in MT/s
+/// @param[in] i_nest_freq - nest freq in MHz
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+fapi2::ReturnCode check_dimm_nest_freq_ratio( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const uint64_t i_dimm_speed,
+ const uint32_t i_nest_freq )
+{
+ constexpr double MAX_MEM_NEST_FREQ_RATIO = 1.5;
+ double l_ratio = 0;
+
+ FAPI_INF("%s Checking the MEM to NEST frequency ratio versus the allowed limit", mss::c_str(i_target));
+
+ // Protect against nest_freq == 0 (divide by zero)
+ // This should never happen, so do a code callout
+ FAPI_ASSERT((i_nest_freq != 0) && (i_dimm_speed != 0),
+ fapi2::MSS_FREQ_OR_NEST_FREQ_IS_ZERO()
+ .set_MSS_FREQ(i_dimm_speed)
+ .set_NEST_FREQ(i_nest_freq),
+ "%s saw a zero memory or nest frequency when checking mem to nest freq ratio: mss: %d, nest: %d",
+ mss::c_str(i_target),
+ i_dimm_speed,
+ i_nest_freq);
+
+ // Check limit
+ l_ratio = static_cast<double>(i_dimm_speed) / static_cast<double>(i_nest_freq);
+ FAPI_INF("l_ratio = %f, max_ratio = %f", l_ratio, MAX_MEM_NEST_FREQ_RATIO);
+
+ if (l_ratio > MAX_MEM_NEST_FREQ_RATIO)
+ {
+ // Deconfigure MCSes
+ for ( const auto& l_mcs : mss::find_targets<fapi2::TARGET_TYPE_MCS>(i_target) )
+ {
+ MSS_ASSERT_NOEXIT(false,
+ fapi2::MSS_FREQ_TO_NEST_FREQ_RATIO_TOO_LARGE()
+ .set_MSS_FREQ(i_dimm_speed)
+ .set_NEST_FREQ(i_nest_freq)
+ .set_MCS_TARGET(l_mcs),
+ "Deconfiguring %s due to the memory to nest frequency ratio being too large: mss: %d, nest: %d, ratio: %f",
+ mss::c_str(l_mcs),
+ i_dimm_speed,
+ i_nest_freq,
+ l_ratio);
+ }
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+} // namespace workarounds
+
+} // namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.H
index 2c3d6b269..ac8afcb86 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/freq_workarounds.H
@@ -22,3 +22,38 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file workarounds/freq_workarounds.H
+/// @brief Frequency related workarounds
+///
+// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+
+#include <mss.H>
+
+namespace mss
+{
+
+namespace workarounds
+{
+
+///
+/// @brief Ensures the ratio between DIMM and NEST frequencies is within allowable limit
+/// @param[in] i_target - the MCBIST target to check
+/// @param[in] i_dimm_speed - dimm speed in MT/s
+/// @param[in] i_nest_freq - nest freq in MHz
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+fapi2::ReturnCode check_dimm_nest_freq_ratio( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const uint64_t i_dimm_speed,
+ const uint32_t i_nest_freq );
+
+} // namespace workarounds
+
+} // namespace mss
OpenPOWER on IntegriCloud