From 7f59b42ea81b713c5e3c0cbeed38bd8858aa3ff6 Mon Sep 17 00:00:00 2001 From: Jacob Harvey Date: Tue, 19 Sep 2017 09:57:54 -0500 Subject: Increment red_waterfall for low vdn fix Change-Id: Iaa5dbf94fe223cdfef7ebbfe8598f98f5472c956 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46420 Tested-by: FSP CI Jenkins Dev-Ready: JACOB L. HARVEY Reviewed-by: Louis Stermole Tested-by: Jenkins Server Tested-by: HWSV CI Reviewed-by: STEPHEN GLANCY Tested-by: Hostboot CI Reviewed-by: Matt K. Light Reviewed-by: Daniel M. Crowell Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46455 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: JACOB L. HARVEY --- .../hwp/memory/lib/workarounds/dp16_workarounds.H | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H index 8fdb47f5c..2c9d3872d 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H @@ -196,6 +196,51 @@ void update_blue_waterfall_gate_delay_for_quad(fapi2::buffer& io_water fapi2::ReturnCode fix_blue_waterfall_gate( const fapi2::Target& i_target, const bool i_always_run = false ); +/// +/// @brief Fixes red waterfall values in a port +/// @param[in] i_target - the target to operate on +/// @param[in] i_rp, the rank pair that's being trained +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok +/// +fapi2::ReturnCode fix_red_waterfall_gate( const fapi2::Target& i_target, const uint64_t i_rp); + + +/// +/// @brief Moves the red waterfall forward by one +/// @param[in,out] io_red_waterfall - the red waterfall value +/// +inline void update_red_waterfall(uint64_t& io_red_waterfall) +{ + constexpr uint64_t MAX_RED_WATERFALL_VALUE = 4; + + if (++io_red_waterfall >= MAX_RED_WATERFALL_VALUE) + { + io_red_waterfall = 0; + } +} + +/// +/// @brief Gets the red waterfall and gate delay values for a given DP quad +/// @tparam uint64_t QUAD - which quad to access +/// @param[in,out] io_waterfall_reg - waterfall register data +/// +template< uint64_t QUAD> +void update_red_waterfall_for_quad(fapi2::buffer& io_waterfall_reg) +{ + constexpr uint64_t NUM_QUAD = 4; + // Valid quad values are from 0-3, exit if the requested value is greater + static_assert(QUAD < NUM_QUAD, "Inserted quad value is greater than or equal to 4"); + + // Gets the data for this Quad + auto l_red_waterfall = mss::dp16::get_red_waterfall(io_waterfall_reg); + + // Updates the waterfall and gate delay + update_red_waterfall(l_red_waterfall); + + // Sets the data back into the register + mss::dp16::set_red_waterfall(io_waterfall_reg, l_red_waterfall); +} + /// /// @brief Modifies HW calibration results based upon workarounds /// @param[in] i_target - the target to operate on -- cgit v1.2.1