From fa4aedab816820cefc1f7c8158aed73ca69def79 Mon Sep 17 00:00:00 2001 From: Jacob Harvey Date: Wed, 21 Sep 2016 18:06:06 -0500 Subject: Cleaned spd xml and Added module manufacturer info Change-Id: I9a232b4305d280025ab8540910a90bb89a62e07e Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30071 Tested-by: Jenkins Server Reviewed-by: Brian R. Silver Reviewed-by: Louis Stermole Reviewed-by: STEPHEN GLANCY Tested-by: Hostboot CI Reviewed-by: Christian R. Geddes Reviewed-by: Matt K. Light Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30111 Tested-by: FSP CI Jenkins Tested-by: Christian R. Geddes --- .../hwp/memory/lib/eff_config/eff_config.C | 26 ++ .../hwp/memory/lib/eff_config/eff_config.H | 7 + .../hwp/memory/lib/mss_attribute_accessors.H | 171 +++++++------- .../memory/lib/spd/common/dimm_module_decoder.H | 4 +- .../hwp/memory/lib/spd/common/spd_decoder.C | 262 +++++++++++++++++++++ .../hwp/memory/lib/spd/common/spd_decoder.H | 109 ++++++++- .../hwp/memory/lib/spd/lrdimm/lrdimm_decoder.H | 4 +- .../memory/lib/spd/lrdimm/lrdimm_decoder_v1_0.C | 4 +- .../hwp/memory/lib/spd/rdimm/rdimm_decoder.H | 4 +- .../hwp/memory/lib/spd/rdimm/rdimm_decoder_v1_0.C | 4 +- .../p9/procedures/hwp/memory/p9_mss_eff_config.C | 1 + 11 files changed, 497 insertions(+), 99 deletions(-) (limited to 'src/import/chips/p9/procedures/hwp/memory') 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 @@ -182,6 +182,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& i_target) +{ + const auto l_mcs = find_target(i_target); + const auto l_port_num = index( find_target(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 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 @@ -121,6 +121,13 @@ class eff_config fapi2::ReturnCode dimm_type(const fapi2::Target& i_target, const std::vector& 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& i_target); + /// /// @brief Determines & sets effective config for primary stack type /// @param[in] i_target FAPI2 target 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 @@ -154,90 +154,6 @@ fapi_try_exit: return fapi2::current_err; } -/// -/// @brief ATTR_MSS_DIMM_MFG_ID_CODE getter -/// @param[in] const ref to the fapi2::Target -/// @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& i_target, uint32_t& o_value) -{ - uint32_t l_value[2][2]; - auto l_mca = i_target.getParent(); - auto l_mcs = l_mca.getParent(); - - 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 -/// @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& 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(); - - 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 -/// @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& 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 @@ -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 +/// @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& i_target, uint16_t& o_value) +{ + uint16_t l_value[2][2]; + auto l_mca = i_target.getParent(); + auto l_mcs = l_mca.getParent(); + + 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 +/// @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& 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(); + + 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 +/// @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& 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 @@ -2814,9 +2814,271 @@ fapi2::ReturnCode decoder::cyclical_redundancy_code(const fapi2::Target& 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 l_buffer; + l_buffer.insertFromRight( mfgid_MSB ) + .insertFromRight( 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& 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& 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 l_buffer; + l_buffer.insertFromRight( date_MSB ) + .insertFromRight( 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& 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 l_buffer; + l_buffer.insertFromRight( sn_byte_0 ) + .insertFromRight( sn_byte_1 ) + .insertFromRight( sn_byte_2 ) + .insertFromRight( 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& 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& 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 l_buffer; + l_buffer.insertFromRight( mfgid_MSB ) + .insertFromRight( 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& 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 +template inline uint8_t extract_spd_field(const fapi2::Target& i_target, const std::vector& 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: @@ -1249,6 +1259,95 @@ class decoder virtual fapi2::ReturnCode cyclical_redundancy_code(const fapi2::Target& i_target, 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& 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& 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& 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& 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& 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& 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& i_target, + uint8_t& o_value); + /// /// @brief Returns Logical ranks per DIMM /// @param[in] i_target dimm target @@ -1256,7 +1355,7 @@ class decoder /// @return fapi2::FAPI2_RC_SUCCESS if okay /// virtual fapi2::ReturnCode logical_ranks_per_dimm(const fapi2::Target& 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 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) ); -- cgit v1.2.1