diff options
author | crgeddes <crgeddes@us.ibm.com> | 2016-06-27 11:06:24 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-07-25 00:18:44 -0400 |
commit | ee9b96fff03eb771d04a64b5d61e553834415bcf (patch) | |
tree | cf6bdd45267e409ac53a5c62d07cf4e22f1783a3 /src/usr/fapi2/test | |
parent | 84dd98b173bf22441cf665b182b33ad38638cffc (diff) | |
download | talos-hostboot-ee9b96fff03eb771d04a64b5d61e553834415bcf.tar.gz talos-hostboot-ee9b96fff03eb771d04a64b5d61e553834415bcf.zip |
Refactor plat_getScom and plat_putScom to use opMode param
Previously opMode had not been implemented to so we were not using
it while making scom calls through the fapi2 hw access interface.
Now that opMode is available the param is being added to the plat
call.
RTC:144505
Change-Id: If9ac3914082620309c73fb29e3a6074abc2cb89b
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26299
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/test')
-rw-r--r-- | src/usr/fapi2/test/fapi2HwAccessTest.H | 17 | ||||
-rw-r--r-- | src/usr/fapi2/test/p9_hwtests.C | 58 | ||||
-rw-r--r-- | src/usr/fapi2/test/p9_hwtests.H | 4 |
3 files changed, 79 insertions, 0 deletions
diff --git a/src/usr/fapi2/test/fapi2HwAccessTest.H b/src/usr/fapi2/test/fapi2HwAccessTest.H index dc1d4ff08..8fc3e7499 100644 --- a/src/usr/fapi2/test/fapi2HwAccessTest.H +++ b/src/usr/fapi2/test/fapi2HwAccessTest.H @@ -182,6 +182,23 @@ void test_fapi2HwAccess() // a false negative on the next case } + numTests++; + uint8_t failed = 0; + FAPI_INVOKE_HWP(l_errl, + p9_opmodetest_ignorehwerr, + fapi2_procTarget, + failed ); + + if(l_errl || failed) + { + TS_FAIL("p9_opmodetest_ignorehwerr returned an error!!"); + numFails++; + if(l_errl) + { + errlCommit(l_errl,FAPI2_COMP_ID); + } + } + #if 0 // TODO-RTC:151428 - need simics support for these to pass numTests++; diff --git a/src/usr/fapi2/test/p9_hwtests.C b/src/usr/fapi2/test/p9_hwtests.C index 55108755c..7222667c6 100644 --- a/src/usr/fapi2/test/p9_hwtests.C +++ b/src/usr/fapi2/test/p9_hwtests.C @@ -340,3 +340,61 @@ fapi2::ReturnCode p9_opmodetest_getsetopmode() return fapi2::current_err; } +fapi2::ReturnCode p9_opmodetest_ignorehwerr( + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, + uint8_t o_fail) +{ + FAPI_INF("Entering p9_opmodetest_ignorehwerr..."); + //Count the number of scoms we do so we can tell that we ran all of them. + //Putting in this test so we know opMode isnt getting reset on FAPI_TRY + uint8_t scomCount = 0; + const uint8_t EXPECTED_NUMBER_OF_SCOMS = 4; + + do{ + FAPI_INF("Setting opMode to IGNORE_HW_ERROR (0x1)"); + + fapi2::setOpMode(fapi2::IGNORE_HW_ERROR); + fapi2::buffer<uint64_t> l_scomdata1 = 0xFF00FF00; + fapi2::buffer<uint64_t> l_scomdata2 = 0xFF00FF00; + + fapi2::buffer<uint64_t> l_scomresult1 = 0x0; + fapi2::buffer<uint64_t> l_scomresult2 = 0x0; + + + FAPI_INF("Attempting 1st putScom, this should fail but because of opMode we skip the err"); + FAPI_TRY(fapi2::putScom(i_target, + 0xDEADBEEF, + l_scomdata1)); + scomCount++; + + FAPI_INF("Attempting 2nd putScom this should fail but because of opMode we skip the err"); + FAPI_TRY(fapi2::getScom(i_target, + 0xCABBABEF, + l_scomdata2)); + scomCount++; + + FAPI_INF("Attempting 1st getScom, this should fail but because of opMode we skip the err"); + FAPI_TRY(fapi2::getScom(i_target, + 0xDEADBEEF, + l_scomresult1)); + scomCount++; + + FAPI_INF("Attempting 2nd getScom, this should fail but because of opMode we skip the err"); + FAPI_TRY(fapi2::getScom(i_target, + 0xCABBABEF, + l_scomresult2)); + scomCount++; + + }while(0); + +fapi_try_exit: + + if(scomCount != EXPECTED_NUMBER_OF_SCOMS) + { + o_fail = 1; + } + FAPI_INF("Exiting p9_opmodetest_ignorehwerr..."); + + return fapi2::current_err; +} + diff --git a/src/usr/fapi2/test/p9_hwtests.H b/src/usr/fapi2/test/p9_hwtests.H index 634c823fe..6f184d9bc 100644 --- a/src/usr/fapi2/test/p9_hwtests.H +++ b/src/usr/fapi2/test/p9_hwtests.H @@ -74,6 +74,10 @@ fapi2::ReturnCode p9_cfamtest_putcfam_pass( fapi2::ReturnCode p9_opmodetest_getsetopmode(); +fapi2::ReturnCode p9_opmodetest_ignorehwerr( + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, + uint8_t fail); + ///////////// // // TODO-RTC:151428 - need simics support for these ring functions to pass |