From a698bf0c35ba5250d35c0a5fa86faa031c04edf5 Mon Sep 17 00:00:00 2001 From: Brian Silver Date: Mon, 31 Oct 2016 06:52:07 -0500 Subject: Add raw card A1 (0x20) to SPD processing Add raw card unit ctor unit test Change-Id: I95b35e4e779b3453023c7d00c5cabf3304c57503 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32010 Dev-Ready: Brian R. Silver Tested-by: Jenkins Server Reviewed-by: JACOB L. HARVEY Tested-by: Hostboot CI Reviewed-by: ANDRE A. MARIN Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32024 Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Reviewed-by: Christian R. Geddes --- .../hwp/memory/lib/spd/common/raw_cards.C | 44 +++++++++++++--------- .../hwp/memory/lib/spd/common/raw_cards.H | 37 ++++++++++++++++++ .../procedures/hwp/memory/p9_mss_ddr_phy_reset.C | 1 + 3 files changed, 65 insertions(+), 17 deletions(-) (limited to 'src/import/chips/p9/procedures') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.C index e7d32d454..6d6fcf445 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.C @@ -47,23 +47,6 @@ namespace mss namespace rcd01 { -enum raw_card_rev : uint8_t -{ - // TODO RTC:160116 Fill in valid RCD data for LRDIMM - B0 = 0x01, - - // RDIMM power-on - C1 = 0x22, - - // TK - Change to 0xFF - AAM - // In the spec hex XF (where X - don't care) - // means no JEDEC reference raw card design used. - // We will want to redefine it to be VBU reference raw card - // since it is unlikely we will use a DIMM w/o a - // reference caw card design. - VBU = 0x23, -}; - /// /// @brief raw card B0 settings /// @@ -111,6 +94,29 @@ raw_card_t raw_card_c1( 0x00, // RC00 0x00, // RCAX 0x07);// RCBX +/// +/// @brief raw card A1 settings +/// +raw_card_t raw_card_a1( 0x00, // RC00 + 0x00, // RC01 (C might be the right answer?) + 0x00, // RC02 + 0x0F, // RC06_07 + 0x03, // RC08 + 0x00, // RC09 + 0x0E, // RC0B + 0x00, // RC0C + 0x0D, // RC0E + 0x00, // RC0F + 0x00, // RC1X + 0x00, // RC2X + 0x00, // RC4X + 0x00, // RC5X + 0x00, // RC6X + 0x00, // RC8X + 0x00, // RC9X + 0x00, // RCAX + 0x07);// RCBX + /// /// @brief raw card VBU settings /// @@ -138,9 +144,13 @@ raw_card_t raw_card_vbu( 0x00, // RC00 // TODO - RTC:160121 Catch all for adding raw card data for DIMMs // Not sure if we can have the same raw card revision for rcd01 and rcd02, // if not, then we can move this vector outside of the rcd01 namespace. +// +// !! WARNING: THIS VECTOR MUST BE SORTED BY ENUM VALUE!! +// const std::vector< std::pair< uint8_t , rcd01::raw_card_t> > RAW_CARDS = { {raw_card_rev::B0, rcd01::raw_card_b0}, + {raw_card_rev::A1, rcd01::raw_card_a1}, {raw_card_rev::C1, rcd01::raw_card_c1}, {raw_card_rev::VBU, rcd01::raw_card_vbu}, }; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.H b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.H index a32fa3534..df0fc9d85 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.H @@ -44,6 +44,26 @@ namespace mss namespace rcd01 { +// In the order of the vector below which needs to be sorted by enum value +enum raw_card_rev : uint8_t +{ + // TODO RTC:160116 Fill in valid RCD data for LRDIMM + B0 = 0x01, + + A1 = 0x20, + + // RDIMM power-on + C1 = 0x22, + + // TK - Change to 0xFF - AAM + // In the spec hex XF (where X - don't care) + // means no JEDEC reference raw card design used. + // We will want to redefine it to be VBU reference raw card + // since it is unlikely we will use a DIMM w/o a + // reference caw card design. + VBU = 0x23, +}; + /// /// @brief raw card VBU settings /// @note contains RCD settings for hard-coded values @@ -76,6 +96,17 @@ struct raw_card_t /// raw_card_t() = default; + /// + /// @brief Equality operator + /// @param[in] i_rhs the right-hand side of the == operation + /// @return true iff both raw_cards are equal + /// + inline bool operator==(const raw_card_t& i_rhs) const + { + // Betting this is faster than all the conditionals ... + return (memcmp(this, &i_rhs, sizeof(raw_card_t)) == 0); + } + /// /// @brief ctor /// @param[in] i_rc00 setting for register control word (RC00) @@ -144,6 +175,12 @@ struct raw_card_t ~raw_card_t() = default; }; +// Exposed so we can test them. +extern raw_card_t raw_card_b0; +extern raw_card_t raw_card_c1; +extern raw_card_t raw_card_a1; +extern raw_card_t raw_card_vbu; + extern const std::vector< std::pair< uint8_t, rcd01::raw_card_t> > RAW_CARDS; }// rcd01 diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C index 8c0929baf..741d6dc0d 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C @@ -42,6 +42,7 @@ #include #include #include +#include using fapi2::TARGET_TYPE_MCBIST; -- cgit v1.2.1