summaryrefslogtreecommitdiffstats
path: root/src/usr/pnor/test/pnorddtest.H
diff options
context:
space:
mode:
authorMike Baiocchi <baiocchi@us.ibm.com>2014-02-10 15:19:43 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-03-02 13:18:36 -0600
commitef737aaa136524bcc9fc9145a294bdea50d56fce (patch)
tree31a44048d3dcff26ac7bcad952d98aaa5daa8cb3 /src/usr/pnor/test/pnorddtest.H
parentb9d96f43deaff20ceec92230a004bf6c290b594e (diff)
downloadtalos-hostboot-ef737aaa136524bcc9fc9145a294bdea50d56fce.tar.gz
talos-hostboot-ef737aaa136524bcc9fc9145a294bdea50d56fce.zip
PNORDD Improvement to handle LPC Slave Errors
This commit contains improvements to PNORRP and PNORDD error callouts. It also includes looking for errors in the LPC slave status register and specifc errors in the SFC status register. It also adds a FFDC function that dumps registers and adds them to the error log. Change-Id: I5fee0a65063999d15fb3d9bbd4ca64fcc409de4d RTC: 62718 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8745 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/pnor/test/pnorddtest.H')
-rw-r--r--src/usr/pnor/test/pnorddtest.H128
1 files changed, 127 insertions, 1 deletions
diff --git a/src/usr/pnor/test/pnorddtest.H b/src/usr/pnor/test/pnorddtest.H
index 546240cb9..5f91b8f07 100644
--- a/src/usr/pnor/test/pnorddtest.H
+++ b/src/usr/pnor/test/pnorddtest.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* COPYRIGHT International Business Machines Corp. 2011,2014 */
/* */
/* p1 */
/* */
@@ -972,6 +972,132 @@ class PnorDdTest : public CxxTest::TestSuite
}
+ /**
+ * @brief PNOR DD Force Fails testcase
+ */
+/****************************************************************************/
+/* NOTE: TEST DISABLED!!! remove "_" before test name to re-enable */
+/****************************************************************************/
+ void _test_forceFails(void)
+ {
+ errlHndl_t l_err = NULL;
+ uint64_t fails = 0;
+ uint64_t total = 0;
+ PnorDD* pnordd = new PnorDD();
+ uint32_t l_poll = 0;
+ PnorDD::SfcCmdReg_t sfc_cmd;
+
+ do{
+ TRACFCOMP(g_trac_pnor, "PnorDdTest::test_forceFails> starting - expect to see errors");
+
+ /*******************************/
+ /* Send in an invalid OP Code */
+ /*******************************/
+ sfc_cmd.opcode = PnorDD::SFC_OP_INVALID;
+ sfc_cmd.length = 0;
+
+ mutex_lock(&(pnordd->cv_mutex));
+ l_err = pnordd->writeRegSfc(PnorDD::SFC_CMD_SPACE,
+ PnorDD::SFC_REG_CMD,
+ sfc_cmd.data32);
+ total++;
+ if (l_err)
+ {
+ TS_FAIL("PnorDdTest::test_forceFails> Get Chip Id cmd failed! Error committed.");
+ fails++;
+
+ // Unlock mutex for Error Log to be commited
+ mutex_unlock(&(pnordd->cv_mutex));
+ errlCommit(l_err,PNOR_COMP_ID);
+
+ // Lock mutex for next operation
+ mutex_lock(&(pnordd->cv_mutex));
+ }
+
+ // Poll for complete status without waiting
+ l_err = pnordd->pollSfcOpComplete();
+ mutex_unlock(&(pnordd->cv_mutex));
+
+ total++;
+ if ( l_err == NULL )
+ {
+ TS_FAIL("PnorDdTest::test_forceFails> Failed to create illegal opcode error!");
+ fails++;
+ }
+ else
+ {
+ // error correctly created - delete it
+ delete l_err;
+ }
+
+ /*******************************************************/
+ /* Issue a cmd but poll for completion without waiting */
+ /*******************************************************/
+ //Issue Get Chip ID command
+ sfc_cmd.opcode = PnorDD::SFC_OP_CHIPID;
+ sfc_cmd.length = 0;
+
+ mutex_lock(&(pnordd->cv_mutex));
+ l_err = pnordd->writeRegSfc(PnorDD::SFC_CMD_SPACE,
+ PnorDD::SFC_REG_CMD,
+ sfc_cmd.data32);
+
+ total++;
+ if (l_err)
+ {
+ TS_FAIL("PnorDdTest::test_forceFails> Get Chip Id cmd failed! Error committed.");
+ fails++;
+
+ // Unlock mutex for Error Log to be commited
+ mutex_unlock(&(pnordd->cv_mutex));
+ errlCommit(l_err,PNOR_COMP_ID);
+
+ // Lock mutex for next operation
+ mutex_lock(&(pnordd->cv_mutex));
+ }
+
+ // Poll for complete status without waiting
+ l_err = pnordd->pollSfcOpComplete(l_poll);
+
+ total++;
+ if ( l_err == NULL )
+ {
+ TS_FAIL("PnorDdTest::test_forceFails> pollSfcOpCompletel(l_poll=0) Failed to create an error!");
+ fails++;
+ }
+ else
+ {
+ // error correctly created - delete it
+ delete l_err;
+ }
+
+ /*******************************************************/
+ /* Cleanup: poll to make sure last operation completes */
+ /* before continuing */
+ /*******************************************************/
+ l_err = pnordd->pollSfcOpComplete();
+ mutex_unlock(&(pnordd->cv_mutex));
+
+ total++;
+ if (l_err)
+ {
+ TS_FAIL("PnorDdTest::test_forceFails> Cleanup polling failed! Error committed.");
+ errlCommit(l_err,PNOR_COMP_ID);
+ fails++;
+ }
+
+
+ }while(0);
+
+ if( pnordd )
+ {
+ delete pnordd;
+ }
+
+ TRACFCOMP(g_trac_pnor, "PnorDdTest::test_forceFails> %d/%d fails", fails, total );
+
+ }
+
};
/*Not really a real test, just using to verify ext image is loading properly.
OpenPOWER on IntegriCloud