summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory
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
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')
-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
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C11
3 files changed, 124 insertions, 1 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
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C
index ce2bb06e1..a9bed597f 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C
@@ -28,7 +28,7 @@
/// @brief Calculate and save off DIMM frequencies
///
// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
-// *HWP HWP Backup: Jacob Harvey <jlharvey@us.ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
@@ -49,6 +49,7 @@
#include <lib/spd/spd_factory.H>
#include <lib/freq/cas_latency.H>
#include <lib/freq/sync.H>
+#include <lib/workarounds/freq_workarounds.H>
#include <generic/memory/lib/utils/c_str.H>
#include <generic/memory/lib/utils/find.H>
#include <lib/utils/count_dimm.H>
@@ -82,6 +83,9 @@ extern "C"
std::vector< std::vector<uint64_t> > l_min_dimm_freq(mss::MCS_PER_MC, std::vector<uint64_t> (mss::PORTS_PER_MCS, 0) );
std::vector<uint32_t> l_supported_freqs;
+ uint64_t l_mss_freq = 0;
+ uint32_t l_nest_freq = 0;
+
// If there are no DIMM, we can just get out.
if (mss::count_dimm(l_mcbist) == 0)
{
@@ -162,6 +166,11 @@ extern "C"
FAPI_TRY(mss::set_freq_attrs(l_mcbist, l_min_dimm_freq),
"%s. Failed set_freq_attrs()", mss::c_str(i_target) );
+ // Check MEM/NEST frequency ratio
+ FAPI_TRY( mss::freq_pb_mhz(l_nest_freq) );
+ FAPI_TRY( mss::freq(l_mcbist, l_mss_freq) );
+ FAPI_TRY( mss::workarounds::check_dimm_nest_freq_ratio(l_mcbist, l_mss_freq, l_nest_freq) );
+
fapi_try_exit:
return fapi2::current_err;
OpenPOWER on IntegriCloud