diff options
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 |