summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwpf
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2013-08-15 16:40:38 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-13 12:57:46 -0500
commitfe7854394eb388e40bd94b7b4398003b6ac3b268 (patch)
tree8dba2bfd9801ff56161a47c954e8784079a6f9f9 /src/include/usr/hwpf
parent0b823dd9ef5579112cbbaae770028c75f7d19119 (diff)
downloadtalos-hostboot-fe7854394eb388e40bd94b7b4398003b6ac3b268.tar.gz
talos-hostboot-fe7854394eb388e40bd94b7b4398003b6ac3b268.zip
VPD Accessor functions for Clock Mapping, DIMM timing and TSYS VPD Attributes
Extend existing CDIMM hwp accessors for MR and MT keywords to add support for 7 new attributes. Based on vpd level 6.0 with work around driven by vpd version to also support vpd level 5.3 definition. FSP change to add cvpd record VINI to PNOR is 897882 Change-Id: I02b3a0ade288c6b75918ad1d99257c5a042fc18d RTC: 79615 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5805 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwpf')
-rw-r--r--src/include/usr/hwpf/fapi/fapiMBvpdAccess.H2
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H67
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H54
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatAttributeService.H46
4 files changed, 158 insertions, 11 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H
index 1370fee0c..270b48dff 100644
--- a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H
+++ b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H
@@ -53,6 +53,7 @@ namespace fapi
MBVPD_RECORD_VER0 = 0x01,
MBVPD_RECORD_MER0 = 0x02,
MBVPD_RECORD_VSPD = 0x03,
+ MBVPD_RECORD_VINI = 0x04,
};
enum MBvpdKeyword
@@ -67,6 +68,7 @@ namespace fapi
MBVPD_KEYWORD_MW = 0x07,
MBVPD_KEYWORD_MV = 0x08,
MBVPD_KEYWORD_AM = 0x09,
+ MBVPD_KEYWORD_VZ = 0x0a,
};
}
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H
index 88616a179..cb07272af 100644
--- a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H
@@ -36,8 +36,35 @@
namespace fapi
{
+// The MBvpdPhaseRotatorData enumeration is used on the FAPI_ATTR_GET and
+// getMBvpdPhaseRotatorData HWP accessor interface. The lower byte (6 bits)
+// matches the offset of the vpd field in the MR keyword. This is a convenient
+// use of the value for efficiency to index into the vpd keyword data.
+//
+// Most of the attributes are byte values and can be returned to the requester
+// directly. There are some that require special processing. For those, a
+// special processing flag is added into the value. This also distinguishes
+// values which have the same offset.
-// values match offset into MR keyword data
+// special processing flags to be added on to the MBvpdPhaseRotatorData value
+ enum MBvpdPhaseRotatorSpecial
+ {
+ PHASE_ROT_HIGH_NIBBLE = 0x0100, //bits 4:7 shifted right 4
+ PHASE_ROT_LOW_NIBBLE = 0x0200, //bits 0:3
+ PHASE_ROT_PORT00=0x0300, // return vpd port 0 value for 0 and 1
+ PHASE_ROT_PORT11=0x0400, // return vpd port 1 value for 0 and 1
+ };
+// mask to isolate special processing flags
+const uint16_t PHASE_ROT_SPECIAL_MASK = 0x0700;
+
+// The offset changed for some of the attributes going from v5.3 of the vpd
+// layout to v6.0 and after. There is a work around to use the proper offset
+// based on the version
+// Flag to be added into MBvpdPhaseRotatorData value for attributes that need
+// to be checked for the work around.
+const uint8_t PHASE_ROT_CHK60 = 0x40; // check version for offset to use
+
+// base values match offset into MR keyword data
enum MBvpdPhaseRotatorData
{
PHASE_ROT_M0_CLK_P0 = 0x00,
@@ -88,11 +115,24 @@ namespace fapi
PHASE_ROT_M1_CNTL_CSN3 = 0x2d,
PHASE_ROT_M1_CNTL_ODT0 = 0x2e,
PHASE_ROT_M1_CNTL_ODT1 = 0x2f,
-// The max value is 0x3f. The MR keyword is 255 bytes. There is only room for
-// 63 attributes per port. There are 4 x 64 byte sections,
-// but the last one is 1 byte short.
+ // DRAM_2N_MODE reserved = 0x30,
+ PHASE_ROT_TSYS_ADR = 0x31 | PHASE_ROT_CHK60 | PHASE_ROT_PORT00,
+ PHASE_ROT_TSYS_DP18 = 0x31 | PHASE_ROT_CHK60 | PHASE_ROT_PORT11,
+// Use these offsets for vpd less than version 6.0
+ PHASE_ROT_RLO_V53 = 0x31 | PHASE_ROT_HIGH_NIBBLE,
+ PHASE_ROT_WLO_V53 = 0x31 | PHASE_ROT_LOW_NIBBLE,
+ PHASE_ROT_GPO_V53= 0x32,
+ PHASE_ROT_TSYS_ADR_V53 = 0x33 | PHASE_ROT_PORT00,
+ PHASE_ROT_TSYS_DP18_V53 = 0x33 | PHASE_ROT_PORT11,
+ // invalid value
+ PHASE_ROT_INVALID = 0x3f,
};
}
+// The max base offset value is 0x3e. The MR keyword is 255 bytes.
+// There is only room for 63 attributes per port. There are 4 x 64 byte
+// sections, but the last one is 1 byte short. See diagram below...
+const uint8_t PHASE_ROT_OFFSET_MASK = 0x003f; // mask attr to isolate base
+ // vpd offsetk
// function pointer typedef definition for HWP call support
typedef fapi::ReturnCode (*getMBvpdPhaseRotatorData_FP_t)
@@ -108,6 +148,25 @@ extern "C"
* There are Phase Rotator attributes for the mba's 2 ports in cvpd
* record VSPD keyword MR. Each attribute has 2 bytes, one for each port.
* There are two mba per memory buffer, position 0 and position 1.
+ * The Termination Data attributes are retrieved from cvpd record VSPD
+ * keyword MT.
+ *
+ * cpvd record VSPD keyword MR
+ * -----------------------------------
+ * | mba position 0 |
+ * | ----------------------------- |
+ * | | port 0 (Port A) 64 bytes | |
+ * | |---------------------------| |
+ * | | port 1 (Port B) 64 bytes | |
+ * | ----------------------------- |
+ * |---------------------------------|
+ * | mba postion 1 |
+ * | ----------------------------- |
+ * | | port 0 (Port C) 64 bytes | |
+ * | |---------------------------| |
+ * | | port 1 (Port D) 63 bytes | |
+ * | ----------------------------- |
+ * -----------------------------------
*
* @param i_mbaTarget - mba target
* @param i_attr - Phase Rotator Data attribute enumerator
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H
index 57a6f111f..4679bdf30 100644
--- a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H
@@ -37,8 +37,34 @@
namespace fapi
{
-// Values match offset into MT keyword cvpd data
-// There are multiple types of output values. The type is shown in the comment
+// The MBvpdTermData enumeration is used on the FAPI_ATTR_GET and
+// getMBvpdTermData HWP accessor interface. The lower byte (6 bits)
+// matches the offset of the vpd field in the MT keyword. This is a convenient
+// use of the value for efficiency to index into the vpd keyword data.
+//
+// Most of the vpd attribute values can be returned to the requester directly.
+// There are some that require special processing. For those, a
+// special processing flag is added into the value. This also distinguishes
+// values which have the same offset.
+
+// special processing flags to be added on to the MBvpdTermData value
+ enum MBvpdTermDataSpecial
+ {
+ TERM_DATA_HIGH_NIBBLE = 0x0100, //bits 4:7 shifted right 4
+ TERM_DATA_LOW_NIBBLE = 0x0200, //bits 0:3
+ };
+// mask to isolate special processing flags
+const uint16_t TERM_DATA_SPECIAL_MASK = 0x0300;
+
+// The vpd keyword changed for some of the attributes going from v5.3 of the vpd
+// layout to v6.0 and after. There is a work around to use the previous
+// keyword based on the vpd version.
+// Flag to be added into MBvpdTermData value for attributes that need to be
+// checked for work around.
+const uint8_t TERM_DATA_CHK60 = 0x40; // check version for keyword to use
+
+// There are multiple types of output values. The type is shown in the comment.
+// The base offset value is incremented based on the vpd data type.
enum MBvpdTermData
{
TERM_DATA_DRAM_RON = 0x00, //uint8_t [2][2]
@@ -60,11 +86,19 @@ namespace fapi
TERM_DATA_CEN_SLEW_RATE_ADDR = 0x33, //uint8_t [2]
TERM_DATA_CEN_SLEW_RATE_CLK = 0x34, //uint8_t [2]
TERM_DATA_CEN_SLEW_RATE_SPCKE = 0x35, //uint8_t [2]
-// The max value is 0x3e. The MT keyword is 255 bytes divided into four
-// 64 byte sections, but the last one is 1 byte short. There is only room for
-// 63 bytes of attributes per section.
+// TERM_DATA_CKE_PRI_MAP is a uint16 in the vpd data. It is returned as
+// as a uint32. The offset is incremented by only 2 to get the next vpd value.
+ TERM_DATA_CKE_PRI_MAP = 0x36, //uint32_t [2]
+ TERM_DATA_CKE_PWR_MAP = 0x38, //uint32_t [2]
+ TERM_DATA_RLO = 0x3c|TERM_DATA_CHK60|TERM_DATA_HIGH_NIBBLE, //uint8_t[2]
+ TERM_DATA_WLO = 0x3c|TERM_DATA_CHK60|TERM_DATA_LOW_NIBBLE, //uint8_t[2]
+ TERM_DATA_GPO = 0x3d|TERM_DATA_CHK60, //uint8_t[2]
};
}
+// The max base offset value is 0x3e. The MT keyword is 255 bytes.
+// There is only room for 63 attributes per port. There are 4 x 64 byte
+// sections, but the last one is 1 byte short. See diagram below...
+const uint8_t TERM_DATA_OFFSET_MASK = 0x003f; //mask attr to isolate base offset
// Template class that is specialized for each attribute specifying it's type
template<const fapi::MBvpdTermData A>
@@ -107,6 +141,16 @@ template<>class MBvpdTermDataSize<fapi::TERM_DATA_CEN_SLEW_RATE_CLK>
{ public: typedef uint8_t Type[2]; };
template<>class MBvpdTermDataSize<fapi::TERM_DATA_CEN_SLEW_RATE_SPCKE>
{ public: typedef uint8_t Type[2]; };
+template<>class MBvpdTermDataSize<fapi::TERM_DATA_CKE_PRI_MAP>
+ { public: typedef uint32_t Type[2]; };
+template<>class MBvpdTermDataSize<fapi::TERM_DATA_CKE_PWR_MAP>
+ { public: typedef uint32_t Type[2]; };
+template<>class MBvpdTermDataSize<fapi::TERM_DATA_RLO>
+ { public: typedef uint8_t Type[2]; };
+template<>class MBvpdTermDataSize<fapi::TERM_DATA_WLO>
+ { public: typedef uint8_t Type[2]; };
+template<>class MBvpdTermDataSize<fapi::TERM_DATA_GPO>
+ { public: typedef uint8_t Type[2]; };
// Template function that checks that the type is as expected.
// This can be optionally called before calling the main HWP in order
diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
index 670b5125f..270cd543f 100644
--- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
+++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
@@ -37,6 +37,8 @@
* bofferdn 09/13/2011 Support fapi->hb mapping
* thi 01/28/2013 Add SPD CUSTOM attr
* dedahle 06/20/2013 Add Bad DIMM DQ Bitmap attr
+ * whs 08/15/2013 79615 Clock Mapping,
+ * DIMM timing and TSYS
*/
#ifndef FAPIPLATATTRIBUTESERVICE_H_
@@ -553,7 +555,6 @@ fapi::ReturnCode fapiPlatDimmGetSpareDram (
const fapi::Target * i_pTarget,
uint8_t &o_data);
-
} // namespace platAttrSvc
} // namespace fapi
@@ -1203,6 +1204,16 @@ fapi::ReturnCode fapiPlatDimmGetSpareDram (
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetPhaseRotatorData\
(PTARGET, PHASE_ROT_M1_CNTL_ODT1, VAL)
+#endif
+#define ATTR_VPD_TSYS_ADR_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetPhaseRotatorData\
+ (PTARGET, PHASE_ROT_TSYS_ADR, VAL)
+#define ATTR_VPD_TSYS_DP18_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetPhaseRotatorData\
+ (PTARGET, PHASE_ROT_TSYS_DP18, VAL)
+#if RTC69935
// TODO: RTC 69935: remove the no op sets once work around in
// mss_eff_config_termination.C is removed
#define ATTR_EFF_CEN_PHASE_ROT_M0_CLK_P0_SETMACRO(ID, PTARGET, VAL)\
@@ -1434,7 +1445,38 @@ fapi::ReturnCode fapiPlatDimmGetSpareDram (
(checkTermDataType<fapi::TERM_DATA_CEN_SLEW_RATE_SPCKE>(VAL), \
fapi::platAttrSvc::fapiPlatGetTermData\
(PTARGET, fapi::TERM_DATA_CEN_SLEW_RATE_SPCKE , VAL, sizeof(VAL)))
-
+#endif
+#define ATTR_VPD_RLO_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS :\
+ (checkTermDataType<fapi::TERM_DATA_RLO>(VAL), \
+ fapi::platAttrSvc::fapiPlatGetTermData\
+ (PTARGET, fapi::TERM_DATA_RLO , VAL, sizeof(VAL)))
+#define ATTR_VPD_WLO_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS :\
+ (checkTermDataType<fapi::TERM_DATA_WLO>(VAL), \
+ fapi::platAttrSvc::fapiPlatGetTermData\
+ (PTARGET, fapi::TERM_DATA_WLO , VAL, sizeof(VAL)))
+#define ATTR_VPD_GPO_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS :\
+ (checkTermDataType<fapi::TERM_DATA_GPO>(VAL), \
+ fapi::platAttrSvc::fapiPlatGetTermData\
+ (PTARGET, fapi::TERM_DATA_GPO , VAL, sizeof(VAL)))
+#define ATTR_VPD_CKE_PRI_MAP_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS :\
+ (checkTermDataType<fapi::TERM_DATA_CKE_PRI_MAP>(VAL), \
+ fapi::platAttrSvc::fapiPlatGetTermData\
+ (PTARGET, fapi::TERM_DATA_CKE_PRI_MAP , VAL, sizeof(VAL)))
+#define ATTR_VPD_CKE_PWR_MAP_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS :\
+ (checkTermDataType<fapi::TERM_DATA_CKE_PWR_MAP>(VAL), \
+ fapi::platAttrSvc::fapiPlatGetTermData\
+ (PTARGET, fapi::TERM_DATA_CKE_PWR_MAP , VAL, sizeof(VAL)))
+#if RTC69935
#define ATTR_EFF_DRAM_RON_SETMACRO(ID, PTARGET, VAL)\
fapi::FAPI_RC_SUCCESS
#define ATTR_EFF_DRAM_RTT_NOM_SETMACRO(ID, PTARGET, VAL)\
OpenPOWER on IntegriCloud