diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2017-06-06 15:39:40 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-06-23 10:29:55 -0400 |
commit | c4dc9402e4237e5318c834f4535f6c1f58419951 (patch) | |
tree | 95b33383281d8863c6ae6ae2532947b07c7733cd /src/usr/fapi2 | |
parent | b22bfa0529a673baea56805fa4fcc1ba65c29666 (diff) | |
download | talos-hostboot-c4dc9402e4237e5318c834f4535f6c1f58419951.tar.gz talos-hostboot-c4dc9402e4237e5318c834f4535f6c1f58419951.zip |
Allow deconfig without a callout in error log.
Change-Id: Ia2ce6f89b4fbc4bbafa355cb1da07bdbd360c317
RTC: 174701
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42085
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rw-r--r-- | src/usr/fapi2/plat_utils.C | 3 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2VerifyCalloutTest.C | 94 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2VerifyCalloutTest.H | 13 | ||||
-rw-r--r-- | src/usr/fapi2/test/rcSupport.C | 19 | ||||
-rw-r--r-- | src/usr/fapi2/test/rcSupport.H | 8 |
5 files changed, 136 insertions, 1 deletions
diff --git a/src/usr/fapi2/plat_utils.C b/src/usr/fapi2/plat_utils.C index 39c20b7b1..b19d5880c 100644 --- a/src/usr/fapi2/plat_utils.C +++ b/src/usr/fapi2/plat_utils.C @@ -88,7 +88,8 @@ HWAS::callOutPriority xlateCalloutPriority( const HWAS::callOutPriority HWAS_PRI[] = {HWAS::SRCI_PRIORITY_LOW, HWAS::SRCI_PRIORITY_MED, - HWAS::SRCI_PRIORITY_HIGH}; + HWAS::SRCI_PRIORITY_HIGH, + HWAS::SRCI_PRIORITY_NONE}; if (l_index < (sizeof(HWAS_PRI)/sizeof(HWAS::callOutPriority))) { diff --git a/src/usr/fapi2/test/fapi2VerifyCalloutTest.C b/src/usr/fapi2/test/fapi2VerifyCalloutTest.C index ca7238a6d..ed64b5690 100644 --- a/src/usr/fapi2/test/fapi2VerifyCalloutTest.C +++ b/src/usr/fapi2/test/fapi2VerifyCalloutTest.C @@ -334,3 +334,97 @@ uint32_t rcTestCalloutDeconfig() FAPI_INF("rcTestCalloutDeconfig finished"); return l_result; } + +uint32_t rcTestCalloutNoneDeconfig() +{ + uint32_t l_result = 0; + errlHndl_t l_errl = NULL; + bool l_hw_callout_found = false; + + FAPI_INF("rcTestCalloutNoneDeconfig running"); + + TARGETING::TargetHandleList l_dimmList; + TARGETING::getAllLogicalCards(l_dimmList, TARGETING::TYPE_DIMM, false); + TARGETING::Target * l_Dimm = NULL; + + //Take the first dimm + if (l_dimmList.size() > 0) + { + l_Dimm = l_dimmList[0]; + } + else + { + TS_FAIL("No dimms found"); + } + + //Convert to fapi2 target for the HWP below + fapi2::Target<fapi2::TARGET_TYPE_DIMM> fapi2_dimmTarget(l_Dimm); + + FAPI_INVOKE_HWP(l_errl, p9_deconfigCalloutNone, fapi2_dimmTarget); + + if(l_errl != NULL) + { + FAPI_INF("rcTestCalloutNoneDeconfig: p9_deconfigCalloutNone " + "returned errl (expected)"); + + //Get the User Data fields of the errl. They are returned as + //vector<void*>, so iterate over them. + for( auto l_callout_raw : l_errl-> + getUDSections( ERRL_COMP_ID, ERRORLOG::ERRL_UDT_CALLOUT ) ) + { + HWAS::callout_ud_t* l_callout_entry = + reinterpret_cast<HWAS::callout_ud_t*>(l_callout_raw); + + if(l_callout_entry->type == HWAS::HW_CALLOUT) + { + l_hw_callout_found = true; + FAPI_INF("rcTestCalloutNoneDeconfig: hw callout found"); + if(l_callout_entry->deconfigState == HWAS::DELAYED_DECONFIG) + { + FAPI_INF("rcTestCalloutNoneDeconfig: Target is deconfigured"); + } + else + { + TS_FAIL("rcTestCalloutNoneDeconfig: Target is NOT deconfigured"); + l_result = 1; + break; + } + } + } + if(!l_hw_callout_found) + { + TS_FAIL("rcTestCalloutNoneDeconfig: hw callout NOT found"); + l_result = 2; + } + } + else + { + TS_FAIL("rcTestCalloutNoneDeconfig: No error was returned from" + " p9_deconfigCalloutNone !!"); + l_result = 3; + } + + //l_errl->setSev(ERRORLOG::ERRL_SEV_RECOVERED); + //errlCommit(l_errl,CXXTEST_COMP_ID); + delete l_errl; + l_errl = NULL; + + // Now try it the way HWP people do it + ReturnCode l_rc; + FAPI_EXEC_HWP(l_rc, p9_deconfigCalloutNone, fapi2_dimmTarget); + if (l_rc != fapi2::FAPI2_RC_SUCCESS) + { + // log the error but don't fail the unit test + FAPI_INF("rcTestCalloutNoneDeconfig: logError called"); + fapi2::logError(l_rc, fapi2::FAPI2_ERRL_SEV_RECOVERED, true); + } + else + { + TS_FAIL("rcTestCalloutNoneDeconfig: No error was returned from " + "FAPI_EXEC_HWP p9_deconfigCalloutNone !!"); + l_result = 4; + } + + FAPI_INF("rcTestCalloutNoneDeconfig finished"); + return l_result; +} diff --git a/src/usr/fapi2/test/fapi2VerifyCalloutTest.H b/src/usr/fapi2/test/fapi2VerifyCalloutTest.H index eb52e7350..c5caf6ff1 100644 --- a/src/usr/fapi2/test/fapi2VerifyCalloutTest.H +++ b/src/usr/fapi2/test/fapi2VerifyCalloutTest.H @@ -86,5 +86,18 @@ public: TS_FAIL("rcTestCalloutDeconfig. Fail l_res=%d", l_res); } } + + /* + * @brief Test hw callout (none priority) with deconfig + */ + void testCalloutNoneDeconfig(void) + { + uint32_t l_res = rcTestCalloutNoneDeconfig(); + + if(l_res != 0) + { + TS_FAIL("rcTestCalloutNoneDeconfig. Fail l_res=%d", l_res); + } + } }; #endif diff --git a/src/usr/fapi2/test/rcSupport.C b/src/usr/fapi2/test/rcSupport.C index 84ecb84e6..c78d1a9bd 100644 --- a/src/usr/fapi2/test/rcSupport.C +++ b/src/usr/fapi2/test/rcSupport.C @@ -156,6 +156,25 @@ fapi2::ReturnCode p9_deconfigCallout( } //****************************************************************************** +// p9_deconfig_callout_none +// Force a test return code that deconfigures the target +//****************************************************************************** +fapi2::ReturnCode p9_deconfigCalloutNone( + fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_dimm_target) +{ + FAPI_INF("Enter p9_deconfigCalloutNone..."); + + FAPI_ASSERT(0, + fapi2::TEST_ERROR_DECONFIG_NO_CALLOUT().set_TARGET(i_dimm_target)); + + fapi_try_exit: + + FAPI_INF("Exiting p9_deconfigCalloutNone..."); + + return fapi2::current_err; +} + +//****************************************************************************** // p9_procedureCallout // Force a test return code that creates a procedure callout //****************************************************************************** diff --git a/src/usr/fapi2/test/rcSupport.H b/src/usr/fapi2/test/rcSupport.H index e2e22fa3e..5c729879b 100644 --- a/src/usr/fapi2/test/rcSupport.H +++ b/src/usr/fapi2/test/rcSupport.H @@ -72,6 +72,13 @@ fapi2::ReturnCode p9_gardAndDeconfig( fapi2::ReturnCode p9_deconfigCallout( fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_dimm_target); +//****************************************************************************** +// p9_deconfigCalloutNone +// Force a test return code that deconfigures the target +//****************************************************************************** +fapi2::ReturnCode p9_deconfigCalloutNone( + fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_dimm_target); + //***************************************************************************** // p9_procedureCallout // Force a test return code that creates a procedure callout @@ -85,6 +92,7 @@ fapi2::ReturnCode p9_procedureCallout(); fapi2::ReturnCode p9_hwCallout( fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_core_target); + //**************************************************************************** // p9ErrorWithBuffer // Force an error that will use a caller populated fapi2::buffer<> |