From a86d8531ce08dfc5149aa45491a9f3bb079be5cb Mon Sep 17 00:00:00 2001 From: Louis Stermole Date: Mon, 22 Aug 2016 14:30:14 -0500 Subject: Add AC BOOST API function with dp instance as parameter Change-Id: I1ade3bb2a24deb20d3f874e8a4606947755bd379 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28633 Tested-by: Jenkins Server Reviewed-by: STEPHEN GLANCY Tested-by: Hostboot CI Reviewed-by: Brian R. Silver Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28635 Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes --- .../chips/p9/procedures/hwp/memory/lib/phy/dp16.H | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'src/import/chips/p9/procedures/hwp/memory') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H index b2c7b98c6..a2832ad5a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H @@ -286,6 +286,43 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Read AC_BOOST_CNTL +/// @tparam T fapi2 Target Type - derived +/// @tparam P the type of the std::pair elements +/// @tparam TT traits type defaults to dp16Traits +/// @param[in] i_target the fapi2 target of the port +/// @param[in] i_dp the dp16 instance's index +/// @param[out] o_data the value of both of the the registers (upper and lower bytes) +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok +/// +template< fapi2::TargetType T, typename P, typename TT = dp16Traits > +inline fapi2::ReturnCode read_ac_boost_cntl( const fapi2::Target& i_target, + const uint64_t i_dp, + std::pair& o_data ) +{ + switch (i_dp) + { + case(0): + return ( read_ac_boost_cntl<0>( i_target, o_data ) ); + + case(1): + return ( read_ac_boost_cntl<1>( i_target, o_data ) ); + + case(2): + return ( read_ac_boost_cntl<2>( i_target, o_data ) ); + + case(3): + return ( read_ac_boost_cntl<3>( i_target, o_data ) ); + + case(4): + return ( read_ac_boost_cntl<4>( i_target, o_data ) ); + + default: + return fapi2::FAPI2_RC_INVALID_PARAMETER; + } +} + /// /// @brief Write AC_BOOST_CNTL /// @tparam I DP16 instance @@ -311,6 +348,43 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Write AC_BOOST_CNTL +/// @tparam T fapi2 Target Type - derived +/// @tparam P the type of the std::pair elements +/// @tparam TT traits type defaults to dp16Traits +/// @param[in] i_target the fapi2 target of the port +/// @param[in] i_dp the dp16 instance's index +/// @param[in] i_data the value of both of the the registers (upper and lower bytes) +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok +/// +template< fapi2::TargetType T, typename P, typename TT = dp16Traits > +inline fapi2::ReturnCode write_ac_boost_cntl( const fapi2::Target& i_target, + const uint64_t i_dp, + const std::pair& i_data ) +{ + switch (i_dp) + { + case(0): + return ( write_ac_boost_cntl<0>( i_target, i_data ) ); + + case(1): + return ( write_ac_boost_cntl<1>( i_target, i_data ) ); + + case(2): + return ( write_ac_boost_cntl<2>( i_target, i_data ) ); + + case(3): + return ( write_ac_boost_cntl<3>( i_target, i_data ) ); + + case(4): + return ( write_ac_boost_cntl<4>( i_target, i_data ) ); + + default: + return fapi2::FAPI2_RC_INVALID_PARAMETER; + } +} + /// /// @brief Reset AC_BOOST_CNTL - for all DP16 in the target /// @tparam T fapi2 Target Type - derived -- cgit v1.2.1