Skip to content

Commit

Permalink
Fixes tDLLK timing for 2666
Browse files Browse the repository at this point in the history
Change-Id: Iaf4dc6fad2185c784d632004ebae5f1de457920f
CQ:SW417793
RTC:188226
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54264
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+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: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: ANUWAT SAETOW <asaetow@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54278
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>
  • Loading branch information
sglancy6 authored and dcrowell77 committed Feb 25, 2018
1 parent a2c708d commit b5c57af
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -59,6 +59,7 @@ enum functions
TRRD_L_HALF_AND_1KB_PAGE_HELPER = 8,
TRRD_S_HALF_AND_1KB_PAGE_HELPER = 9,
TRRD_S_2KB_PAGE_HELPER = 10,
TDLLK = 11,
};

enum guard_band : uint16_t
Expand Down Expand Up @@ -292,10 +293,38 @@ template< fapi2::TargetType T, typename OT = uint64_t >
inline fapi2::ReturnCode tdllk( const fapi2::Target<T>& i_target, OT& o_value )
{
uint64_t l_freq = 0;
o_value = 854;

// Calculate tDLLK from our MT/s. Magic numbers (in clocks) from the DDR4 spec
FAPI_TRY( mss::freq(mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq) );
o_value = (l_freq < fapi2::ENUM_ATTR_MSS_FREQ_MT2133) ? 597 : 768;

switch(l_freq)
{
case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
o_value = 597;
break;

case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
o_value = 768;
break;


case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
o_value = 854;
break;

default:
FAPI_ASSERT( false,
fapi2::MSS_INVALID_FREQ_PASSED_IN()
.set_FREQ(l_freq)
.set_FUNCTION(TDLLK)
.set_DIMM_TARGET(i_target),
"%s Invalid frequency %lu",
mss::c_str(i_target),
l_freq);
}

return fapi2::FAPI2_RC_SUCCESS;

fapi_try_exit:
Expand Down Expand Up @@ -474,7 +503,7 @@ fapi_try_exit:
template< fapi2::TargetType T >
inline uint64_t twlo_twloe(const fapi2::Target<T>& i_target)
{
// From mthe PHY databook:
// From the PHY databook:
// 12 + std::max((twldqsen - tmod), (twlo - twlow))
// + longest DQS delay in clocks (rounded up) + longest DQ delay in clocks (rounded up)
// Magic numbers taken from talking with Anuwat (twloe) and reviewing the Centaur code (ldq/ldqs)
Expand Down

0 comments on commit b5c57af

Please sign in to comment.