summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/spd
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2016-10-31 06:52:07 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2016-11-04 10:32:16 -0400
commita698bf0c35ba5250d35c0a5fa86faa031c04edf5 (patch)
tree4da42b6f4d6274998e6b934f1d21791a3d399323 /src/import/chips/p9/procedures/hwp/memory/lib/spd
parent9a095b1e85c86734d96f75bce0af21c0223d25b5 (diff)
downloadtalos-hostboot-a698bf0c35ba5250d35c0a5fa86faa031c04edf5.tar.gz
talos-hostboot-a698bf0c35ba5250d35c0a5fa86faa031c04edf5.zip
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 <bsilver@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: JACOB L. HARVEY <jlharvey@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32024 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/spd')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.C44
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/common/raw_cards.H37
2 files changed, 64 insertions, 17 deletions
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
///
@@ -112,6 +95,29 @@ raw_card_t raw_card_c1( 0x00, // RC00
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
///
raw_card_t raw_card_vbu( 0x00, // RC00
@@ -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
@@ -77,6 +97,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)
/// @param[in] i_rc01 setting for register control word (RC01)
@@ -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
OpenPOWER on IntegriCloud