summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
index 89c00b0b8..2b809d3fa 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
@@ -4704,6 +4704,47 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief Gets the write vref registers by rank pair
+/// @param[in] i_rp - rank pair, to make sure the dram and rp are within bounds
+/// @param[out] o_regs - the dp16 wr_vref registers for the rank pair
+///
+fapi2::ReturnCode get_wr_vref_regs_by_rp(const uint64_t i_rp,
+ std::vector<std::pair<uint64_t, uint64_t>>& o_reg)
+{
+ typedef dp16Traits<fapi2::TARGET_TYPE_MCA> TT;
+
+ switch (i_rp)
+ {
+ case 0:
+ o_reg = TT::WR_VREF_VALUE_RP0_REG;
+ break;
+
+ case 1:
+ o_reg = TT::WR_VREF_VALUE_RP1_REG;
+ break;
+
+ case 2:
+ o_reg = TT::WR_VREF_VALUE_RP2_REG;
+ break;
+
+ case 3:
+ o_reg = TT::WR_VREF_VALUE_RP3_REG;
+ break;
+
+ default:
+ FAPI_ASSERT( false,
+ fapi2::MSS_RP_OUT_OF_RANGE()
+ .set_RP(i_rp),
+ "RP out of range %d",
+ i_rp);
+ break;
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
} // close namespace wr_vref
} // close namespace dp16
OpenPOWER on IntegriCloud