summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9
diff options
context:
space:
mode:
authorJacob Harvey <jlharvey@us.ibm.com>2016-09-21 18:06:06 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2016-09-29 10:06:23 -0400
commitfa4aedab816820cefc1f7c8158aed73ca69def79 (patch)
tree078a76a11d8b49698717372b0f2d53865e32ad85 /src/import/chips/p9
parent64a24f1134da389173e26ea21d16931012dd573c (diff)
downloadtalos-hostboot-fa4aedab816820cefc1f7c8158aed73ca69def79.tar.gz
talos-hostboot-fa4aedab816820cefc1f7c8158aed73ca69def79.zip
Cleaned spd xml and Added module manufacturer info
Change-Id: I9a232b4305d280025ab8540910a90bb89a62e07e Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30071 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian R. Silver <bsilver@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30111 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.C26
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.H7
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H171
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/common/dimm_module_decoder.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C262
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H109
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C1
-rw-r--r--src/import/chips/p9/procedures/xml/attribute_info/memory_mcs_attributes.xml11
-rwxr-xr-xsrc/import/chips/p9/procedures/xml/attribute_info/memory_spd_attributes.xml18
13 files changed, 515 insertions, 110 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.C
index f1d937748..426ef605d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.C
@@ -183,6 +183,32 @@ fapi_try_exit:
}// dimm_type
///
+/// @brief Determines & sets effective config for dram_mfg_id type from SPD
+/// @param[in] i_target FAPI2 target
+/// @return fapi2::FAPI2_RC_SUCCESS if okay
+///
+fapi2::ReturnCode eff_config::dram_mfg_id(const fapi2::Target<TARGET_TYPE_DIMM>& i_target)
+{
+ const auto l_mcs = find_target<TARGET_TYPE_MCS>(i_target);
+ const auto l_port_num = index( find_target<TARGET_TYPE_MCA>(i_target) );
+ const auto l_dimm_num = index(i_target);
+
+ uint16_t l_decoder_val = 0;
+ uint16_t l_mcs_attrs[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
+
+ // Get & update MCS attribute
+ FAPI_TRY( eff_dram_mfg_id(l_mcs, &l_mcs_attrs[0][0]) );
+ FAPI_TRY( iv_pDecoder->dram_manufacturer_id_code(i_target, l_decoder_val) );
+
+ l_mcs_attrs[l_port_num][l_dimm_num] = l_decoder_val;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_DRAM_MFG_ID, l_mcs, l_mcs_attrs) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+
+}// dimm_type
+
+///
/// @brief Determines & sets effective config for dram width
/// @param[in] i_target FAPI2 target
/// @return fapi2::FAPI2_RC_SUCCESS if okay
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.H
index f1531e279..e3613c20b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/eff_config.H
@@ -122,6 +122,13 @@ class eff_config
const std::vector<uint8_t>& i_spd_data);
///
+ /// @brief Determines & sets effective config for dram_mfg_id type from SPD
+ /// @param[in] i_target FAPI2 target
+ /// @return fapi2::FAPI2_RC_SUCCESS if okay
+ ///
+ fapi2::ReturnCode dram_mfg_id(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target);
+
+ ///
/// @brief Determines & sets effective config for primary stack type
/// @param[in] i_target FAPI2 target
/// @return fapi2::FAPI2_RC_SUCCESS if okay
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
index c5aa5186c..c8979fa71 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
@@ -155,90 +155,6 @@ fapi_try_exit:
}
///
-/// @brief ATTR_MSS_DIMM_MFG_ID_CODE getter
-/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM>
-/// @param[out] ref to the value uint32_t
-/// @note Generated by gen_accessors.pl generateParameters (F)
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-/// @note Manufacturer ID Code RCD: bits(31:16), Module:
-/// bits(15:0)
-///
-inline fapi2::ReturnCode dimm_mfg_id_code(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint32_t& o_value)
-{
- uint32_t l_value[2][2];
- auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>();
- auto l_mcs = l_mca.getParent<fapi2::TARGET_TYPE_MCS>();
-
- FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_DIMM_MFG_ID_CODE, l_mcs, l_value) );
- o_value = l_value[mss::index(l_mca)][mss::index(i_target)];
- return fapi2::current_err;
-
-fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_MSS_DIMM_MFG_ID_CODE: 0x%lx (target: %s)",
- uint64_t(fapi2::current_err), mss::c_str(i_target));
- return fapi2::current_err;
-}
-
-///
-/// @brief ATTR_MSS_DIMM_MFG_ID_CODE getter
-/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA>
-/// @param[out] uint32_t* memory to store the value
-/// @note Generated by gen_accessors.pl generateParameters (G)
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-/// @note Manufacturer ID Code RCD: bits(31:16), Module:
-/// bits(15:0)
-///
-inline fapi2::ReturnCode dimm_mfg_id_code(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint32_t* o_array)
-{
- if (o_array == nullptr)
- {
- FAPI_ERR("nullptr passed to attribute accessor %s", __func__);
- return fapi2::FAPI2_RC_INVALID_PARAMETER;
- }
-
- uint32_t l_value[2][2];
- auto l_mcs = i_target.getParent<fapi2::TARGET_TYPE_MCS>();
-
- FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_DIMM_MFG_ID_CODE, l_mcs, l_value) );
- memcpy(o_array, &(l_value[mss::index(i_target)][0]), 8);
- return fapi2::current_err;
-
-fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_MSS_DIMM_MFG_ID_CODE: 0x%lx (target: %s)",
- uint64_t(fapi2::current_err), mss::c_str(i_target));
- return fapi2::current_err;
-}
-
-///
-/// @brief ATTR_MSS_DIMM_MFG_ID_CODE getter
-/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS>
-/// @param[out] uint32_t* memory to store the value
-/// @note Generated by gen_accessors.pl generateParameters (H)
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-/// @note Manufacturer ID Code RCD: bits(31:16), Module:
-/// bits(15:0)
-///
-inline fapi2::ReturnCode dimm_mfg_id_code(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint32_t* o_array)
-{
- if (o_array == nullptr)
- {
- FAPI_ERR("nullptr passed to attribute accessor %s", __func__);
- return fapi2::FAPI2_RC_INVALID_PARAMETER;
- }
-
- uint32_t l_value[2][2];
-
- FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_DIMM_MFG_ID_CODE, i_target, l_value) );
- memcpy(o_array, &l_value, 16);
- return fapi2::current_err;
-
-fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_MSS_DIMM_MFG_ID_CODE: 0x%lx (target: %s)",
- uint64_t(fapi2::current_err), mss::c_str(i_target));
- return fapi2::current_err;
-}
-
-///
/// @brief ATTR_EFF_DIMM_SPARE getter
/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM>
/// @param[out] uint8_t* memory to store the value
@@ -19216,6 +19132,93 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief ATTR_EFF_DRAM_MFG_ID getter
+/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+/// @param[out] ref to the value uint16_t
+/// @note Generated by gen_accessors.pl generateParameters (F)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note DRAM Manufacturer ID Code Decodes SPD Byte 350 and 351 creator: mss_eff_cnfg
+/// consumer:
+/// power_thermal::decoder
+///
+inline fapi2::ReturnCode eff_dram_mfg_id(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint16_t& o_value)
+{
+ uint16_t l_value[2][2];
+ auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>();
+ auto l_mcs = l_mca.getParent<fapi2::TARGET_TYPE_MCS>();
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_DRAM_MFG_ID, l_mcs, l_value) );
+ o_value = l_value[mss::index(l_mca)][mss::index(i_target)];
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_EFF_DRAM_MFG_ID: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_EFF_DRAM_MFG_ID getter
+/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA>
+/// @param[out] uint16_t* memory to store the value
+/// @note Generated by gen_accessors.pl generateParameters (G)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note DRAM Manufacturer ID Code Decodes SPD Byte 350 and 351 creator: mss_eff_cnfg
+/// consumer:
+/// power_thermal::decoder
+///
+inline fapi2::ReturnCode eff_dram_mfg_id(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint16_t* o_array)
+{
+ if (o_array == nullptr)
+ {
+ FAPI_ERR("nullptr passed to attribute accessor %s", __func__);
+ return fapi2::FAPI2_RC_INVALID_PARAMETER;
+ }
+
+ uint16_t l_value[2][2];
+ auto l_mcs = i_target.getParent<fapi2::TARGET_TYPE_MCS>();
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_DRAM_MFG_ID, l_mcs, l_value) );
+ memcpy(o_array, &(l_value[mss::index(i_target)][0]), 4);
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_EFF_DRAM_MFG_ID: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_EFF_DRAM_MFG_ID getter
+/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS>
+/// @param[out] uint16_t* memory to store the value
+/// @note Generated by gen_accessors.pl generateParameters (H)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note DRAM Manufacturer ID Code Decodes SPD Byte 350 and 351 creator: mss_eff_cnfg
+/// consumer:
+/// power_thermal::decoder
+///
+inline fapi2::ReturnCode eff_dram_mfg_id(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint16_t* o_array)
+{
+ if (o_array == nullptr)
+ {
+ FAPI_ERR("nullptr passed to attribute accessor %s", __func__);
+ return fapi2::FAPI2_RC_INVALID_PARAMETER;
+ }
+
+ uint16_t l_value[2][2];
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_DRAM_MFG_ID, i_target, l_value) );
+ memcpy(o_array, &l_value, 8);
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_EFF_DRAM_MFG_ID: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
///
/// @brief ATTR_MSS_MRW_SAFEMODE_MEM_THROTTLED_N_COMMANDS_PER_PORT getter
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/dimm_module_decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/dimm_module_decoder.H
index b737d196b..e8b5716e2 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/dimm_module_decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/dimm_module_decoder.H
@@ -196,13 +196,13 @@ class dimm_module_decoder
}
///
- /// @brief Decodes manufacturer ID code
+ /// @brief Decodes register manufacturer ID code
/// @param[out] o_output drive strength encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
/// @note SPD Byte 134 (Bits 7~0)
/// @note Item JEDEC Standard No. 21-C
///
- virtual fapi2::ReturnCode manufacturer_id_code(uint8_t& o_output)
+ virtual fapi2::ReturnCode reg_manufacturer_id_code(uint8_t& o_output)
{
o_output = 0;
return fapi2::FAPI2_RC_SUCCESS;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C
index fcb0f38e1..869ab0832 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.C
@@ -2815,8 +2815,270 @@ fapi2::ReturnCode decoder::cyclical_redundancy_code(const fapi2::Target<fapi2::T
}
///
+/// @brief Decodes module manufacturer ID code
+/// @param[in] i_target TARGET_TYPE_DIMM
+/// @param[out] o_value module manufacturing id code
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 320 (bit 7~0), 321 (6~0)
+/// @note Item JEDEC Standard No. 21-C
+/// @note DDR4 SPD Document Release 3
+/// @note Page 4.1.2.12 - 54
+///
+fapi2::ReturnCode decoder::module_manufacturer_id_code(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint16_t& o_value)
+{
+
+ constexpr size_t BYTE_INDEX_MSB = 320;
+ uint8_t mfgid_MSB = iv_spd_data[BYTE_INDEX_MSB];
+
+ constexpr size_t BYTE_INDEX_LSB = 321;
+ uint8_t mfgid_LSB = iv_spd_data[BYTE_INDEX_LSB];
+
+ constexpr size_t MSB_START = 0;
+ constexpr size_t MSB_LEN = 8;
+ constexpr size_t LSB_START = 8;
+ constexpr size_t LSB_LEN = 8;
+
+ fapi2::buffer<uint16_t> l_buffer;
+ l_buffer.insertFromRight<MSB_START, MSB_LEN>( mfgid_MSB )
+ .insertFromRight<LSB_START, LSB_LEN>( mfgid_LSB );
+
+ o_value = l_buffer;
+
+ FAPI_INF("%s.Module Manufacturer ID Code: %x",
+ mss::c_str(i_target),
+ o_value);
+
+ // Returns "happy" until we can figure out a way to test this - AAM
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
+/// @brief Decodes Module Manufacturing Location
+/// @param[in] i_target dimm target
+/// @param[out] o_value uint8_t identifier for manufacturing location of memory module
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 322
+/// @note Item JC-45-2220.01x
+/// @note Page 55
+/// @note DDR4 SPD Document Release 3
+///
+fapi2::ReturnCode decoder::module_manufacturing_location(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value)
+{
+ // Trace in the front assists w/ debug
+ constexpr size_t BYTE_INDEX = 322;
+
+ FAPI_INF("%s SPD data at Byte %d: 0x%llX.",
+ mss::c_str(i_target),
+ BYTE_INDEX,
+ iv_spd_data[BYTE_INDEX]);
+
+ o_value = iv_spd_data[BYTE_INDEX];
+
+ FAPI_INF("%s. Module Manufacturing Location: %x",
+ mss::c_str(i_target),
+ o_value);
+
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
+/// @brief Decodesmodule manufacturing date
+/// @param[in] i_target TARGET_TYPE_DIMM
+/// @param[out] o_value the 2 byte date of manufacturing in BCD format
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 323-324
+/// @note Item JEDEC Standard No. 21-C
+/// @note DDR4 SPD Document Release 2
+/// @note Page 4.1.2.12 - 54
+/// @note in Binary Coded Decimal (BCD)
+/// @note MSB = year, LSB = week
+///
+fapi2::ReturnCode decoder::module_manufacturing_date(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint16_t& o_value)
+{
+
+ constexpr size_t BYTE_INDEX_MSB = 323;
+ uint8_t date_MSB = iv_spd_data[BYTE_INDEX_MSB];
+
+ constexpr size_t BYTE_INDEX_LSB = 324;
+ uint8_t date_LSB = iv_spd_data[BYTE_INDEX_LSB];
+
+ constexpr size_t MSB_START = 0;
+ constexpr size_t MSB_LEN = 8;
+ constexpr size_t LSB_START = 8;
+ constexpr size_t LSB_LEN = 8;
+
+ //Using insertFromRight because IBM is backwards
+ fapi2::buffer<uint16_t> l_buffer;
+ l_buffer.insertFromRight<MSB_START, MSB_LEN>( date_MSB )
+ .insertFromRight<LSB_START, LSB_LEN>( date_LSB );
+
+ o_value = l_buffer;
+
+ FAPI_INF("%s.Module Manufacturer ID date: %x",
+ mss::c_str(i_target),
+ o_value);
+
+ // Returns "happy" until we can figure out a way to test this - AAM
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
+/// @brief Decodes module's unique serial number
+/// @param[in] i_target TARGET_TYPE_DIMM
+/// @param[out] o_value
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 325-328
+/// @note Item JEDEC Standard No. 21-C
+/// @note DDR4 SPD Document Release 2
+/// @note Page 4.1.2.12 - 54
+/// @note in Binary Coded Decimal (BCD)
+///
+fapi2::ReturnCode decoder::module_serial_number(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint32_t& o_value)
+{
+ constexpr size_t BYTE_INDEX_0 = 325;
+ uint8_t sn_byte_0 = iv_spd_data[BYTE_INDEX_0];
+
+ constexpr size_t BYTE_INDEX_1 = 326;
+ uint8_t sn_byte_1 = iv_spd_data[BYTE_INDEX_1];
+
+ constexpr size_t BYTE_INDEX_2 = 327;
+ uint8_t sn_byte_2 = iv_spd_data[BYTE_INDEX_2];
+
+ constexpr size_t BYTE_INDEX_3 = 328;
+ uint8_t sn_byte_3 = iv_spd_data[BYTE_INDEX_3];
+
+ constexpr size_t START_BYTE_0 = 0;
+ constexpr size_t LEN_BYTE_0 = 8;
+ constexpr size_t START_BYTE_1 = 8;
+ constexpr size_t LEN_BYTE_1 = 8;
+ constexpr size_t START_BYTE_2 = 16;
+ constexpr size_t LEN_BYTE_2 = 8;
+ constexpr size_t START_BYTE_3 = 24;
+ constexpr size_t LEN_BYTE_3 = 8;
+
+ //Goes down the batting order, Inserts from left side because IBM
+ fapi2::buffer<uint32_t> l_buffer;
+ l_buffer.insertFromRight<START_BYTE_0, LEN_BYTE_0>( sn_byte_0 )
+ .insertFromRight<START_BYTE_1, LEN_BYTE_1>( sn_byte_1 )
+ .insertFromRight<START_BYTE_2, LEN_BYTE_2>( sn_byte_2 )
+ .insertFromRight<START_BYTE_3, LEN_BYTE_3>( sn_byte_3 );
+
+ o_value = l_buffer;
+
+ FAPI_INF("%s.Module Serial Number : %x",
+ mss::c_str(i_target),
+ o_value);
+
+ // Returns "happy" until we can figure out a way to test this - AAM
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
+/// @brief Decodes Module Revision Code
+/// @param[in] i_target dimm target
+/// @param[out] o_value uint8_t identifier for revision code
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 349
+/// @note Item JC-45-2220.01x
+/// @note Page 55
+/// @note DDR4 SPD Document Release 3
+///
+fapi2::ReturnCode decoder::module_revision_code(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value)
+{
+ // Trace in the front assists w/ debug
+ constexpr size_t BYTE_INDEX = 349;
+
+ FAPI_INF("%s SPD data at Byte %d: 0x%llX.",
+ mss::c_str(i_target),
+ BYTE_INDEX,
+ iv_spd_data[BYTE_INDEX]);
+
+ o_value = iv_spd_data[BYTE_INDEX];
+
+ FAPI_INF("%s. Module Revision Code: %x",
+ mss::c_str(i_target),
+ o_value);
+
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
+/// @brief Decodes DRAM Manufacturer ID code
+/// @param[in] i_target TARGET_TYPE_DIMM
+/// @param[out] o_value dram manufacturing id code
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 350 351
+/// @note Item JEDEC Standard No. 21-C
+/// @note DDR4 SPD Document Release 2
+/// @note Page 4.1.2.12 - 54
+///
+fapi2::ReturnCode decoder::dram_manufacturer_id_code(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint16_t& o_value)
+{
+ constexpr size_t BYTE_INDEX_MSB = 350;
+ uint8_t mfgid_MSB = iv_spd_data[BYTE_INDEX_MSB];
+
+ constexpr size_t BYTE_INDEX_LSB = 351;
+ uint8_t mfgid_LSB = iv_spd_data[BYTE_INDEX_LSB];
+
+ constexpr size_t MSB_START = 0;
+ constexpr size_t MSB_LEN = 8;
+ constexpr size_t LSB_START = 8;
+ constexpr size_t LSB_LEN = 8;
+
+ fapi2::buffer<uint16_t> l_buffer;
+ l_buffer.insertFromRight<MSB_START, MSB_LEN>( mfgid_MSB )
+ .insertFromRight<LSB_START, LSB_LEN>( mfgid_LSB );
+
+ o_value = l_buffer;
+
+ FAPI_INF("%s.DRAM Manufacturer ID Code (dram_mfg_id): %x",
+ mss::c_str(i_target),
+ o_value);
+
+ // Returns "happy" until we can figure out a way to test this - AAM
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
+/// @brief Decodes DRAM Stepping
+/// @param[in] i_target dimm target
+/// @param[out] o_value uint8_t DRAM Stepping val
+/// @return FAPI2_RC_SUCCESS if okay
+/// @note SPD Byte 353
+/// @note Item JC-45-2220.01x
+/// @note Page 56
+/// @note DDR4 SPD Document Release 3
+/// @note also called die revision level
+///
+fapi2::ReturnCode decoder::dram_stepping(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value)
+{
+ // Trace in the front assists w/ debug
+ constexpr size_t BYTE_INDEX = 352;
+
+ FAPI_INF("%s SPD data at Byte %d: 0x%01X.",
+ mss::c_str(i_target),
+ BYTE_INDEX,
+ iv_spd_data[BYTE_INDEX]);
+
+ o_value = iv_spd_data[BYTE_INDEX];
+
+ FAPI_INF("%s. DRAM stepping: %x",
+ mss::c_str(i_target),
+ o_value);
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+///
/// @brief Returns Logical ranks in Primary SDRAM type
/// @param[in] i_target dimm target
+/// @param[in] i_target TARGET_TYPE_DIMM
/// @param[out] o_logical_ranks number of logical ranks
/// @return fapi2::FAPI2_RC_SUCCESS if okay
///
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H
index 3bfcdc4ab..fdffd3653 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/common/spd_decoder.H
@@ -100,7 +100,7 @@ enum factory_byte_extract
/// @param[in] i_spd_data the SPD data
/// @return extracted byte (right aligned)
///
-template<uint8_t I, uint8_t S, uint8_t L>
+template<size_t I, uint8_t S, uint8_t L>
inline uint8_t extract_spd_field(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const std::vector<uint8_t>& i_spd_data)
{
@@ -421,12 +421,22 @@ class decoder
// Bytes 117 - 125 : Entire byte used
// Byte 126
+ CRC_LSB_START = 0,
+ CRC_LSB_LEN = 8,
+
+ // Byte 127
CRC_MSB_START = 0,
CRC_MSB_LEN = 8,
- // Byte 127
- CRC_LSB_START = 0,
- CRC_LSB_LEN = 8,
+ // Byte 320
+ // Skip SPD most signigicant bit, so our 0
+ MOD_MFG_LSB_START = 0,
+ MOD_MFG_LSB_LEN = 8,
+
+ // Byte 321
+ MOD_MFG_MSB_START = 0,
+ MOD_MFG_MSB_LEN = 8,
+
};
public:
@@ -1250,13 +1260,102 @@ class decoder
uint16_t& o_value);
///
+ /// @brief Decodes module manufacturer ID code
+ /// @param[in] i_target TARGET_TYPE_DIMM
+ /// @param[out] o_output module manufacturing id code
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 320 (bit 7~0), 321 (6~0)
+ /// @note Item JEDEC Standard No. 21-C
+ /// @note DDR4 SPD Document Release 3
+ /// @note Page 4.1.2.12 - 54
+ ///
+ virtual fapi2::ReturnCode module_manufacturer_id_code(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint16_t& o_value);
+ ///
+ /// @brief Decodes Module Manufacturing Location
+ /// @param[in] i_target dimm target
+ /// @param[out] o_value uint8_t identifier for manufacturing location of memory module
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 322
+ /// @note Item JC-45-2220.01x
+ /// @note Page 55
+ /// @note DDR4 SPD Document Release 3
+ ///
+ virtual fapi2::ReturnCode module_manufacturing_location(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value);
+ ///
+ /// @brief Decodesmodule manufacturing date
+ /// @param[in] i_target TARGET_TYPE_DIMM
+ /// @param[out] o_output the 2 byte date of manufacturing in BCD format
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 323 & 324
+ /// @note Item JEDEC Standard No. 21-C
+ /// @note DDR4 SPD Document Release 2
+ /// @note Page 4.1.2.12 - 54
+ /// @note in Binary Coded Decimal (BCD)
+ /// @note MSB = year, LSB = week
+ ///
+ virtual fapi2::ReturnCode module_manufacturing_date(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint16_t& o_output);
+
+ ///
+ /// @brief Decodes module's unique serial number
+ /// @param[in] i_target TARGET_TYPE_DIMM
+ /// @param[out] o_output
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 325-328
+ /// @note Item JEDEC Standard No. 21-C
+ /// @note DDR4 SPD Document Release 2
+ /// @note Page 4.1.2.12 - 54
+ ///
+ virtual fapi2::ReturnCode module_serial_number(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint32_t& o_output);
+ ///
+ /// @brief Decodes Module Revision Code
+ /// @param[in] i_target dimm target
+ /// @param[out] o_value uint8_t identifier for revision code
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 349
+ /// @note Item JC-45-2220.01x
+ /// @note Page 55
+ /// @note DDR4 SPD Document Release 3
+ ///
+ virtual fapi2::ReturnCode module_revision_code(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value);
+ ///
+ /// @brief Decodes DRAM Manufacturer ID code
+ /// @param[in] i_target TARGET_TYPE_DIMM
+ /// @param[out] o_output dram manufacturing id code
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 350 - 351
+ /// @note Item JEDEC Standard No. 21-C
+ /// @note DDR4 SPD Document Release 2
+ /// @note Page 4.1.2.12 - 54
+ ///
+ virtual fapi2::ReturnCode dram_manufacturer_id_code(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint16_t& o_output);
+ ///
+ /// @brief Decodes DRAM Stepping
+ /// @param[in] i_target dimm target
+ /// @param[out] o_value uint8_t DRAM Stepping val
+ /// @return FAPI2_RC_SUCCESS if okay
+ /// @note SPD Byte 352
+ /// @note Item JC-45-2220.01x
+ /// @note Page 56
+ /// @note DDR4 SPD Document Release 3
+ /// @note also called die revision level
+ ///
+ virtual fapi2::ReturnCode dram_stepping(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value);
+
+ ///
/// @brief Returns Logical ranks per DIMM
/// @param[in] i_target dimm target
/// @param[out] o_logical_ranks number of logical ranks
/// @return fapi2::FAPI2_RC_SUCCESS if okay
///
virtual fapi2::ReturnCode logical_ranks_per_dimm(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- uint8_t& o_logical_rank_per_dimm) ;
+ uint8_t& o_logical_rank_per_dimm);
protected:
// TODO RTC:159362
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder.H
index 4e3c5694a..98c3451f3 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder.H
@@ -211,7 +211,7 @@ class decoder_v1_0 : public dimm_module_decoder
virtual fapi2::ReturnCode num_continuation_codes(uint8_t& o_output) override;
///
- /// @brief Decodes manufacturer ID code
+ /// @brief Decodes register manufacturer ID code
/// @param[out] o_output drive strength encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
/// @note SPD Byte 134 (Bits 7~0)
@@ -219,7 +219,7 @@ class decoder_v1_0 : public dimm_module_decoder
/// @note DDR4 SPD Document Release 2
/// @note Page 4.1.2.12.2 - 58
///
- virtual fapi2::ReturnCode manufacturer_id_code(uint8_t& o_output) override;
+ virtual fapi2::ReturnCode reg_manufacturer_id_code(uint8_t& o_output) override;
///
/// @brief Decodes register revision number
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C
index e46a09a50..a6d0664e7 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C
@@ -483,7 +483,7 @@ fapi_try_exit:
}
///
-/// @brief Decodes manufacturer ID code
+/// @brief Decodes register manufacturer ID code
/// @param[out] o_output drive strength encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
/// @note SPD Byte 134 (bit 7~0)
@@ -491,7 +491,7 @@ fapi_try_exit:
/// @note DDR4 SPD Document Release 2
/// @note Page 4.1.2.12.2 - 58
///
-fapi2::ReturnCode decoder_v1_0::manufacturer_id_code(uint8_t& o_output)
+fapi2::ReturnCode decoder_v1_0::reg_manufacturer_id_code(uint8_t& o_output)
{
constexpr size_t BYTE_INDEX = 134;
uint8_t l_raw_byte = iv_spd_data[BYTE_INDEX];
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder.H
index cd8818d67..63a87f93c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder.H
@@ -226,7 +226,7 @@ class rdimm_decoder_v1_0 : public dimm_module_decoder
virtual fapi2::ReturnCode num_continuation_codes(uint8_t& o_output) override;
///
- /// @brief Decodes manufacturer ID code
+ /// @brief Decodes register manufacturer ID code
/// @param[out] o_output drive strength encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
/// @note SPD Byte 133 (bit 6~0)
@@ -234,7 +234,7 @@ class rdimm_decoder_v1_0 : public dimm_module_decoder
/// @note DDR4 SPD Document Release 2
/// @note Page 4.1.2.12 - 51
///
- virtual fapi2::ReturnCode manufacturer_id_code(uint8_t& o_output) override;
+ virtual fapi2::ReturnCode reg_manufacturer_id_code(uint8_t& o_output) override;
///
/// @brief Decodes register revision number
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C
index 0e2643e8a..ad9257cae 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C
@@ -359,7 +359,7 @@ fapi_try_exit:
}
///
-/// @brief Decodes manufacturer ID code
+/// @brief Decodes register manufacturer ID code
/// @param[out] o_output drive strength encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
/// @note SPD Byte 134 (bit 7~0)
@@ -367,7 +367,7 @@ fapi_try_exit:
/// @note DDR4 SPD Document Release 2
/// @note Page 4.1.2.12 - 51
///
-fapi2::ReturnCode rdimm_decoder_v1_0::manufacturer_id_code(uint8_t& o_output)
+fapi2::ReturnCode rdimm_decoder_v1_0::reg_manufacturer_id_code(uint8_t& o_output)
{
constexpr size_t BYTE_INDEX = 134;
uint8_t l_raw_byte = iv_spd_data[BYTE_INDEX];
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C
index b2f4649fd..af032751d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C
@@ -108,6 +108,7 @@ fapi2::ReturnCode p9_mss_eff_config( const fapi2::Target<fapi2::TARGET_TYPE_MCS>
l_eff_config.iv_pDecoder = l_it->second;
FAPI_TRY( l_eff_config.dimm_type(l_dimm, l_it->second->iv_spd_data) );
+ FAPI_TRY( l_eff_config.dram_mfg_id(l_dimm) );
FAPI_TRY( l_eff_config.dram_gen(l_dimm, l_it->second->iv_spd_data) );
FAPI_TRY( l_eff_config.dram_width(l_dimm) );
FAPI_TRY( l_eff_config.dram_density(l_dimm) );
diff --git a/src/import/chips/p9/procedures/xml/attribute_info/memory_mcs_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/memory_mcs_attributes.xml
index b40d9f870..63f4fc411 100644
--- a/src/import/chips/p9/procedures/xml/attribute_info/memory_mcs_attributes.xml
+++ b/src/import/chips/p9/procedures/xml/attribute_info/memory_mcs_attributes.xml
@@ -118,17 +118,6 @@
</attribute>
<attribute>
- <id>ATTR_MSS_DIMM_MFG_ID_CODE</id>
- <targetType>TARGET_TYPE_MCS</targetType>
- <description>Manufacturer ID Code RCD: bits(31:16), Module: bits(15:0)</description>
- <initToZero></initToZero>
- <valueType>uint32</valueType>
- <writeable/>
- <array> 2 2</array>
- <mssAccessorName>dimm_mfg_id_code</mssAccessorName>
- </attribute>
-
- <attribute>
<id>ATTR_EFF_DIMM_SPARE</id>
<targetType>TARGET_TYPE_MCS</targetType>
<description>
diff --git a/src/import/chips/p9/procedures/xml/attribute_info/memory_spd_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/memory_spd_attributes.xml
index 7bdd074b4..4ac083653 100755
--- a/src/import/chips/p9/procedures/xml/attribute_info/memory_spd_attributes.xml
+++ b/src/import/chips/p9/procedures/xml/attribute_info/memory_spd_attributes.xml
@@ -586,4 +586,22 @@
<mssAccessorName>eff_num_ranks_per_dimm</mssAccessorName>
</attribute>
+ <attribute>
+ <id>ATTR_EFF_DRAM_MFG_ID</id>
+ <targetType>TARGET_TYPE_MCS</targetType>
+ <description>
+ DRAM Manufacturer ID Code
+ Decodes SPD Byte 350 and 351
+ creator: mss_eff_cnfg
+ consumer: power_thermal::decoder
+ </description>
+ <enum>MICRON = 0x802C, SAMSUNG = 0x80CE, HYNIX = 0x80AD </enum>
+ <initToZero></initToZero>
+ <valueType>uint16</valueType>
+ <writeable/>
+ <array> 2 2</array>
+ <mssAccessorName>eff_dram_mfg_id</mssAccessorName>
+ </attribute>
+
+
</attributes>
OpenPOWER on IntegriCloud