summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2016-11-04 07:42:49 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-11-04 22:21:03 -0400
commit6dbf6c5df5736f4a606c21a7bbd8762f513aa1f5 (patch)
tree92bd3d8c2e15c05f0acfe4cfc5e52cd33a603e48 /src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H
parentc143edcc5c9fa945128d1cf556a7a2636bf436c3 (diff)
downloadtalos-hostboot-6dbf6c5df5736f4a606c21a7bbd8762f513aa1f5.tar.gz
talos-hostboot-6dbf6c5df5736f4a606c21a7bbd8762f513aa1f5.zip
Change lab memory init to poll, remove read phase
Change-Id: Ib4d57ee3b74d482da761f530d1983238dc3094cf Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32239 Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Dev-Ready: Brian R. Silver <bsilver@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32242 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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/utils/conversions.H')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H
index 897d90075..18a0cb429 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H
@@ -362,6 +362,29 @@ inline uint64_t max_ck_ns(const fapi2::Target<T>& i_target, const uint64_t i_clo
return std::max( i_clocks, ns_to_cycles(i_target, i_time) );
}
+///
+/// @brief Return and estimated time an MCBIST subtest will take to complete
+/// Useful for initial polling delays, probably isn't accurate for much else
+/// as it doesn't take refresh in to account (which will necessarily slow down
+/// the program.)
+/// @param[in] i_target the target from which to gather memory frequency
+/// @param[in] i_bytes number of *bytes* in the address range
+/// @param[in] i_64B_per mss::YES if the command is 64B, mss::NO if it's 128B. Defaults to mss::YES
+/// @return the initial polling delay for this program in ns
+///
+template< fapi2::TargetType T >
+inline uint64_t calculate_initial_delay(const fapi2::Target<T>& i_target,
+ const uint64_t i_bytes,
+ const bool i_64B_per = mss::YES)
+{
+ // TODO RTC: 164104 Update MCBIST delay calculator. As we learn more about what
+ // the lab really needs, we can probably make this function better.
+ const uint64_t l_bytes_per_cmd = (i_64B_per == mss::YES) ? 64 : 128;
+
+ // Best case is a command takes 4 cycles. Given the number of commands and address space size
+ // we can get some idea of how long to wait before we start polling.
+ return cycles_to_ns(i_target, (i_bytes / l_bytes_per_cmd) * mss::CYCLES_PER_CMD);
+}
};// mss namespace
OpenPOWER on IntegriCloud