Skip to content

Commit

Permalink
Add SPD reader and traits DDR4 def
Browse files Browse the repository at this point in the history
Includes addition of a generic const file to store
constants that are not controller dependent.
In addition to spd::c_str for SPD decoder tracing.

Change-Id: I6dafe1ff3328a1ac287b29f148e63e304f626ea5
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57492
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@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: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58197
Reviewed-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
aamarin authored and dcrowell77 committed Jun 30, 2018
1 parent 60b9412 commit 81996e9
Show file tree
Hide file tree
Showing 8 changed files with 5,103 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@
<!-- -->

<hwpErrors>

<hwpError>
<rc>RC_MSS_LOOKUP_FAILED</rc>
<description>
Conditional that tests whether a certain key value is located in a map.
</description>
<ffdc>KEY</ffdc>
<ffdc>DATA</ffdc>
<ffdc>FUNCTION</ffdc>
<callout>
<target>TARGET</target>
<priority>MEDIUM</priority>
</callout>
<deconfigure>
<target>TARGET</target>
</deconfigure>
</hwpError>

<hwpError>
<rc>RC_MSS_EMPTY_VECTOR</rc>
<description>
Expand Down Expand Up @@ -115,4 +133,36 @@
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_OUT_OF_BOUNDS_INDEXING</rc>
<description>
Desired index is larger than list (std::vector, array, etc.) size.
Likely a programming error.
</description>
<ffdc>TARGET</ffdc>
<ffdc>INDEX</ffdc>
<ffdc>LIST_SIZE</ffdc>
<ffdc>FUNCTION</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_CONVERSION_ERROR</rc>
<description>
Overflow or underflow occured converting one integral type to another.
This is a programming error.
</description>
<ffdc>TARGET</ffdc>
<ffdc>ORIGINAL_VAL</ffdc>
<ffdc>CONVERTED_VAL</ffdc>
<ffdc>FUNCTION</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
</hwpError>

</hwpErrors>
148 changes: 148 additions & 0 deletions src/import/generic/memory/lib/spd/spd_field.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,151 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */

///
/// @file spd_field.H
/// @brief SPD data fields
///

// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Consumed by: HB:FSP

#ifndef _MSS_SPD_FIELD_H_
#define _MSS_SPD_FIELD_H_

#include <cstdint>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>

namespace mss
{
namespace spd
{

///
/// @class field_t
/// @brief data structure for SPD byte fields
/// @note holds byte index, start bit, and bit length of a decoded field
///
class field_t
{
private:

const size_t iv_byte;
const size_t iv_start;
const size_t iv_length;

public:

// default ctor deleted
field_t() = delete;

///
/// @brief ctor
/// @param[in] i_byte_index
/// @param[in] i_start_bit
/// @param[in] i_bit_length
///
constexpr field_t(const size_t i_byte_index,
const size_t i_start_bit,
const size_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;

///
/// @brief Byte index getter
/// @return the byte index for this SPD field
///
constexpr size_t get_byte() const
{
return iv_byte;
}

///
/// @brief Starting bit getter
/// @return the starting bit position for this SPD field
///
constexpr size_t get_start() const
{
return iv_start;
}

///
/// @brief bit length getter
/// @return the bit length of this SPD field
///
constexpr size_t get_length() const
{
return iv_length;
}

};// field_t

///
/// @class init_fields
/// @brief Initial fields needed to know how to parse the SPD
/// @note These are preliminary fields that need to be independently
/// decoded from any specific DRAM generation SPEC (e.g. SPD factory)
///
class init_fields
{
private:

enum
{
// Byte 1
REVISION_START = 0,
REVISION_LEN = 8,

// Byte 2
DEVICE_TYPE_START = 0,
DEVICE_TYPE_LEN = 8,

// Byte 3
HYBRID_START = 0,
HYBRID_LEN = 1,
HYBRID_MEDIA_START = 1,
HYBRID_MEDIA_LEN = 3,
BASE_MODULE_START = 4,
BASE_MODULE_LEN = 4,

// Byte 130
REF_RAW_CARD_START = 0,
REF_RAW_CARD_LEN = 8,
};

public:

// 1st field: Byte number
// 2nd field: Start bit
// 3rd field: Bit length
static constexpr field_t REVISION{1, REVISION_START, REVISION_LEN};
static constexpr field_t DEVICE_TYPE{2, DEVICE_TYPE_START, DEVICE_TYPE_LEN};
static constexpr field_t BASE_MODULE{3, BASE_MODULE_START, BASE_MODULE_LEN};
static constexpr field_t HYBRID{3, HYBRID_START, HYBRID_LEN};
static constexpr field_t HYBRID_MEDIA{3, HYBRID_MEDIA_START, HYBRID_MEDIA_LEN};
static constexpr field_t REF_RAW_CARD{130, REF_RAW_CARD_START, REF_RAW_CARD_LEN};
};

///
/// @class fields
/// @brief Collection of SPD fields
/// @tparam D DRAM device type (e.g. DDR4)
/// @tparam S SPD parameter (e.g. RDIMM_MODULE, NVDIMM_MODULE)
///
template <device_type D, parameters S>
class fields;

}// spd
}// mss

#endif // _MSS_SPD_FIELD_H_

0 comments on commit 81996e9

Please sign in to comment.