summaryrefslogtreecommitdiffstats
path: root/src/usr
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/usr
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/usr')
-rw-r--r--src/usr/hwpf/hwp/memory_attributes.xml70
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C93
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C146
-rw-r--r--src/usr/hwpf/plat/fapiPlatMBvpdAccess.C2
-rw-r--r--src/usr/hwpf/test/fapiwinkletest.H160
-rw-r--r--src/usr/vpd/cvpd.H2
-rw-r--r--src/usr/vpd/makefile2
-rwxr-xr-xsrc/usr/vpd/test/cvpdtest.H1
8 files changed, 457 insertions, 19 deletions
diff --git a/src/usr/hwpf/hwp/memory_attributes.xml b/src/usr/hwpf/hwp/memory_attributes.xml
index af1fb78d3..a65b076d1 100644
--- a/src/usr/hwpf/hwp/memory_attributes.xml
+++ b/src/usr/hwpf/hwp/memory_attributes.xml
@@ -3642,6 +3642,76 @@ will originates from VPD for custom DIMMs in the MW keyword byte 5 (MSB is on th
-->
<attribute>
+ <id>ATTR_VPD_CKE_PRI_MAP</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD keyword MT bytes 54 and 55 MT(54:55) for the Logical DIMM associated with port A. Bytes 118:119 for port B, 182:183 for port C and 246:247 for port D. In the end, the AB and CD portions form a 32 bit word for each mba to write into the corresponding ddrphy register</description>
+ <valueType>uint32</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
+ <id>ATTR_VPD_CKE_PWR_MAP</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD keyword MT bytes 56 to 59 MT(56:59) for the Logical DIMM associated with port A. Bytes 120:123 for port B, 184:187 for port C and 248:251 for port D</description>
+ <valueType>uint32</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
+ <id>ATTR_VPD_GPO</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD keyword MT bytes 61 MT(61) for the Logical DIMM associated with port A. Bytes 125 for port B, 189 for port C and 253 for port D</description>
+ <valueType>uint8</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
+ <id>ATTR_VPD_RLO</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD keyword MT byte 60 bits 4:7 for the Logical DIMM associated with port A. Byte 124 bits 4:7 for port B, 188 bits 4:7 for port C and 252 bits 4:7 for port D</description>
+ <valueType>uint8</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
+ <id>ATTR_VPD_WLO</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD keyword MT byte 60 bits 0:3 for the Logical DIMM associated with port A. Byte 124 bits 0:3 for port B, 188 bits 0:3 for port C and 252 bits 0:3 for port D</description>
+ <valueType>uint8</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
+ <id>ATTR_VPD_TSYS_ADR</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD MR keyword byte 49 for ports A and B and byte 177 for port C and D. This means that all ADR blocks use this value on an mba level</description>
+ <valueType>uint8</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
+ <id>ATTR_VPD_TSYS_DP18</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>This value comes from the VPD MR keyword byte 113 for ports A and B and byte 241 for port C and D. This means all DP18 blocks use this value on a mba level</description>
+ <valueType>uint8</valueType>
+ <platInit/>
+ <odmVisable/>
+ <array>2</array>
+</attribute>
+
+<attribute>
<id>ATTR_LAB_USE_JTAG_MODE</id>
<targetType>TARGET_TYPE_SYSTEM</targetType>
<description>This attribute controls how the procedures operate in JTAG mode under an environment called cronus flex. For normal operation, this attribute should be set to FALSE. Platforms should initialize this attribute to FALSE.</description>
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C
index 7df854c2f..a0708b870 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C
@@ -72,8 +72,12 @@ fapi::ReturnCode getMBvpdPhaseRotatorData(
uint8_t l_pos = NUM_PORTS; //initialize to out of range value (+1)
mr_keyword * l_pMrBuffer = NULL; // MBvpd MR keyword buffer
uint32_t l_MrBufsize = sizeof(mr_keyword);
-
- FAPI_DBG("getMBvpdPhaseRotatorData: entry attr=0x%02x ",
+ // Mask off to isolate vpd offset. MBvpdPhaseRatorData value is the offset
+ // into vpd. Also protects against indexing out of bounds.
+ uint8_t l_attrOffset = i_attr & PHASE_ROT_OFFSET_MASK;
+ uint32_t l_special = i_attr & PHASE_ROT_SPECIAL_MASK; // mask off to
+ // isolate special processing flags
+ FAPI_DBG("getMBvpdPhaseRotatorData: entry attr=0x%04x ",
i_attr );
do {
@@ -98,6 +102,57 @@ fapi::ReturnCode getMBvpdPhaseRotatorData(
FAPI_DBG("getMBvpdPhaseRotatorData: parent path=%s ",
l_mbTarget.toEcmdString() );
+ // Check if the old vpd layout is different for this attr
+ if (PHASE_ROT_CHK60 & i_attr) // need to check vpd version for this attr
+ {
+ uint16_t l_vpdVersion = 0;
+ uint32_t l_bufSize = sizeof(l_vpdVersion);
+ const uint16_t VPD_VERSION_V60=0x3130; // Version 6.0 is ascii "10"
+
+ // get vpd version from record VINI keyword VZ
+ l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VINI,
+ fapi::MBVPD_KEYWORD_VZ,
+ l_mbTarget,
+ reinterpret_cast<uint8_t *>(&l_vpdVersion),
+ l_bufSize);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdPhaseRotatorData: Read of VZ keyword failed");
+ break; // break out with fapirc
+ }
+ FAPI_DBG("getMBvpdPhaseRotatorData: vpd version=0x%08x",
+ l_vpdVersion);
+
+ // Check that sufficient size was returned.
+ if (l_bufSize < sizeof(l_vpdVersion) )
+ {
+ FAPI_ERR("getMBvpdPhaseRotatorData:"
+ " less keyword data returned than expected %d < %d",
+ l_bufSize, sizeof(l_vpdVersion));
+ const uint32_t & KEYWORD = sizeof(l_vpdVersion);
+ const uint32_t & RETURNED_SIZE = l_bufSize;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
+ break; // break out with fapirc
+ }
+
+ // Check if work around needed
+ if (l_vpdVersion < VPD_VERSION_V60)
+ {
+ // use the v5.3 offsets and special processing
+ if (PHASE_ROT_TSYS_ADR == i_attr)
+ {
+ l_attrOffset=PHASE_ROT_TSYS_ADR_V53 & PHASE_ROT_OFFSET_MASK;
+ l_special=PHASE_ROT_TSYS_ADR_V53 & PHASE_ROT_SPECIAL_MASK;
+ }
+ else if (PHASE_ROT_TSYS_DP18 == i_attr)
+ {
+ l_attrOffset=PHASE_ROT_TSYS_DP18_V53 &
+ PHASE_ROT_OFFSET_MASK;
+ l_special=PHASE_ROT_TSYS_DP18_V53 & PHASE_ROT_SPECIAL_MASK;
+ }
+ }
+ }
+
// Read the MR keyword field
l_pMrBuffer = new mr_keyword;
@@ -124,13 +179,39 @@ fapi::ReturnCode getMBvpdPhaseRotatorData(
break; // break out with fapirc
}
- // return the requested attributes from the MR keyword buffer
- for (uint8_t l_port=0 ; l_port<NUM_PORTS ; l_port++)
+ // pull data from MR keyword buffer
+ uint8_t l_port0=
+ l_pMrBuffer->mb_mba[l_pos].mba_port[0].port_attr[l_attrOffset];
+ uint8_t l_port1=
+ l_pMrBuffer->mb_mba[l_pos].mba_port[1].port_attr[l_attrOffset];
+ switch (l_special)
{
- o_val[l_port]=l_pMrBuffer->
- mb_mba[l_pos].mba_port[l_port].port_attr[i_attr];
+ case PHASE_ROT_LOW_NIBBLE: // return low nibble
+ l_port0 = l_port0 & 0x0F;
+ l_port1 = l_port1 & 0x0F;
+ break;
+
+ case PHASE_ROT_HIGH_NIBBLE: // return high nibble
+ l_port0 = ((l_port0 & 0xF0)>>4);
+ l_port1 = ((l_port1 & 0xF0)>>4);
+ break;
+
+ case PHASE_ROT_PORT00: // return port 0 for both ports 0 and 1
+ l_port1=l_port0;
+ break;
+
+ case PHASE_ROT_PORT11:// return port 1 for both ports 0 and 1
+ l_port0=l_port1;
+ break;
+
+ default:
+ ; // data is ok directly from MR keyword buffer
}
+ // return the requested attributes from the MR keyword buffer
+ o_val[0]=l_port0;
+ o_val[1]=l_port1;
+
} while (0);
delete l_pMrBuffer;
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
index 7723d38cf..7e2713e86 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
@@ -34,6 +34,7 @@
#include <fapi.H>
#include <fapiUtil.H>
#include <getMBvpdTermData.H>
+#include <getMBvpdPhaseRotatorData.H>
extern "C"
{
@@ -77,6 +78,9 @@ fapi::ReturnCode getMBvpdTermData(
mt_keyword * l_pMtBuffer = NULL; // MBvpd MT keyword buffer
uint32_t l_MtBufsize = sizeof(mt_keyword);
uint32_t l_sizeCheck = 0; //invalid size
+ // Mask off to isolate vpd offset. MBvpdTermData value is offset into vpd.
+ // Also protects against indexing out of bounds
+ uint8_t l_attrOffset = i_attr & TERM_DATA_OFFSET_MASK;
FAPI_DBG("getMBvpdTermData: entry attr=0x%02x, size=%d ",
i_attr,i_valSize );
@@ -161,6 +165,26 @@ fapi::ReturnCode getMBvpdTermData(
l_sizeCheck=
sizeof (MBvpdTermDataSize<TERM_DATA_CEN_SLEW_RATE_SPCKE>::Type);
break;
+ case TERM_DATA_CKE_PRI_MAP:
+ l_sizeCheck=
+ sizeof (MBvpdTermDataSize<TERM_DATA_CKE_PRI_MAP>::Type);
+ break;
+ case TERM_DATA_CKE_PWR_MAP:
+ l_sizeCheck=
+ sizeof (MBvpdTermDataSize<TERM_DATA_CKE_PWR_MAP>::Type);
+ break;
+ case TERM_DATA_RLO:
+ l_sizeCheck=
+ sizeof (MBvpdTermDataSize<TERM_DATA_RLO>::Type);
+ break;
+ case TERM_DATA_WLO:
+ l_sizeCheck=
+ sizeof (MBvpdTermDataSize<TERM_DATA_WLO>::Type);
+ break;
+ case TERM_DATA_GPO:
+ l_sizeCheck=
+ sizeof (MBvpdTermDataSize<TERM_DATA_GPO>::Type);
+ break;
default: // Hard to do, but needs to be caught
FAPI_ERR("getMBvpdTermData: invalid attribute ID 0x%02x",
i_attr);
@@ -204,6 +228,75 @@ fapi::ReturnCode getMBvpdTermData(
FAPI_DBG("getMBvpdTermData: parent path=%s ",
l_mbTarget.toEcmdString() );
+ // Check if the old vpd layout is different for this attr
+ if (TERM_DATA_CHK60 & i_attr) // need to check vpd version for this attr
+ {
+ uint16_t l_vpdVersion = 0;
+ uint32_t l_bufSize = sizeof(l_vpdVersion);
+ const uint16_t VPD_VERSION_V60=0x3130; // Version 6.0 is ascii "10"
+
+ // get vpd version from record VINI keyword VZ
+ l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VINI,
+ fapi::MBVPD_KEYWORD_VZ,
+ l_mbTarget,
+ reinterpret_cast<uint8_t *>(&l_vpdVersion),
+ l_bufSize);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdTermData: Read of VZ keyword failed");
+ break; // break out with fapirc
+ }
+ FAPI_DBG("getMBvpdTermData: vpd version=0x%08x",
+ l_vpdVersion);
+
+ // Check that sufficient size was returned.
+ if (l_bufSize < sizeof(l_vpdVersion) )
+ {
+ FAPI_ERR("getMBvpdTermData:"
+ " less keyword data returned than expected %d < %d",
+ l_bufSize, sizeof(l_vpdVersion));
+ const uint32_t & KEYWORD = sizeof(l_vpdVersion);
+ const uint32_t & RETURNED_SIZE = l_bufSize;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
+ break; // break out with fapirc
+ }
+
+ // Check if work around needed
+ if (l_vpdVersion < VPD_VERSION_V60)
+ {
+ MBvpdPhaseRotatorData l_phaseRotAttr = PHASE_ROT_INVALID;
+
+ if (TERM_DATA_RLO == i_attr)
+ {
+ l_phaseRotAttr = PHASE_ROT_RLO_V53;
+ }
+ else if (TERM_DATA_WLO == i_attr)
+ {
+ l_phaseRotAttr = PHASE_ROT_WLO_V53;
+ }
+ else if (TERM_DATA_GPO == i_attr)
+ {
+ l_phaseRotAttr = PHASE_ROT_GPO_V53;
+ }
+ else // not expected
+ {
+ FAPI_ERR("getMBvpdTermData: invalid attribute ID 0x%02x",
+ i_attr);
+ const fapi::MBvpdTermData & ATTR_ID = i_attr;
+ FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INVALID_ATTRIBUTE_ID);
+ break; // break out with fapirc
+ }
+
+ // Retrieve these attributes from the MR keyword
+ FAPI_EXEC_HWP(l_fapirc,
+ getMBvpdPhaseRotatorData,
+ i_mbaTarget,
+ l_phaseRotAttr,
+ *((uint8_t (*)[2])o_pVal));
+ break; // break out with Phase Rotator data fapirc
+ }
+ }
+
// Read the MT keyword field
l_pMtBuffer = new mt_keyword;
@@ -243,7 +336,7 @@ fapi::ReturnCode getMBvpdTermData(
for (uint8_t l_j=0; l_j<NUM_DIMMS; l_j++)
{
(*l_pVal)[l_port][l_j] = l_pMtBuffer->
- mb_mba[l_pos].mba_port[l_port].port_attr[i_attr+l_j];
+ mb_mba[l_pos].mba_port[l_port].port_attr[l_attrOffset+l_j];
}
}
break;
@@ -262,7 +355,7 @@ fapi::ReturnCode getMBvpdTermData(
for (uint8_t l_k=0; l_k<NUM_RANKS; l_k++)
{
(*l_pVal)[l_port][l_j][l_k] = l_pMtBuffer->
- mb_mba[l_pos].mba_port[l_port].port_attr[i_attr+(l_j*NUM_RANKS)+l_k];
+ mb_mba[l_pos].mba_port[l_port].port_attr[l_attrOffset+(l_j*NUM_RANKS)+l_k];
}
}
}
@@ -272,16 +365,33 @@ fapi::ReturnCode getMBvpdTermData(
// need to consider endian since they are word fields
case TERM_DATA_CEN_RD_VREF:
case TERM_DATA_DRAM_WR_VREF:
+ case TERM_DATA_CKE_PWR_MAP:
{
uint32_t (* l_pVal)[2] = (uint32_t (*)[2])o_pVal;
for (uint8_t l_port=0; l_port<2;l_port++)
{
uint32_t * l_pWord = (uint32_t *)&l_pMtBuffer->
- mb_mba[l_pos].mba_port[l_port].port_attr[i_attr];
+ mb_mba[l_pos].mba_port[l_port].port_attr[l_attrOffset];
(*l_pVal)[l_port] = FAPI_BE32TOH(*l_pWord);
}
break;
}
+ // return the uint16_t [2] attributes from the MT keyword buffer
+ // into the return uint32_t [2]
+ // need to consider endian since they are word fields
+ case TERM_DATA_CKE_PRI_MAP:
+ {
+ uint32_t (* l_pVal)[2] = (uint32_t (*)[2])o_pVal;
+ (*l_pVal)[0] = l_pMtBuffer->
+ mb_mba[l_pos].mba_port[0].port_attr[l_attrOffset+1]; //LSB
+ (*l_pVal)[0] |= (l_pMtBuffer->
+ mb_mba[l_pos].mba_port[0].port_attr[l_attrOffset]<<8); //MSB
+ (*l_pVal)[1] = l_pMtBuffer->
+ mb_mba[l_pos].mba_port[1].port_attr[l_attrOffset+1]; //LSB
+ (*l_pVal)[1] |= (l_pMtBuffer->
+ mb_mba[l_pos].mba_port[1].port_attr[l_attrOffset]<<8); //MSB
+ break;
+ }
// return the uint8_t [2] attributes from the MT keyword buffer
case TERM_DATA_DRAM_WRDDR4_VREF:
case TERM_DATA_CEN_RCV_IMP_DQ_DQS:
@@ -295,13 +405,37 @@ fapi::ReturnCode getMBvpdTermData(
case TERM_DATA_CEN_SLEW_RATE_ADDR:
case TERM_DATA_CEN_SLEW_RATE_CLK:
case TERM_DATA_CEN_SLEW_RATE_SPCKE:
+ case TERM_DATA_RLO:
+ case TERM_DATA_WLO:
+ case TERM_DATA_GPO:
{
uint8_t (* l_pVal)[2] = (uint8_t (*)[2])o_pVal;
- for (uint8_t l_port=0; l_port<NUM_PORTS;l_port++)
+
+ // pull data from keyword buffer
+ uint8_t l_port0 = l_pMtBuffer->
+ mb_mba[l_pos].mba_port[0].port_attr[l_attrOffset];
+ uint8_t l_port1 = l_pMtBuffer->
+ mb_mba[l_pos].mba_port[1].port_attr[l_attrOffset];
+
+ // isolate special processing flags
+ uint32_t l_special = i_attr & TERM_DATA_SPECIAL_MASK;
+ switch (l_special)
{
- (*l_pVal)[l_port] = l_pMtBuffer->
- mb_mba[l_pos].mba_port[l_port].port_attr[i_attr];
+ case TERM_DATA_LOW_NIBBLE: // return low nibble
+ l_port0 = l_port0 & 0x0F;
+ l_port1 = l_port1 & 0x0F;
+ break;
+
+ case TERM_DATA_HIGH_NIBBLE: // return high nibble
+ l_port0 = ((l_port0 & 0xF0)>>4);
+ l_port1 = ((l_port1 & 0xF0)>>4);
+ break;
+ default:
+ ; // data is ok directly from keyword buffer
}
+
+ (*l_pVal)[0] = l_port0;
+ (*l_pVal)[1] = l_port1;
break;
}
}
diff --git a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C
index c5efb2d96..670da1379 100644
--- a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C
+++ b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C
@@ -59,6 +59,7 @@ fapi::ReturnCode MBvpdRecordXlate(const fapi::MBvpdRecord i_fapiRecord,
CVPD::VER0,
CVPD::MER0,
CVPD::VSPD,
+ CVPD::VINI,
};
const uint8_t NUM_MBVPD_RECORDS =
sizeof(mbvpdFapiRecordToHbRecord)/sizeof(mbvpdFapiRecordToHbRecord[0]);
@@ -118,6 +119,7 @@ fapi::ReturnCode MBvpdKeywordXlate(const fapi::MBvpdKeyword i_fapiKeyword,
CVPD::MW,
CVPD::MV,
CVPD::AM,
+ CVPD::VZ,
};
const uint8_t NUM_MBVPD_KEYWORDS =
sizeof(mbvpdFapiKeywordToHbKeyword)/sizeof(mbvpdFapiKeywordToHbKeyword[0]);
diff --git a/src/usr/hwpf/test/fapiwinkletest.H b/src/usr/hwpf/test/fapiwinkletest.H
index 99ca55192..d88eb4d34 100644
--- a/src/usr/hwpf/test/fapiwinkletest.H
+++ b/src/usr/hwpf/test/fapiwinkletest.H
@@ -26,6 +26,7 @@
// set to 1 for doing unit tests, set to 0 for production
#define UNITTESTfwt 0
+#define UNITTEST2fwt 0
// TODO: RTC 69935 complete Phase Rotator Data and Termination Data.
// Use the code in the 1 path until CDIMM vpd has proper values.
// Then the 1 path code can be removed and keep the 0 path code.
@@ -82,9 +83,11 @@ public:
fapi::MvpdRecord record;
fapi::MvpdKeyword keyword;
} l_mvpdRecords[] = {
+#if UNITTESTfwt
{ MVPD_RECORD_CP00, MVPD_KEYWORD_PDG},
{ MVPD_RECORD_MER0, MVPD_KEYWORD_PDI},
// { MVPD_RECORD_VER0, MVPD_KEYWORD_PDI}, //VER0 in spec,not supported
+#endif
{ MVPD_RECORD_VWML, MVPD_KEYWORD_PDI},
};
@@ -180,6 +183,7 @@ public:
fapi::MBvpdRecord record;
fapi::MBvpdKeyword keyword;
} l_mbvpdRecords[] = {
+#if UNITTESTfwt
{ MBVPD_RECORD_VEIR, MBVPD_KEYWORD_PDI},
// { MBVPD_RECORD_VER0, MBVPD_KEYWORD_PDI},//in spec, not supported
{ MBVPD_RECORD_MER0, MBVPD_KEYWORD_PDI},
@@ -192,6 +196,8 @@ public:
{ MBVPD_RECORD_VSPD, MBVPD_KEYWORD_MW},
{ MBVPD_RECORD_VSPD, MBVPD_KEYWORD_MV},
{ MBVPD_RECORD_VSPD, MBVPD_KEYWORD_AM},
+#endif
+ { MBVPD_RECORD_VINI, MBVPD_KEYWORD_VZ},
};
TS_TRACE( "testGetMBvpd entry" );
@@ -519,14 +525,17 @@ public:
void testGetTermData()
{
fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS );
- uint8_t val1[2][2] = {{0xFF,0xFF},{0xFF,0xFF}};
#if UNITTESTfwt
+ uint8_t val1[2][2] = {{0xFF,0xFF},{0xFF,0xFF}};
uint8_t val2[2][2][4]={
{{0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF}},
{{0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF}}};
- uint32_t val3[2] = {0xFFFFFFFF,0xFFFFFFFF};
- uint8_t val4[2] = {0xFF,0xFF};
uint8_t l_errorChk = 1; //do error checks just once
+ uint8_t val4[2] = {0xFF,0xFF};
+#endif
+ uint32_t val3[2] = {0xFFFFFFFF,0xFFFFFFFF};
+#if UNITTEST2fwt
+ uint8_t val5[2] = {0xFF,0xFF};
#endif
#if RTC69935fwt
getMBvpdTermData_FP_t (l_getMBvpdTermData)
@@ -635,6 +644,7 @@ public:
#if RTC69935fwt
// Verify fetching attributes by calling the HWP directly
+#if UNITTESTfwt
// TERM_DATA_DRAM_RON
l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
fapi::TERM_DATA_DRAM_RON,
@@ -644,7 +654,6 @@ public:
"TERM_DATA_DRAM_RON=(0x%02x,0x%02x),(0x%02x,0x%02x)",
val1[0][0], val1[0][1], val1[1][0], val1[1][1]);
-#if UNITTESTfwt
// TERM_DATA_DRAM_RTT_NOM
l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
fapi::TERM_DATA_DRAM_RTT_NOM,
@@ -835,6 +844,55 @@ public:
"TERM_DATA_CEN_SLEW_RATE_SPCKE=0x%02x,0x%02x",
val4[0], val4[1]);
#endif
+ // TERM_DATA_CKE_PRI_MAP
+ l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
+ fapi::TERM_DATA_CKE_PRI_MAP,
+ &val3, sizeof(val3));
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData accessor "
+ "TERM_DATA_CKE_PRI_MAP=0x%08x,0x%08x",
+ val3[0], val3[1]);
+
+#if UNITTESTfwt
+ // TERM_DATA_CKE_PWR_MAP
+ val3[0] = 0xFFFFFFFF;
+ val3[1] = 0xFFFFFFFF;
+ l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
+ fapi::TERM_DATA_CKE_PWR_MAP,
+ &val3, sizeof(val3));
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData accessor "
+ "TERM_DATA_CKE_PWR_MAP=0x%08x,0x%08x",
+ val3[0], val3[1]);
+
+ // TERM_DATA_RLO
+ l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
+ fapi::TERM_DATA_RLO,
+ &val4, sizeof(val4));
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData accessor "
+ "TERM_DATA_RLO=0x%02x,0x%02x",
+ val4[0], val4[1]);
+
+ // TERM_DATA_WLO
+ l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
+ fapi::TERM_DATA_WLO,
+ &val4, sizeof(val4));
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData accessor "
+ "TERM_DATA_WLO=0x%02x,0x%02x",
+ val4[0], val4[1]);
+
+ // TERM_DATA_GPO
+ l_fapirc = (*l_getMBvpdTermData)(l_fapi_mba_target,
+ fapi::TERM_DATA_GPO,
+ &val4, sizeof(val4));
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData accessor "
+ "TERM_DATA_GPO=0x%02x,0x%02x",
+ val4[0], val4[1]);
+#endif
+
#else
// Verify fetching attributes using FAPI_ATTR_GET
// TERM_DATA_DRAM_RON
@@ -1019,6 +1077,53 @@ public:
val4[0], val4[1]);
#endif
#endif
+
+ // TERM_DATA_CKE_PRI_MAP
+ val3[0] = 0xFFFFFFFF;
+ val3[1] = 0xFFFFFFFF;
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_CKE_PRI_MAP,
+ &l_fapi_mba_target, val3);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData attr "
+ "TERM_DATA_CKE_PRI_MAP=0x%08x,0x%08x",
+ val3[0], val3[1]);
+
+#if UNITTEST2fwt
+ // TERM_DATA_CKE_PWR_MAP
+ val3[0] = 0xFFFFFFFF;
+ val3[1] = 0xFFFFFFFF;
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_CKE_PWR_MAP,
+ &l_fapi_mba_target, val3);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData attr "
+ "TERM_DATA_CKE_PWR_MAP=0x%08x,0x%08x",
+ val3[0], val3[1]);
+
+ // TERM_DATA_RLO
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_RLO,
+ &l_fapi_mba_target, val5);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData attr "
+ "TERM_DATA_VPD_RLO=(0x%02x,0x%02x)",
+ val5[0], val5[1]);
+
+ // TERM_DATA_WLO
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_WLO,
+ &l_fapi_mba_target, val5);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData attr "
+ "TERM_DATA_VPD_WLO=(0x%02x,0x%02x)",
+ val5[0], val5[1]);
+
+ // TERM_DATA_GPO
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_GPO,
+ &l_fapi_mba_target, val5);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetTermData attr "
+ "TERM_DATA_VPD_GPO=(0x%02x,0x%02x)",
+ val5[0], val5[1]);
+#endif
+
}
if (l_fapirc)
{
@@ -1035,7 +1140,7 @@ public:
/**
- * @brief call fapiGetMBvpdField to fetch memory buffer vpd records.
+ * @brief call getMBvpdPhaseRotData to fetch memory buffer MR attributes
*
*/
void testGetPhaseRotatorData()
@@ -1094,6 +1199,7 @@ public:
// getting all the attributes is a bit of over kill.
// cen_ddrphy.initfile accesses all the values
// the exhaustive test is good for unit test
+
l_fapirc = (*l_getMBvpdPhaseRotatorData)(l_fapi_mba_target,
fapi::PHASE_ROT_M0_CLK_P0,
l_attr_eff_cen_phase_rot);
@@ -1102,6 +1208,7 @@ public:
" ATTR_EFF_CEN_PHASE_ROT_M0_CLK_P0=(0x%02x,0x%02x)",
l_attr_eff_cen_phase_rot[0],
l_attr_eff_cen_phase_rot[1]);
+
#if UNITTESTfwt
l_fapirc = (*l_getMBvpdPhaseRotatorData)(l_fapi_mba_target,
fapi::PHASE_ROT_M0_CLK_P1,
@@ -1525,6 +1632,28 @@ public:
" ATTR_EFF_CEN_PHASE_ROT_M1_CNTL_ODT1=(0x%02x,0x%02x)",
l_attr_eff_cen_phase_rot[0],
l_attr_eff_cen_phase_rot[1]);
+
+ l_attr_eff_cen_phase_rot[0] = 0xFF;
+ l_attr_eff_cen_phase_rot[1] = 0xFF;
+ l_fapirc = (*l_getMBvpdPhaseRotatorData)(l_fapi_mba_target,
+ fapi::PHASE_ROT_TSYS_ADR,
+ l_attr_eff_cen_phase_rot);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetPhaseRotatorData accessor"
+ " ATTR_VPD_TSYS_ADR=(0x%02x,0x%02x)",
+ l_attr_eff_cen_phase_rot[0],
+ l_attr_eff_cen_phase_rot[1]);
+
+ l_attr_eff_cen_phase_rot[0] = 0xFF;
+ l_attr_eff_cen_phase_rot[1] = 0xFF;
+ l_fapirc = (*l_getMBvpdPhaseRotatorData)(l_fapi_mba_target,
+ fapi::PHASE_ROT_TSYS_DP18,
+ l_attr_eff_cen_phase_rot);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetPhaseRotatorData accessor"
+ " ATTR_VPD_TSYS_DP18=(0x%02x,0x%02x)",
+ l_attr_eff_cen_phase_rot[0],
+ l_attr_eff_cen_phase_rot[1]);
#endif
#else
// getting all the attributes is a bit of over kill.
@@ -1961,8 +2090,28 @@ public:
" ATTR_EFF_CEN_PHASE_ROT_M1_CNTL_ODT1=(0x%02x,0x%02x)",
l_attr_eff_cen_phase_rot[0],
l_attr_eff_cen_phase_rot[1]);
+
#endif
#endif
+#ifdef UNITTEST2fwt
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_TSYS_ADR,
+ &l_fapi_mba_target,
+ l_attr_eff_cen_phase_rot);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetPhaseRotatorData"
+ " ATTR_VPD_TSYS_ADR=(0x%02x,0x%02x)",
+ l_attr_eff_cen_phase_rot[0],
+ l_attr_eff_cen_phase_rot[1]);
+
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_TSYS_DP18,
+ &l_fapi_mba_target,
+ l_attr_eff_cen_phase_rot);
+ if (l_fapirc) break;
+ TS_TRACE( "testGetPhaseRotatorData"
+ " ATTR_VPD_TSYS_DP18=(0x%02x,0x%02x)",
+ l_attr_eff_cen_phase_rot[0],
+ l_attr_eff_cen_phase_rot[1]);
+#endif
}
if (l_fapirc)
{
@@ -1972,7 +2121,6 @@ public:
}
}
-
TS_TRACE( "testGetPhaseRotatorData exit" );
}
diff --git a/src/usr/vpd/cvpd.H b/src/usr/vpd/cvpd.H
index d2c9bd15c..3598e144c 100644
--- a/src/usr/vpd/cvpd.H
+++ b/src/usr/vpd/cvpd.H
@@ -65,6 +65,7 @@ namespace CVPD
{ VER0, "VER0" }, //Not currently used, but keep support
{ MER0, "MER0" },
{ VSPD, "VSPD" },
+ { VINI, "VINI" },
// -------------------------------------------------------------------
// DO NOT USE!! This is for test purposes ONLY!
{ CVPD_TEST_RECORD, "TEST" },
@@ -93,6 +94,7 @@ namespace CVPD
{ MW, "MW" },
{ MV, "MV" },
{ AM, "AM" },
+ { VZ, "VZ" },
// -------------------------------------------------------------------
// DO NOT USE!! This is for test purposes ONLY!
{ CVPD_TEST_KEYWORD, "XX" },
diff --git a/src/usr/vpd/makefile b/src/usr/vpd/makefile
index c581e7b75..3a8a59154 100644
--- a/src/usr/vpd/makefile
+++ b/src/usr/vpd/makefile
@@ -29,6 +29,6 @@ SUBDIRS = test.d
BINARY_FILES = $(IMGDIR)/dimmspd.dat:3a9f53e3684e57401ed0aed75f25980fca99f40b
BINARY_FILES += $(IMGDIR)/procmvpd.dat:7dabbe4879dcdd19ed236573aa68e8671fa8c3c7
-BINARY_FILES += $(IMGDIR)/cvpd.dat:7410a45451fb7826daf1ae218f81b2a694e64234
+BINARY_FILES += $(IMGDIR)/cvpd.dat:1d43fa2a410a81b39b51b57248a3259cd3bf6352
include ${ROOTPATH}/config.mk
diff --git a/src/usr/vpd/test/cvpdtest.H b/src/usr/vpd/test/cvpdtest.H
index 957a328ef..90f91a660 100755
--- a/src/usr/vpd/test/cvpdtest.H
+++ b/src/usr/vpd/test/cvpdtest.H
@@ -73,6 +73,7 @@ cvpdTestData cvpdData[] =
{ CVPD::VSPD, CVPD::MW },
{ CVPD::VSPD, CVPD::MV },
{ CVPD::VSPD, CVPD::AM },
+ { CVPD::VINI, CVPD::VZ },
};
OpenPOWER on IntegriCloud