diff options
author | Brian Silver <bsilver@us.ibm.com> | 2016-08-25 09:41:08 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2016-09-03 11:57:03 -0400 |
commit | 945d73f8dd0053c2a9929d4adabc46b5f3edd819 (patch) | |
tree | b170cc830364031755bd4810c1807353efb64c81 /src/import/chips/p9/procedures/hwp/memory/lib/utils/conversions.H | |
parent | dda93451aa288f2d4b2c1f96f4e003377588236b (diff) | |
download | talos-hostboot-945d73f8dd0053c2a9929d4adabc46b5f3edd819.tar.gz talos-hostboot-945d73f8dd0053c2a9929d4adabc46b5f3edd819.zip |
Changes related to PHY register review
Remove slew_cal.C as it's not needed in Nimbus
Verify sysclk pr is proper when not in sim
Add timing values which are needed for PHY SEQ config
Aggregate other memory timing parameters into timing.H
Change-Id: I4c5374df8693f6a6be7ba0a1d741eaf3929b6f92
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29045
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29185
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@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.H | 31 |
1 files changed, 19 insertions, 12 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 9076f97ee..c7a3589b7 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 @@ -186,6 +186,12 @@ inline uint64_t ps_to_cycles(const fapi2::Target<T>& i_target, const uint64_t i_ FAPI_TRY( mss::freq( find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq) ); + // No time if MT/s is 0 (well, infinite really but shut up) + if (l_freq == 0) + { + return 0; + } + // Hoping the compiler figures out how to do these together. FAPI_TRY( freq_to_ps(l_freq, l_divisor) ); l_quotient = i_ps / ((l_divisor == 0) ? 1 : l_divisor); @@ -312,18 +318,6 @@ inline uint64_t cycles_to_us(const fapi2::Target<T>& i_target, const uint64_t i_ } /// -/// @brief Calculate TWLO_TWLOE - this needs to go in to eff_config and be an attribute -/// @tparam T fapi2::TargetType of the target used to calculate cycles from ns -/// @param[in] i_target the target used to get DIMM clocks -/// @return uint64_t, TWLO_TWLOE in cycles -/// -template< fapi2::TargetType T > -inline uint64_t twlo_twloe(const fapi2::Target<T>& i_target) -{ - return 12 + mss::ns_to_cycles(i_target, tWLO - tWLOE); -} - -/// /// @brief Convert nanoseconds to picoseconds /// @tparam T input and output type /// @param[in] i_time_in_ns time in nanoseconds @@ -352,6 +346,19 @@ inline T ps_to_ns(const T i_time_in_ps) return l_time_in_ns + ( remainder == 0 ? 0 : 1 ); } +/// +/// @brief Return the maximum of two values *in clocks*, the first in clocks the second in ns +/// @tparam T the fapi2::TargetType of a type from which we can get MT/s +/// @param[in] i_clocks a value in clocks +/// @param[in] i_time a value in nanoseconds +/// @return max( iclocks nCK, i_time ) in clocks +/// +template< fapi2::TargetType T > +inline uint64_t max_ck_ns(const fapi2::Target<T>& i_target, const uint64_t i_clocks, const uint64_t i_time) +{ + return std::max( i_clocks, ns_to_cycles(i_target, i_time) ); +} + };// mss namespace |