Skip to content

Commit

Permalink
Add FORCE_FIFO_CAPTURE API and UTs. scominit cleanup.
Browse files Browse the repository at this point in the history
Change-Id: I26fe63dee8e16a331131d1db359909b2d57a506a
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33817
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Reviewed-by: JACOB L. HARVEY <jlharvey@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33821
Tested-by: Jenkins OP Build CI <op-jenkins+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>
  • Loading branch information
aamarin authored and dcrowell77 committed Jan 30, 2017
1 parent 108b2c6 commit f749a66
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 6 deletions.
35 changes: 34 additions & 1 deletion src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -2435,5 +2435,38 @@ fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Write FORCE_FIFO_CAPTURE
/// Force DQ capture in Read FIFO to support DDR4 LRDIMM calibration
/// @param[in] i_target the fapi2 target of the port
/// @param[in] i_state mss::states::ON or mss::states::OFF
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
///
template<>
fapi2::ReturnCode write_force_fifo_capture( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const mss::states i_state)
{
// TK - Some functions have vector as part of the trait class
// while others have within the function <shrug> - AAM
static const std::vector< uint64_t > l_addr
{
MCA_DDRPHY_DP16_RD_DIA_CONFIG5_P0_0,
MCA_DDRPHY_DP16_RD_DIA_CONFIG5_P0_1,
MCA_DDRPHY_DP16_RD_DIA_CONFIG5_P0_2,
MCA_DDRPHY_DP16_RD_DIA_CONFIG5_P0_3,
MCA_DDRPHY_DP16_RD_DIA_CONFIG5_P0_4,
};

typedef dp16Traits<TARGET_TYPE_MCA> TT;
fapi2::buffer<uint64_t> l_data;

l_data.writeBit<TT::FORCE_FIFO_CAPTURE>(i_state);

FAPI_TRY( mss::scom_blastah(i_target, l_addr, l_data) );

fapi_try_exit:
return fapi2::current_err;
}

} // close namespace dp16
} // close namespace mss
18 changes: 17 additions & 1 deletion src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -305,6 +305,9 @@ class dp16Traits<fapi2::TARGET_TYPE_MCA>
READ_OFFSET_LOWER_LEN = MCA_DDRPHY_DP16_READ_DELAY_OFFSET0_RANK_PAIR0_P0_0_01_LEN,
READ_OFFSET_UPPER = MCA_DDRPHY_DP16_READ_DELAY_OFFSET0_RANK_PAIR0_P0_0_01_OFFSET1,
READ_OFFSET_UPPER_LEN = MCA_DDRPHY_DP16_READ_DELAY_OFFSET0_RANK_PAIR0_P0_0_01_OFFSET1_LEN,

// Read Diagnostic Config 5 (same bit for all MCAs)
FORCE_FIFO_CAPTURE = MCA_DDRPHY_DP16_RD_DIA_CONFIG5_P0_0_01_FORCE_FIFO_CAPTURE,
};
};

Expand Down Expand Up @@ -1757,6 +1760,19 @@ fapi2::ReturnCode process_rdvref_cal_errors( const fapi2::Target<fapi2::TARGET_T
///
fapi2::ReturnCode process_wrvref_cal_errors( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target );

///
/// @brief Write FORCE_FIFO_CAPTURE
/// Force DQ capture in Read FIFO to support DDR4 LRDIMM calibration
/// @tparam T fapi2 Target Type - derived
/// @tparam TT traits type defaults to dp16Traits<T>
/// @param[in] i_target the fapi2 target of the port
/// @param[in] i_state mss::states::ON or mss::states::OFF
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
///
template< fapi2::TargetType T, typename TT = dp16Traits<T> >
fapi2::ReturnCode write_force_fifo_capture( const fapi2::Target<T>& i_target,
const mss::states i_state);

} // close namespace dp16
} // close namespace mss

Expand Down
8 changes: 4 additions & 4 deletions src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -134,7 +134,7 @@ fapi2::ReturnCode scom_blastah( const fapi2::Target<T>& i_target,
{
size_t count(0);

for (auto a : i_addrs)
for (const auto& a : i_addrs)
{
FAPI_TRY( mss::putScom(i_target, a, i_data) );
++count;
Expand Down Expand Up @@ -162,7 +162,7 @@ fapi2::ReturnCode scom_blastah( const std::vector<fapi2::Target<T> >& i_targets,
{
size_t count(0);

for (auto t : i_targets)
for (const auto& t : i_targets)
{
FAPI_TRY( mss::putScom(t, i_addr, i_data) );
++count;
Expand Down Expand Up @@ -190,7 +190,7 @@ fapi2::ReturnCode scom_blastah( const std::vector<fapi2::Target<T> >& i_targets,
{
size_t count(0);

for (auto t : i_targets)
for (const auto& t : i_targets)
{
FAPI_TRY( mss::scom_blastah(t, i_addrs, i_data) );
++count;
Expand Down

0 comments on commit f749a66

Please sign in to comment.