summaryrefslogtreecommitdiffstats
path: root/src/import/generic/memory/lib/spd
diff options
context:
space:
mode:
authorStephen Glancy <sglancy@us.ibm.com>2017-08-18 10:53:44 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-29 11:39:24 -0400
commit2b881ebf90218af1ce41918b214498c2574940e1 (patch)
tree5acce76de62c874ae32eff6c12d3ffa1094fc44f /src/import/generic/memory/lib/spd
parent598111fc4b49f16495b41b8461fc01d49239eb42 (diff)
downloadtalos-hostboot-2b881ebf90218af1ce41918b214498c2574940e1.tar.gz
talos-hostboot-2b881ebf90218af1ce41918b214498c2574940e1.zip
Adds DDR4 hybrid NV-RDIMM support
Change-Id: Ie5cc0ed4dc6337c35df2e222cc4e220e5720f0bd Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44974 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: JACOB L. HARVEY <jlharvey@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45182 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/generic/memory/lib/spd')
-rw-r--r--src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H54
-rw-r--r--src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_0.C39
-rw-r--r--src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_1.C93
-rw-r--r--src/import/generic/memory/lib/spd/common/spd_decoder_base.H22
-rw-r--r--src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.C97
-rw-r--r--src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H11
6 files changed, 68 insertions, 248 deletions
diff --git a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
index 7b4c1c300..0910aa2e0 100644
--- a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
+++ b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
@@ -106,13 +106,7 @@ class decoder_v1_0 : public decoder
// Byte 1 - see factory byte enum
// Byte 2 - Entire byte used
-
- // Byte 3
- HYBRID_MEDIA_START = 1,
- HYBRID_MEDIA_LEN = 3,
-
- HYBRID_START = 0,
- HYBRID_LEN = 1,
+ // Byte 3 - used in the SPD factory
// Byte 4
SDRAM_CAPACITY_START = 4,
@@ -348,8 +342,6 @@ class decoder_v1_0 : public decoder
// Third field is the decoding bit length
static constexpr field_t BYTES_USED{0, BYTES_USED_START, BYTES_USED_LEN};
static constexpr field_t TOTAL_BYTES_USED{0, BYTES_TOTAL_START, BYTES_TOTAL_LEN};
- static constexpr field_t HYBRID_MEDIA{3, HYBRID_MEDIA_START, HYBRID_MEDIA_LEN};
- static constexpr field_t HYBRID{3, HYBRID_START, HYBRID_LEN};
static constexpr field_t SDRAM_CAPACITY{4, SDRAM_CAPACITY_START, SDRAM_CAPACITY_LEN};
static constexpr field_t SDRAM_BANKS{4, SDRAM_BANKS_START, SDRAM_BANKS_LEN};
static constexpr field_t BANK_GROUP{4, BANK_GROUP_START, BANK_GROUP_LEN};
@@ -445,28 +437,6 @@ class decoder_v1_0 : public decoder
virtual fapi2::ReturnCode number_of_total_bytes( uint16_t& o_value ) const override;
///
- /// @brief Decodes hybrid media field from SPD
- /// @param[out] o_value
- /// @return FAPI2_RC_SUCCESS if okay
- /// @note Decodes SPD Byte 3 (bits 6~4)
- /// @note Item JC-45-2220.01x
- /// @note Page 17
- /// @note DDR4 SPD Document Release 3
- ///
- virtual fapi2::ReturnCode hybrid_media( uint8_t& o_value ) const override;
-
- ///
- /// @brief Decodes hybrid field from SPD
- /// @param[out] o_value
- /// @return FAPI2_RC_SUCCESS if okay
- /// @note Decodes SPD Byte 3 (bit 7)
- /// @note Item JC-45-2220.01x
- /// @note Page 17
- /// @note DDR4 SPD Document Release 3
- ///
- virtual fapi2::ReturnCode hybrid( uint8_t& o_value ) const override;
-
- ///
/// @brief Decodes SDRAM density from SPD
/// @param[out] o_value SDRAM density in GBs
/// @return FAPI2_RC_SUCCESS if okay
@@ -1247,28 +1217,6 @@ class decoder_v1_1 : public decoder_v1_0
/////////////////////////
///
- /// @brief Decodes hybrid media field from SPD
- /// @param[out] o_value
- /// @return FAPI2_RC_SUCCESS if okay
- /// @note Decodes SPD Byte 3 (bits 6~4)
- /// @note Item JC-45-2220.01x
- /// @note Page 17
- /// @note DDR4 SPD Document Release 3
- ///
- virtual fapi2::ReturnCode hybrid_media( uint8_t& o_value) const override;
-
- ///
- /// @brief Decodes hybrid field from SPD
- /// @param[out] o_value
- /// @return FAPI2_RC_SUCCESS if okay
- /// @note Decodes SPD Byte 3 (bit 7)
- /// @note Item JC-45-2220.01x
- /// @note Page 17
- /// @note DDR4 SPD Document Release 3
- ///
- virtual fapi2::ReturnCode hybrid( uint8_t& o_value ) const override;
-
- ///
/// @brief Decodes SDRAM density from SPD
/// @param[out] o_value SDRAM density in GBs
/// @return FAPI2_RC_SUCCESS if okay
diff --git a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_0.C b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_0.C
index 7e7bf4dc7..47071be94 100644
--- a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_0.C
+++ b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_0.C
@@ -172,45 +172,6 @@ fapi_try_exit:
}
///
-/// @brief Decodes hybrid media field from SPD
-/// @param[out] o_value enum representing hybrid memory type
-/// @return FAPI2_RC_SUCCESS if okay
-/// @note Decodes SPD Byte 3 (bits 4~6)
-/// @note Item JC-45-2220.01x
-/// @note Page 17
-/// @note DDR4 SPD Document Release 3
-///
-fapi2::ReturnCode decoder_v1_0::hybrid_media( uint8_t& o_value) const
-{
- // For General Section rev 1.0 of the SPD,
- // Decodes SPD Byte 3 (bits 4~6) were reserved
- // and coded as zeros. There was no concept of hybrid media so this
- // is thus hard-wired to zero.
- o_value = 0x00;
- return fapi2::FAPI2_RC_SUCCESS;
-
-}
-
-///
-/// @brief Decodes hybrid field from SPD
-/// @param[out] o_value enum representing if module is hybrid
-/// @return fapi2::ReturnCode
-/// @note Decodes SPD Byte 3 (bit 7)
-/// @note Item JC-45-2220.01x
-/// @note Page 17
-/// @note DDR4 SPD Document Release 3
-///
-fapi2::ReturnCode decoder_v1_0::hybrid( uint8_t& o_value) const
-{
- // For General Section rev 1.0 of the SPD,
- // Decodes SPD Byte 3 (bit 7) were reserved
- // and coded as zeros. There was no concept of hybrid media so this
- // is thus hard-wired to zero.
- o_value = 0x00;
- return fapi2::FAPI2_RC_SUCCESS;
-}
-
-///
/// @brief Decodes SDRAM density from SPD
/// @param[out] o_value SDRAM density in GBs
/// @return FAPI2_RC_SUCCESS if okay
diff --git a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_1.C b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_1.C
index bc48d326b..76ec727c9 100644
--- a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_1.C
+++ b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4_v1_1.C
@@ -123,99 +123,6 @@ fapi_try_exit:
}
///
-/// @brief Decodes hybrid media field from SPD
-/// @param[in] iv_target
-/// @param[out] o_value enum representing hybrid memory type
-/// @return FAPI2_RC_SUCCESS if okay
-/// @note Decodes SPD Byte 3 (bits 4~6)
-/// @note Item JC-45-2220.01x
-/// @note Page 17
-/// @note DDR4 SPD Document Release 3
-///
-fapi2::ReturnCode decoder_v1_1::hybrid_media( uint8_t& o_value ) const
-{
- // =========================================================
- // Byte 3 maps
- // Item JC-45-2220.01x
- // Page 17
- // DDR4 SPD Document Release 3
- // Byte 3 (0x003): Key Byte / Module Type
- // =========================================================
- static const std::vector<std::pair<uint8_t, uint8_t> > HYBRID_MEDIA_MAP =
- {
- //{key, value}
- {0, fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NONE},
- {1, fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM}
- };
-
- // Extracting desired bits
- const uint8_t l_field_bits = extract_spd_field< HYBRID_MEDIA >(iv_target, iv_spd_data);
- FAPI_DBG("Field Bits value: %d", l_field_bits);
-
- // Find map value
- bool l_is_val_found = mss::find_value_from_key(HYBRID_MEDIA_MAP, l_field_bits, o_value);
-
- FAPI_TRY( mss::check::spd::fail_for_invalid_value(iv_target,
- l_is_val_found,
- HYBRID_MEDIA.iv_byte,
- l_field_bits,
- "Failed check on Hybrid Media type") );
-
- FAPI_INF("%s. Hybrid Media: %d",
- mss::c_str(iv_target),
- o_value);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Decodes hybrid field from SPD
-/// @param[out] o_value enum representing if module is hybrid
-/// @return fapi2::FAPI2_RC_SUCCESS if okay
-/// @note Decodes SPD Byte 3 (bit 7)
-/// @note Item JC-45-2220.01x
-/// @note Page 17
-/// @note DDR4 SPD Document Release 3
-///
-fapi2::ReturnCode decoder_v1_1::hybrid( uint8_t& o_value ) const
-{
- // =========================================================
- // Byte 3 maps
- // Item JC-45-2220.01x
- // Page 17
- // DDR4 SPD Document Release 3
- // Byte 3 (0x003): Key Byte / Module Type
- // =========================================================
- static const std::vector<std::pair<uint8_t, uint8_t> > HYBRID_MAP =
- {
- //{key byte, value}
- {0, fapi2::ENUM_ATTR_EFF_HYBRID_NOT_HYBRID},
- {1, fapi2::ENUM_ATTR_EFF_HYBRID_IS_HYBRID}
- };
-
- // Extracting desired bits
- const uint8_t l_field_bits = extract_spd_field< HYBRID >(iv_target, iv_spd_data);
- FAPI_INF("Field_Bits value: %d", l_field_bits);
-
- // Find map value
- bool l_is_val_found = mss::find_value_from_key(HYBRID_MAP, l_field_bits, o_value);
-
- FAPI_TRY( mss::check::spd::fail_for_invalid_value(iv_target,
- l_is_val_found,
- HYBRID.iv_byte,
- l_field_bits,
- "Failed check on hybrid field") );
-
- FAPI_INF("%s. Hybrid: %d",
- mss::c_str(iv_target),
- o_value);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
/// @brief Decodes Secondary SDRAM signal loading
/// @param[out] o_value enum representing signal loading type
/// @return FAPI2_RC_SUCCESS if okay
diff --git a/src/import/generic/memory/lib/spd/common/spd_decoder_base.H b/src/import/generic/memory/lib/spd/common/spd_decoder_base.H
index 76594ba66..84bac2be6 100644
--- a/src/import/generic/memory/lib/spd/common/spd_decoder_base.H
+++ b/src/import/generic/memory/lib/spd/common/spd_decoder_base.H
@@ -188,28 +188,6 @@ class decoder
}
///
- /// @brief Decodes hybrid media field from SPD
- /// @param[out] o_value hybrid media decoding
- /// @return FAPI2_RC_SUCCESS if okay
- ///
- virtual fapi2::ReturnCode hybrid_media( uint8_t& o_value ) const
- {
- o_value = 0;
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- ///
- /// @brief Decodes hybrid field from SPD
- /// @param[out] o_value hybrid decoding
- /// @return FAPI2_RC_SUCCESS if okay
- ///
- virtual fapi2::ReturnCode hybrid( uint8_t& o_value ) const
- {
- o_value = 0;
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- ///
/// @brief Decodes SDRAM density from SPD
/// @param[out] o_value SDRAM density in GBs
/// @return FAPI2_RC_SUCCESS if okay
diff --git a/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.C b/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.C
index f6911aa5d..505c7873d 100644
--- a/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.C
+++ b/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.C
@@ -47,45 +47,6 @@ namespace mss
{
///
-/// @brief raw card C1 settings
-///
-rcw_settings rdimm_rc_c1( 0x02, // RC00
- 0x0C, // RC01
- 0x0F, // RC06_07
- 0x0C, // RC09
- 0x0E, // RC0B
- 0x00, // RC0C
- 0x00, // RC0F
- 0x00, // RC1X
- 0x00, // RC2X
- 0x00, // RC4X
- 0x00, // RC5X
- 0x00, // RC6X
- 0x00, // RC8X
- 0x00, // RC9X
- 0x00); // RCAX
-
-///
-/// @brief raw card C2 settings
-/// @note same settings as C1
-///
-rcw_settings rdimm_rc_c2( 0x02, // RC00
- 0x0C, // RC01
- 0x0F, // RC06_07
- 0x0C, // RC09
- 0x0E, // RC0B
- 0x00, // RC0C
- 0x00, // RC0F
- 0x00, // RC1X
- 0x00, // RC2X
- 0x00, // RC4X
- 0x00, // RC5X
- 0x00, // RC6X
- 0x00, // RC8X
- 0x00, // RC9X
- 0x00); // RCAX
-
-///
/// @brief raw card A1 settings
///
rcw_settings rdimm_rc_a1( 0x02, // RC00
@@ -144,6 +105,44 @@ rcw_settings rdimm_rc_b2( 0x02, // RC00
0x00, // RC9X
0x00);// RCAX
+///
+/// @brief raw card C1 settings
+///
+rcw_settings rdimm_rc_c1( 0x02, // RC00
+ 0x0C, // RC01
+ 0x0F, // RC06_07
+ 0x0C, // RC09
+ 0x0E, // RC0B
+ 0x00, // RC0C
+ 0x00, // RC0F
+ 0x00, // RC1X
+ 0x00, // RC2X
+ 0x00, // RC4X
+ 0x00, // RC5X
+ 0x00, // RC6X
+ 0x00, // RC8X
+ 0x00, // RC9X
+ 0x00); // RCAX
+
+///
+/// @brief raw card C2 settings
+/// @note same settings as C1
+///
+rcw_settings rdimm_rc_c2( 0x02, // RC00
+ 0x0C, // RC01
+ 0x0F, // RC06_07
+ 0x0C, // RC09
+ 0x0E, // RC0B
+ 0x00, // RC0C
+ 0x00, // RC0F
+ 0x00, // RC1X
+ 0x00, // RC2X
+ 0x00, // RC4X
+ 0x00, // RC5X
+ 0x00, // RC6X
+ 0x00, // RC8X
+ 0x00, // RC9X
+ 0x00); // RCAX
////
/// @brief raw card for custom dimms
@@ -164,6 +163,24 @@ rcw_settings rdimm_rc_custom ( 0x02, // RC00
0x00, // RC9X
0x00);// RCAX
+////
+/// @brief raw card for NVDIMMs
+///
+rcw_settings rdimm_rc_nvdimm ( 0x00, // RC00
+ 0x00, // RC01
+ 0x0F, // RC06_07
+ 0x00, // RC09
+ 0x0E, // RC0B
+ 0x00, // RC0C
+ 0x00, // RC0F
+ 0x00, // RC1X
+ 0x00, // RC2X
+ 0x00, // RC4X
+ 0x00, // RC5X
+ 0x00, // RC6X
+ 0x00, // RC8X
+ 0x00, // RC9X
+ 0x00); // RCAX
///
/// @brief raw card VBU settings
@@ -192,6 +209,8 @@ const std::vector< std::pair< uint8_t , rcw_settings> > RAW_CARDS =
// I expect this to grow as Warren M. expects us to have
// settings for every raw card that JEDEC puts out. Openpower
// can't break due to a missing raw card...
+ // Note: This list needs to be kept in numerical order of the raw_card_rev
+ {raw_card_rev::NVDIMM, rdimm_rc_nvdimm},
{raw_card_rev::A1, rdimm_rc_a1},
{raw_card_rev::B1, rdimm_rc_b1},
{raw_card_rev::C1, rdimm_rc_c1},
diff --git a/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H b/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H
index b130de1b9..85205544e 100644
--- a/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H
+++ b/src/import/generic/memory/lib/spd/rdimm/ddr4/rdimm_raw_cards.H
@@ -52,6 +52,11 @@ namespace rdimm
///
enum raw_card_rev : uint8_t
{
+
+ // TODO:RTC178807 - Update how NVDIMMs are handled once more are up and running in the lab
+ // NVDIMM's have the same RC value as custom DIMMs, but are defined by SPD byte 03 differently
+ NVDIMM = 0x1F,
+
A1 = 0x20,
B1 = 0x21,
@@ -76,12 +81,14 @@ extern const std::vector< std::pair< uint8_t, rcw_settings> > RAW_CARDS;
}// rdimm
// Exposed so we can test them.
-extern rcw_settings rdimm_rc_c1;
-extern rcw_settings rdimm_rc_c2;
+// Alphabetized list below
extern rcw_settings rdimm_rc_a1;
extern rcw_settings rdimm_rc_b1;
extern rcw_settings rdimm_rc_b2;
+extern rcw_settings rdimm_rc_c1;
+extern rcw_settings rdimm_rc_c2;
extern rcw_settings rdimm_rc_custom;
+extern rcw_settings rdimm_rc_nvdimm;
extern rcw_settings rdimm_rc_vbu;
}// mss
OpenPOWER on IntegriCloud