summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/test
diff options
context:
space:
mode:
authorMatt Derksen <v2cibmd@us.ibm.com>2016-09-09 10:51:57 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2016-09-16 15:24:08 -0400
commit3023dfca018c30c87072c4376c6f69dc35aef0d3 (patch)
tree40149cac472df14c4a3449ea00c61ae46f0e59a2 /src/usr/fapi2/test
parent48f5f0b3e5f1ec65e90d2307caed92ab000f869b (diff)
downloadtalos-hostboot-3023dfca018c30c87072c4376c6f69dc35aef0d3.tar.gz
talos-hostboot-3023dfca018c30c87072c4376c6f69dc35aef0d3.zip
Added CK and DQ vpd accessors
Change-Id: Ic72c985b1fe064273bc39f14bcc31595117c6a08 RTC:159347 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29421 Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt K. Light <mklight@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/29426 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/test')
-rw-r--r--src/usr/fapi2/test/getVpdTest.C116
-rw-r--r--src/usr/fapi2/test/getVpdTest.H22
2 files changed, 128 insertions, 10 deletions
diff --git a/src/usr/fapi2/test/getVpdTest.C b/src/usr/fapi2/test/getVpdTest.C
index e582ab609..6005d2d0a 100644
--- a/src/usr/fapi2/test/getVpdTest.C
+++ b/src/usr/fapi2/test/getVpdTest.C
@@ -227,7 +227,7 @@ void testDecode_MR(void)
0};
// decode keyword
- keywordName_t l_keywordName = {0};
+ keywordInfo_t l_keywordInfo = {0};
numTests++;
FAPI_EXEC_HWP(l_rc,
@@ -236,7 +236,7 @@ void testDecode_MR(void)
l_info,
l_pMapping,
VPD_KEYWORD_SIZE,
- l_keywordName);
+ l_keywordInfo);
if(l_rc)
{
TS_FAIL ("testDecode_MR:: p9_get_mem_vpd_keyword failed");
@@ -246,12 +246,12 @@ void testDecode_MR(void)
// compare to expected test data
numTests++;
- if ( (l_keywordName[0] != 'J' ) &&
- (l_keywordName[1] != '3' ) )
+ if ( (l_keywordInfo.kwName[0] != 'J' ) &&
+ (l_keywordInfo.kwName[1] != '3' ) )
{
TS_FAIL ("testDecode_MR:: unexpected keyword name returned"
"value = %x %x expected = %x %x",
- l_keywordName[0],l_keywordName[1],'J','3');
+ l_keywordInfo.kwName[0],l_keywordInfo.kwName[1],'J','3');
numFails++;
}
@@ -307,7 +307,7 @@ void testDecode_MT(void)
0};
// decode keyword
- keywordName_t l_keywordName = {0};
+ keywordInfo_t l_keywordInfo = {0};
numTests++;
FAPI_EXEC_HWP(l_rc,
p9_get_mem_vpd_keyword,
@@ -315,7 +315,7 @@ void testDecode_MT(void)
l_info,
l_pMapping,
VPD_KEYWORD_SIZE,
- l_keywordName);
+ l_keywordInfo);
if(l_rc)
{
TS_FAIL ("testDecode_MT:: p9_get_mem_vpd_keyword failed");
@@ -325,12 +325,12 @@ void testDecode_MT(void)
// compare to expected test data
numTests++;
- if ( (l_keywordName[0] != 'X' ) &&
- (l_keywordName[1] != '3' ) )
+ if ( (l_keywordInfo.kwName[0] != 'X' ) &&
+ (l_keywordInfo.kwName[1] != '3' ) )
{
TS_FAIL ("testDecode_MT:: unexpected keyword name returned"
"value = %x %x expected = %x %x",
- l_keywordName[0],l_keywordName[1],'X','3');
+ l_keywordInfo.kwName[0],l_keywordInfo.kwName[1],'X','3');
numFails++;
}
@@ -610,3 +610,99 @@ void testGetVPD_Override(void)
numMRFails+numMTFails, numMRTests+numMTTests);
}
+
+void testGetVPD_DQ(void)
+{
+ int numTests = 0;
+ int numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testGetVPD DQ start");
+
+ do
+ {
+ numTests++; // find MCS MEMVPD_POS
+ // get a MCS fapi2 target for MEMVPD_POS 0
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 0;
+
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testGetVPD_DQ:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numFails++;
+ break; //Target not found
+ }
+
+ // set up VPDInfo
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::DQ);
+
+ l_rc = testGetVPD(l_fapiTarget,
+ l_info,
+ fapi2::DQ,
+ nullptr, //don't test data, just ability to access
+ numTests,
+ numFails);
+ if(l_rc)
+ {
+ TS_FAIL ("testGetVPD DQ:: testGetVPD decode failed");
+ break; // decode failed (don't double count num tests and fails)
+ }
+
+ }
+ while(0);
+
+ FAPI_INF("testGetVPD DQ Test Complete, %d/%d fails",
+ numFails, numTests);
+}
+
+void testGetVPD_CK(void)
+{
+ int numTests = 0;
+ int numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testGetVPD CK start");
+
+ do
+ {
+ numTests++; // find MCS MEMVPD_POS
+
+ // get a MCS fapi2 target for MEMVPD_POS 0
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 0;
+
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testGetVPD_DQ:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numFails++;
+ break; //Target not found
+ }
+
+ // set up VPDInfo
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::CK);
+
+ // modify this if the data changes (currently common for all positions)
+ const char testData[] = {0x80,0x40, 0};
+
+ l_rc = testGetVPD(l_fapiTarget,
+ l_info,
+ fapi2::CK,
+ testData,
+ numTests,
+ numFails);
+ if(l_rc)
+ {
+ TS_FAIL ("testGetVPD CK:: testGetVPD decode failed");
+ break; // decode failed (don't double count num tests and fails)
+ }
+
+ }
+ while(0);
+
+ FAPI_INF("testGetVPD CK Test Complete, %d/%d fails",
+ numFails, numTests);
+}
diff --git a/src/usr/fapi2/test/getVpdTest.H b/src/usr/fapi2/test/getVpdTest.H
index b7b67e672..bc435e1b8 100644
--- a/src/usr/fapi2/test/getVpdTest.H
+++ b/src/usr/fapi2/test/getVpdTest.H
@@ -76,4 +76,26 @@ void testDecode_MT(void);
*/
void testGetVPD_Override(void);
+/**
+ * @brief MCS getVpd DQ tests
+ *
+ * Test the getVPD DQ interface. Based on a VPDInfo configuration,
+ * verify the expected direct memory vpd is returned.
+ * There is a dependency to update standalone simics direct memory (dvpd.dat)
+ * for the configuration to map to a keyword, but there is no data dependency.
+ * expected data.
+ */
+void testGetVPD_DQ(void);
+
+/**
+ * @brief MCS getVpd CK tests
+ *
+ * Test the getVPD CK interface. Based on a VPDInfo configuration,
+ * verify the expected direct memory vpd is returned.
+ * There is a dependency to update standalone simics direct memory (dvpd.dat)
+ * for the configuration to map to a keyword, but there is no data dependency.
+ * expected data.
+ */
+void testGetVPD_CK(void);
+
#endif
OpenPOWER on IntegriCloud