diff options
author | Andre Marin <aamarin@us.ibm.com> | 2018-05-29 08:37:46 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-07-31 15:34:02 -0500 |
commit | 77a99242f79dbe5aaf47b950f070ccaeaa58d240 (patch) | |
tree | d892c4a8b69d77769a38d8dc77d6bd64d4aca468 /src/import/generic/memory/lib/spd/common/dimm_module_decoder.H | |
parent | 73f196ac8f86bbe898733721db58e143b0a42d6c (diff) | |
download | talos-hostboot-77a99242f79dbe5aaf47b950f070ccaeaa58d240.tar.gz talos-hostboot-77a99242f79dbe5aaf47b950f070ccaeaa58d240.zip |
Remove Nimbus dependencies from the SPD decoder
Created a new pre_data_engine to set preliminary data
needed before eff_config. Moved SPD to attribute mapping
to eff_dimm structure and away from the SPD decoder to make
it reusable for future memory controllers. Updated bugs in
unit tests. Added SPD factory classes.
This is only needed for Axone.
Change-Id: Ief0a479ee1c7a4dab852ffb18b595564c0125e35
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/58611
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Dev-Ready: ANDRE A. MARIN <aamarin@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/59470
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/generic/memory/lib/spd/common/dimm_module_decoder.H')
-rw-r--r-- | src/import/generic/memory/lib/spd/common/dimm_module_decoder.H | 110 |
1 files changed, 53 insertions, 57 deletions
diff --git a/src/import/generic/memory/lib/spd/common/dimm_module_decoder.H b/src/import/generic/memory/lib/spd/common/dimm_module_decoder.H index da24f3155..ec7916df4 100644 --- a/src/import/generic/memory/lib/spd/common/dimm_module_decoder.H +++ b/src/import/generic/memory/lib/spd/common/dimm_module_decoder.H @@ -52,11 +52,12 @@ namespace spd /// class dimm_module_decoder { - public: + private: + const fapi2::Target<fapi2::TARGET_TYPE_DIMM> iv_target; + std::vector<uint8_t> iv_data; - // - std::vector<uint8_t> iv_spd_data; + public: /// /// @brief default ctor @@ -67,9 +68,10 @@ class dimm_module_decoder /// @brief ctor /// dimm_module_decoder(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - const std::vector<uint8_t>& i_spd_data): iv_target(i_target), iv_spd_data(i_spd_data) + const std::vector<uint8_t>& i_spd_data): + iv_target(i_target), + iv_data(i_spd_data) { - fapi2::toString(iv_target, iv_target_str_storage, fapi2::MAX_ECMD_STRING_LEN); } /// @@ -78,6 +80,33 @@ class dimm_module_decoder virtual ~dimm_module_decoder() = default; /// + /// @brief Gets decoder target + /// @return fapi2::Target<fapi2::TARGET_TYPE_DIMM> + /// + virtual fapi2::Target<fapi2::TARGET_TYPE_DIMM> get_dimm_target() const + { + return iv_target; + } + + /// + /// @brief Gets decoder SPD data + /// @return std::vector<uint8_t> + /// + virtual std::vector<uint8_t> get_data() const + { + return iv_data; + } + + /// + /// @brief Sets decoder SPD data + /// @param[in] i_spd_data SPD data in a vector reference + /// + virtual void set_data(const std::vector<uint8_t>& i_spd_data) + { + iv_data = i_spd_data; + } + + /// /// @brief Decodes module nominal height max /// @param[out] o_output height range encoding from SPD /// @return FAPI2_RC_SUCCESS if okay @@ -122,8 +151,23 @@ class dimm_module_decoder } /// + /// @brief Decodes reference raw card used + /// @param[out] o_output encoding from SPD + /// @return FAPI2_RC_SUCCESS if okay + /// @note SPD Byte 130 (Bits 7~0) + /// @note Item JEDEC Standard No. 21-C + /// @note DDR4 SPD Document Release 2 + /// @note Page 4.1.2.12 - 48 + /// + virtual fapi2::ReturnCode reference_raw_card(uint8_t& o_output) const + { + o_output = 0; + return fapi2::FAPI2_RC_SUCCESS; + } + + /// /// @brief Decodes number of registers used on RDIMM - /// @param[out] o_output encoding from SPD + /// @param[out] o_output encoding from SPD /// @return FAPI2_RC_SUCCESS if okay /// virtual fapi2::ReturnCode num_registers_used(uint8_t& o_output) const @@ -145,7 +189,7 @@ class dimm_module_decoder /// /// @brief Decodes register and buffer type for LRDIMMs - /// @param[out] o_output encoding from SPD + /// @param[out] o_output encoding from SPD /// @return FAPI2_RC_SUCCESS if okay /// virtual fapi2::ReturnCode register_and_buffer_type(uint8_t& o_output) const @@ -178,22 +222,11 @@ class dimm_module_decoder } /// - /// @brief Decodes number of continuation codes - /// @param[out] o_output drive strength encoding from SPD - /// @return FAPI2_RC_SUCCESS if okay - /// - virtual fapi2::ReturnCode num_continuation_codes(uint8_t& o_output) const - { - o_output = 0; - return fapi2::FAPI2_RC_SUCCESS; - } - - /// /// @brief Decodes register manufacturer ID code /// @param[out] o_output drive strength encoding from SPD /// @return FAPI2_RC_SUCCESS if okay /// - virtual fapi2::ReturnCode reg_manufacturer_id_code(uint8_t& o_output) const + virtual fapi2::ReturnCode reg_manufacturer_id_code(uint16_t& o_output) const { o_output = 0; return fapi2::FAPI2_RC_SUCCESS; @@ -312,7 +345,7 @@ class dimm_module_decoder /// /// @brief Decodes RCD output slew rate control - /// @param[out] o_output encoded drive strength + /// @param[out] o_output encoded slew rate /// @return FAPI2_RC_SUCCESS if okay /// virtual fapi2::ReturnCode slew_rate_control(uint8_t& o_output) const @@ -521,45 +554,8 @@ class dimm_module_decoder o_output = 0; return fapi2::FAPI2_RC_SUCCESS; } - - protected: - - char iv_target_str_storage[fapi2::MAX_ECMD_STRING_LEN]; - }; -/// -/// @brief data structure for byte fields -/// @note holds byte index, start bit and length of decoded field -/// -struct field_t -{ - const uint64_t iv_byte; - const uint64_t iv_start; - const uint64_t iv_length; - - // default ctor deleted - constexpr field_t() = delete; - - /// - /// @brief ctor - /// @param[in] i_byte_index - /// @param[in] i_start_bit - /// @param[in] i_bit_length - /// - constexpr field_t(const uint64_t i_byte_index, - const uint64_t i_start_bit, - const uint64_t i_bit_length) - : iv_byte(i_byte_index), iv_start(i_start_bit), iv_length(i_bit_length) - {} - - /// - /// @brief default dtor - /// - ~field_t() = default; - -};// field_t - }// spd }// mss |