diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2019-02-20 09:18:07 -0600 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-03-07 16:35:52 -0600 |
commit | 386165c1c5dad4b0dde4a94401b4feb0435787a9 (patch) | |
tree | f43ec0e10671d3751a3d3d1eb7160306b1a8da95 /src/usr/fapi2 | |
parent | ebf6fda9958f1b82742bea22e98388f38a9b62d5 (diff) | |
download | talos-hostboot-386165c1c5dad4b0dde4a94401b4feb0435787a9.tar.gz talos-hostboot-386165c1c5dad4b0dde4a94401b4feb0435787a9.zip |
Updates to testcases for Axone
Disabling a few testcases temporarily until Axone gets off
the ground.
Cleaned up some bad traces, etc in existing code.
Add CI support for AXONE config
Change-Id: I7a2140366e225971c91a50cec1f7e822e4847078
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72186
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rw-r--r-- | src/usr/fapi2/test/fapi2BasicTryTest.H | 16 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2GetChildrenTest.H | 96 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2GetParentTest.H | 21 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2HwpTest.H | 5 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2IsFunctionalTest.H | 5 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2MmioAccessTest.H | 3 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2TestUtils.C | 26 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2TestUtils.H | 13 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2ToStringTest.H | 66 |
9 files changed, 181 insertions, 70 deletions
diff --git a/src/usr/fapi2/test/fapi2BasicTryTest.H b/src/usr/fapi2/test/fapi2BasicTryTest.H index 1c73f833e..cf1bfe0f8 100644 --- a/src/usr/fapi2/test/fapi2BasicTryTest.H +++ b/src/usr/fapi2/test/fapi2BasicTryTest.H @@ -23,7 +23,7 @@ /* */ /* IBM_PROLOG_END_TAG */ #include <fapi2.H> -// #include <plat_attribute_service.H> +#include <fapi2/plat_hwp_invoker.H> //-------------------------------------------------------------------------- /// @file p9_basicTry.C @@ -148,41 +148,45 @@ class Fapi2BasicTryTest : public CxxTest::TestSuite int numTests = 0; int numFails = 0; fapi2::ReturnCode l_rc; - + errlHndl_t l_err = nullptr; FAPI_INF("fapi2basicTry starting ... "); numTests++; - l_rc = p9_fapi_tryFailure(); + FAPI_INVOKE_HWP_RC(l_err,l_rc,p9_fapi_tryFailure); if ( true == (bool)l_rc ) { numFails++; TS_FAIL(" p9_fapi_tryFailure returned error"); } + if( l_err ) { delete l_err; } numTests++; - l_rc = p9_fapi_assertFailure(); + FAPI_INVOKE_HWP_RC(l_err,l_rc,p9_fapi_assertFailure); if ( true == (bool)l_rc ) { numFails++; TS_FAIL(" p9_fapi_assertFailure returned error"); } + if( l_err ) { delete l_err; } numTests++; - l_rc = p9_fapi_trySuccess(); + FAPI_INVOKE_HWP_RC(l_err,l_rc,p9_fapi_trySuccess); if ( true == (bool)l_rc ) { numFails++; TS_FAIL(" p9_fapi_trySuccess returned error"); } + if( l_err ) { delete l_err; } numTests++; - l_rc = p9_fapi_assertSuccess(); + FAPI_INVOKE_HWP_RC(l_err,l_rc,p9_fapi_assertSuccess); if ( true == (bool)l_rc ) { numFails++; TS_FAIL(" p9_fapi_assertSuccess returned error"); } + if( l_err ) { delete l_err; } FAPI_INF("fapi2basicTry:: Test Complete. %d/%d fails", numFails, numTests); diff --git a/src/usr/fapi2/test/fapi2GetChildrenTest.H b/src/usr/fapi2/test/fapi2GetChildrenTest.H index 04f3863ba..3971c1270 100644 --- a/src/usr/fapi2/test/fapi2GetChildrenTest.H +++ b/src/usr/fapi2/test/fapi2GetChildrenTest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -31,10 +31,8 @@ #include <cxxtest/TestSuite.H> #include <functional> #include <plat_utils.H> - - #include <error_scope.H> - +#include <config.h> namespace fapi2 { @@ -101,7 +99,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: MCAs per MCBIST mismatch"); + TS_FAIL("test_fapi2GetChildren:: MCAs per MCBIST mismatch"); numFails++; break; } @@ -120,7 +118,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: DMIs per MC mismatch"); + TS_FAIL("test_fapi2GetChildren:: DMIs per MC mismatch"); numFails++; break; } @@ -140,7 +138,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: OMIs per MC mismatch"); + TS_FAIL("test_fapi2GetChildren:: OMIs per MC mismatch"); numFails++; break; } @@ -155,7 +153,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: present cores per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: present cores per proc mismatch"); numFails++; break; } @@ -170,7 +168,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: functional cores per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: functional cores per proc mismatch"); numFails++; break; } @@ -188,7 +186,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: MCAs per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: MCAs per proc mismatch"); numFails++; break; } @@ -207,7 +205,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: DMIs per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: DMIs per proc mismatch"); numFails++; break; } @@ -227,29 +225,46 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: OMIs per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: OMIs per proc mismatch"); numFails++; break; } } - if (isHwValid(l_proc, MY_OMIC) + if (isHwValid(l_proc, MY_OMIC2) && isHwValid(l_proc, MY_OMI)) { - l_childOMIs = fapi2_omicTarget.getChildren<fapi2::TARGET_TYPE_OMI>(TARGET_STATE_PRESENT); - l_targetHuid = TARGETING::get_huid(targeting_targets[MY_OMIC]); + l_childOMIs = fapi2_omic2Target.getChildren<fapi2::TARGET_TYPE_OMI>(TARGET_STATE_PRESENT); + l_targetHuid = TARGETING::get_huid(targeting_targets[MY_OMIC2]); l_actualSize = l_childOMIs.size(); - //Set expected size to be the number of OMIs per proc - l_expectedSize = MAX_OMI_PER_OMIC; + // OMIC2 only has 2 OMIs (others have 3) + l_expectedSize = 2; numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: # OMIs foound for OMIC0 proc is %d and not %d", + TS_FAIL("test_fapi2GetChildren:: # OMIs foound for OMIC0 proc is %d and not %d", l_actualSize, l_expectedSize); numFails++; break; } + + bool l_foundme = false; + for( auto omi : l_childOMIs ) + { + if( reinterpret_cast<TARGETING::Target*>(omi.get()) + == targeting_targets[MY_OMI] ) + { + l_foundme = true; + break; + } + } + if( !l_foundme ) + { + TS_FAIL("OMI %.8X not found in child list for OMIC %.8X", + TARGETING::get_huid(targeting_targets[MY_OMI]), + TARGETING::get_huid(targeting_targets[MY_OMIC2])); + } } if (isHwValid(l_proc, MY_OMI) @@ -264,7 +279,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: OCMBs per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: OCMBs per proc mismatch"); numFails++; break; } @@ -282,7 +297,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: MEM_PORTs per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: MEM_PORTs per proc mismatch"); numFails++; break; } @@ -298,7 +313,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: cores per EX mismatch"); + TS_FAIL("test_fapi2GetChildren:: cores per EX mismatch"); numFails++; break; } @@ -313,7 +328,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: cores per EQ mismatch"); + TS_FAIL("test_fapi2GetChildren:: cores per EQ mismatch"); numFails++; break; } @@ -329,7 +344,7 @@ void test_fapi2GetChildren() numTests++; if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: EXs per proc mismatch"); + TS_FAIL("test_fapi2GetChildren:: EXs per proc mismatch"); numFails++; break; } @@ -735,7 +750,7 @@ void test_fapi2GetChildren() if(candidateTarget == nullptr) { - FAPI_INF("fapi2TargetTest:: candidateTarget not found"); + TS_FAIL("test_fapi2GetChildren:: candidateTarget not found"); numFails++; break; } @@ -749,7 +764,7 @@ void test_fapi2GetChildren() if(l_actualSize != l_expectedSize) { - FAPI_INF("fapi2TargetTest:: children of pervasive mismatch"); + TS_FAIL("test_fapi2GetChildren:: children of pervasive mismatch"); numFails++; break; } @@ -788,7 +803,7 @@ void test_fapi2GetChildren() l_targetHuid, true/*SW Error*/); errlCommit(l_err,HWPF_COMP_ID); - TS_FAIL("fapi2TargetTest Fail, for HUID: %d , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize ); + TS_FAIL("test_fapi2GetChildren Fail, for HUID: %d , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize ); } FAPI_INF("fapi2GetChildrenTest:: Test Complete. %d/%d fails", numFails , numTests); } @@ -837,7 +852,6 @@ void test_fapi2GetChildrenFilter() } else if(targeting_targets[x] == nullptr) { - FAPI_ERR("Unable to find target for item %d in targeting_targets", x); numFails++; TS_FAIL("test_fapi2GetChildrenFilter Fail: Unable to find target for item %d in targeting_targets", x); break; @@ -955,6 +969,7 @@ void test_fapi2getChildTargetsForCDG() size_t l_expectedDimmsUnderPort0 = 0; size_t l_expectedDimmsUnderPort1 = 0; TARGETING::TargetHandleList l_chipList; + do { FAPI_DBG("start of test_fapi2getChildTargetsForCDG()"); @@ -980,18 +995,23 @@ void test_fapi2getChildTargetsForCDG() l_expectedDimmsUnderPort0 = l_expectedDimms; l_expectedDimmsUnderPort1 = 0; } - else if (l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_CUMULUS || - l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_AXONE) + else if (l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_CUMULUS) { l_expectedDimms = 8; l_expectedDimmsUnderPort0 = l_expectedDimms/2; l_expectedDimmsUnderPort1 = l_expectedDimms/2; } + else if (l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_AXONE) + { + l_expectedDimms = 9; + l_expectedDimmsUnderPort0 = 0xFF; //wrong + l_expectedDimmsUnderPort1 = 0xFF; //wrong + } else //both are nullptr { // Should never get here since error should have been returned // above - FAPI_ERR("fapi2getChildTargetsForCDG: Never Should Happen"); + TS_FAIL("fapi2getChildTargetsForCDG: Never Should Happen"); numFails++; break; } @@ -1010,7 +1030,7 @@ void test_fapi2getChildTargetsForCDG() numTests++; if(l_dimmList.size() != l_expectedDimms) { - FAPI_ERR("test_fapi2getChildTargetsForCDG: Dimm count %d not equal expected %d", + TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d not equal expected %d", l_dimmList.size(),l_expectedDimms); numFails++; } @@ -1027,9 +1047,11 @@ void test_fapi2getChildTargetsForCDG() if(l_dimmList.size() != l_expectedDimmsUnderPort0) { - FAPI_ERR("test_fapi2getChildTargetsForCDG: Dimm count %d under port 0 not equal expected %d", +#ifndef CONFIG_AXONE_BRING_UP + TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under port 0 not equal expected %d", l_dimmList.size(),l_expectedDimmsUnderPort0); numFails++; +#endif } // All dimms under port 1 @@ -1044,9 +1066,11 @@ void test_fapi2getChildTargetsForCDG() if(l_dimmList.size() != l_expectedDimmsUnderPort1) { - FAPI_ERR("test_fapi2getChildTargetsForCDG: Dimm count %d under port 1 not equal expected %d", +#ifndef CONFIG_AXONE_BRING_UP + TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under port 1 not equal expected %d", l_dimmList.size(),l_expectedDimmsUnderPort1); numFails++; +#endif } // All dimms under socket 0 @@ -1060,9 +1084,11 @@ void test_fapi2getChildTargetsForCDG() numTests++; if(l_dimmList.size() != l_expectedDimms) { - FAPI_ERR("test_fapi2getChildTargetsForCDG: Dimm count %d under socket 0 not equal expected %d", +#ifndef CONFIG_AXONE_BRING_UP + TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under socket 0 not equal expected %d", l_dimmList.size(),l_expectedDimms); numFails++; +#endif } // All dimms under socket 1 @@ -1076,7 +1102,7 @@ void test_fapi2getChildTargetsForCDG() numTests++; if(l_dimmList.size() != 0) { - FAPI_ERR("test_fapi2getChildTargetsForCDG: Dimm count %d under socket 1 not equal expected %d", + TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under socket 1 not equal expected %d", l_dimmList.size(),0); numFails++; } diff --git a/src/usr/fapi2/test/fapi2GetParentTest.H b/src/usr/fapi2/test/fapi2GetParentTest.H index 6ac5e9926..5137432e0 100644 --- a/src/usr/fapi2/test/fapi2GetParentTest.H +++ b/src/usr/fapi2/test/fapi2GetParentTest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -69,7 +69,10 @@ void test_fapi2GetParent() if(TARGETING::get_huid(targeting_targets[PARENT_TEST_TARGET_ID]) != \ TARGETING::get_huid(l_parent)) \ { \ - TS_FAIL("fapi2TargetTest::Unable to find SRC_TYPE's" #PARENT_TYPE "parent!"); \ + TS_FAIL("test_fapi2GetParent::Unable to find " #SRC_TYPE "'s " #PARENT_TYPE " parent!"); \ + FAPI_INF("Found=%.8X, Expected=%.8X", \ + TARGETING::get_huid(l_parent), \ + TARGETING::get_huid(targeting_targets[PARENT_TEST_TARGET_ID])); \ numFails++; \ } \ } @@ -192,12 +195,12 @@ void test_fapi2GetParent() } // OMIC Parent Tests if (isHwValid(l_proc, MY_MC) && - isHwValid(l_proc, MY_OMIC)) + isHwValid(l_proc, MY_OMIC0)) { // Check parent MC - GET_PARENT_TEST_MACRO(MY_OMI, TARGET_TYPE_OMIC, MY_MC, TARGET_TYPE_MC) + GET_PARENT_TEST_MACRO(MY_OMIC0, TARGET_TYPE_OMIC, MY_MC, TARGET_TYPE_MC) // Check parent proc - GET_PARENT_TEST_MACRO(MY_OMI, TARGET_TYPE_OMIC, MY_PROC, TARGET_TYPE_PROC_CHIP) + GET_PARENT_TEST_MACRO(MY_OMIC0, TARGET_TYPE_OMIC, MY_PROC, TARGET_TYPE_PROC_CHIP) } // OMI Parent Tests if (isHwValid(l_proc, MY_OMI)) @@ -209,10 +212,10 @@ void test_fapi2GetParent() // Check parent MCC GET_PARENT_TEST_MACRO(MY_OMI, TARGET_TYPE_OMI, MY_MCC, TARGET_TYPE_MCC) } - if (isHwValid(l_proc, MY_OMIC)) + if (isHwValid(l_proc, MY_OMIC2)) { // Check parent OMIC - GET_PARENT_TEST_MACRO(MY_OMI, TARGET_TYPE_OMI, MY_OMIC, TARGET_TYPE_OMIC) + GET_PARENT_TEST_MACRO(MY_OMI, TARGET_TYPE_OMI, MY_OMIC2, TARGET_TYPE_OMIC) } if (isHwValid(l_proc, MY_MI)) { @@ -354,7 +357,7 @@ void test_fapi2GetParent() {targeting_targets[MY_OMI], [](TARGETING::Target* i_pTarget) {return getPervasiveParent<TARGET_TYPE_OMI>(i_pTarget); }}, - {targeting_targets[MY_OMIC], + {targeting_targets[MY_OMIC0], [](TARGETING::Target* i_pTarget) {return getPervasiveParent<TARGET_TYPE_OMIC>(i_pTarget); }}, }; @@ -443,7 +446,7 @@ void test_fapi2GetParent() true/*SW Error*/); errlCommit(l_err,HWPF_COMP_ID); - TS_FAIL("fapi2TargetTest::Unable to find unit's pervasive!"); + TS_FAIL("test_fapi2GetParent::Unable to find unit's pervasive!"); numFails++; } } diff --git a/src/usr/fapi2/test/fapi2HwpTest.H b/src/usr/fapi2/test/fapi2HwpTest.H index 63ef6af69..a8f8fb6d9 100644 --- a/src/usr/fapi2/test/fapi2HwpTest.H +++ b/src/usr/fapi2/test/fapi2HwpTest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -100,7 +100,8 @@ void test_fapi2Hwp() HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_mi, fapi2_miTarget, MY_MI) HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_dmi, fapi2_dmiTarget, MY_DMI) HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_omi, fapi2_omiTarget, MY_OMI) - HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_omic, fapi2_omicTarget, MY_OMIC) + HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_omic, fapi2_omic0Target, MY_OMIC0) + HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_omic, fapi2_omic2Target, MY_OMIC2) HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_mcc, fapi2_mccTarget, MY_MCC) HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_ocmb, fapi2_ocmbTarget, MY_OCMB) HWP_TEST_MODEL_SPECIFIC_MACRO(p9_sample_procedure_mem_port, fapi2_memportTarget, MY_MEM_PORT) diff --git a/src/usr/fapi2/test/fapi2IsFunctionalTest.H b/src/usr/fapi2/test/fapi2IsFunctionalTest.H index 6ebebcbcf..3d60f9083 100644 --- a/src/usr/fapi2/test/fapi2IsFunctionalTest.H +++ b/src/usr/fapi2/test/fapi2IsFunctionalTest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -88,7 +88,8 @@ class Fapi2IsFunctional : public CxxTest::TestSuite IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_MI], fapi2_miTarget) IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_DMI], fapi2_dmiTarget) IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OMI], fapi2_omiTarget) - IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OMIC], fapi2_omicTarget) + IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OMIC0], fapi2_omic0Target) + IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OMIC2], fapi2_omic2Target) IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_MCC], fapi2_mccTarget) IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_PROC], fapi2_procTarget) IS_FUNCTIONAL_TEST_MACRO(targeting_targets[MY_OCMB], fapi2_ocmbTarget) diff --git a/src/usr/fapi2/test/fapi2MmioAccessTest.H b/src/usr/fapi2/test/fapi2MmioAccessTest.H index dca8421a0..3ba0f31c0 100644 --- a/src/usr/fapi2/test/fapi2MmioAccessTest.H +++ b/src/usr/fapi2/test/fapi2MmioAccessTest.H @@ -38,6 +38,7 @@ #include <fapi2TestUtils.H> #include <p9_mmiotests.H> #include <plat_hwp_invoker.H> +#include <config.h> using namespace fapi2; @@ -151,6 +152,7 @@ void test_fapi2MmioAccess() int numTests = 0; int numFails = 0; +#ifndef CONFIG_AXONE_BRING_UP errlHndl_t l_errl = nullptr; // Create a vector of TARGETING::Target pointers @@ -211,6 +213,7 @@ void test_fapi2MmioAccess() l_errl = nullptr; } } +#endif FAPI_INF("fapi2MmioAccessTest Test Complete. %d/%d fails", numFails, numTests); } diff --git a/src/usr/fapi2/test/fapi2TestUtils.C b/src/usr/fapi2/test/fapi2TestUtils.C index 3d5c59894..6a6187d11 100644 --- a/src/usr/fapi2/test/fapi2TestUtils.C +++ b/src/usr/fapi2/test/fapi2TestUtils.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -161,7 +161,7 @@ void generateTargets(TARGETING::Target* i_pMasterProcChip, // when looking up the target l_epath.setType(TARGETING::EntityPath::PATH_AFFINITY); - // Setup OCBM_CHIP and MEM_PORT + // Setup OCMB_CHIP and MEM_PORT GENERATE_TARGET(TYPE_OCMB_CHIP,sys0node0ocmb0,MY_OCMB,0) GENERATE_TARGET(TYPE_MEM_PORT,sys0node0ocmb0memport0,MY_MEM_PORT,0) @@ -173,8 +173,10 @@ void generateTargets(TARGETING::Target* i_pMasterProcChip, l_epath.removeLast(); l_epath.removeLast(); l_epath.removeLast(); - // Setup OMIC - GENERATE_TARGET(TYPE_OMIC,sys0node0proc0mc0omic0,MY_OMIC,0) + // Setup OMICs + GENERATE_TARGET(TYPE_OMIC,sys0node0proc0mc0omic0,MY_OMIC0,0) + l_epath.removeLast(); + GENERATE_TARGET(TYPE_OMIC,sys0node0proc0mc0omic2,MY_OMIC2,2) } // End System Specific P9 Target @@ -193,18 +195,22 @@ bool isHwValid(TARGETING::Target* i_procChip, uint8_t i_hwType) auto l_model = i_procChip->getAttr<TARGETING::ATTR_MODEL>(); if (l_model == TARGETING::MODEL_CUMULUS) { - if (i_hwType == MY_MCS || i_hwType == MY_MCA || i_hwType == MY_MCBIST || - i_hwType == MY_OMI || i_hwType == MY_OMIC || i_hwType == MY_MCC || - i_hwType == MY_OCMB || i_hwType == MY_MEM_PORT) + if (i_hwType == MY_MCS || i_hwType == MY_MCA + || i_hwType == MY_MCBIST || i_hwType == MY_OMI + || i_hwType == MY_OMIC0 || i_hwType == MY_OMIC2 + || i_hwType == MY_MCC || i_hwType == MY_OCMB + || i_hwType == MY_MEM_PORT) { isValid = false; } } else if (l_model == TARGETING::MODEL_NIMBUS) { - if (i_hwType == MY_MC || i_hwType == MY_MI || i_hwType == MY_DMI || - i_hwType == MY_OMI || i_hwType == MY_OMIC || i_hwType == MY_MCC || - i_hwType == MY_OCMB || i_hwType == MY_MEM_PORT) + if (i_hwType == MY_MC || i_hwType == MY_MI + || i_hwType == MY_DMI || i_hwType == MY_OMI + || i_hwType == MY_OMIC0 || i_hwType == MY_OMIC2 + || i_hwType == MY_MCC || i_hwType == MY_OCMB + || i_hwType == MY_MEM_PORT) { isValid = false; } diff --git a/src/usr/fapi2/test/fapi2TestUtils.H b/src/usr/fapi2/test/fapi2TestUtils.H index e49cc0f3a..7b724a094 100644 --- a/src/usr/fapi2/test/fapi2TestUtils.H +++ b/src/usr/fapi2/test/fapi2TestUtils.H @@ -124,7 +124,8 @@ enum FAPI2_TEST_TARGET_ID { MY_MI, MY_DMI, MY_OMI, - MY_OMIC, + MY_OMIC0, + MY_OMIC2, MY_MCC, MY_OCMB, MY_MEM_PORT, @@ -157,7 +158,7 @@ if(l_chipList.size()) } \ else \ { \ - TS_FAIL("TEST_FUNCTION_NAME Fail: could not find any proc, skipping tests"); \ + TS_FAIL(#TEST_FUNCTION_NAME" Fail: could not find any proc, skipping tests"); \ numFails++; \ break; \ } \ @@ -173,7 +174,7 @@ for( uint64_t x = 0; x < NUM_TARGETS; x++ ) } \ else if(targeting_targets[x] == nullptr) \ { \ - FAPI_ERR("TEST_FUNCTION_NAME:: targeting_targets[%d] is null", x); \ + FAPI_ERR(#TEST_FUNCTION_NAME":: targeting_targets[%d] is null", x); \ generationSuccess = false; \ } \ } \ @@ -181,7 +182,7 @@ numTests++; if(!generationSuccess) \ { \ numFails++; \ - TS_FAIL("TEST_FUNCTION_NAME Fail : failed to correctly generate targets"); \ + TS_FAIL(#TEST_FUNCTION_NAME" Fail : failed to correctly generate targets"); \ } \ /* Common Targets */ \ fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> fapi2_procTarget(targeting_targets[MY_PROC]); \ @@ -205,12 +206,14 @@ fapi2::Target<fapi2::TARGET_TYPE_MC> fapi2_mcTarget(targeting_targets[MY fapi2::Target<fapi2::TARGET_TYPE_MI> fapi2_miTarget(targeting_targets[MY_MI]); /* Cumulus / Axone*/\ fapi2::Target<fapi2::TARGET_TYPE_DMI> fapi2_dmiTarget(targeting_targets[MY_DMI]); /* Cumulus */ \ fapi2::Target<fapi2::TARGET_TYPE_OMI> fapi2_omiTarget(targeting_targets[MY_OMI]); /* Axone */\ -fapi2::Target<fapi2::TARGET_TYPE_OMIC> fapi2_omicTarget(targeting_targets[MY_OMIC]); /* Axone */\ +fapi2::Target<fapi2::TARGET_TYPE_OMIC> fapi2_omic0Target(targeting_targets[MY_OMIC0]); /* Axone */\ +fapi2::Target<fapi2::TARGET_TYPE_OMIC> fapi2_omic2Target(targeting_targets[MY_OMIC2]); /* Axone */\ fapi2::Target<fapi2::TARGET_TYPE_MCC> fapi2_mccTarget(targeting_targets[MY_MCC]); /* Axone */\ fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP> fapi2_ocmbTarget(targeting_targets[MY_OCMB]); /* Axone */\ fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT> fapi2_memportTarget(targeting_targets[MY_MEM_PORT]); /* Axone */ + /** * @brief Number of children of given type that applicable pervasive has */ diff --git a/src/usr/fapi2/test/fapi2ToStringTest.H b/src/usr/fapi2/test/fapi2ToStringTest.H index b6824a06d..86affe586 100644 --- a/src/usr/fapi2/test/fapi2ToStringTest.H +++ b/src/usr/fapi2/test/fapi2ToStringTest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -78,6 +78,70 @@ void test_fapi2ToString() FAPI_INF("test_fapi2ToString Test Complete. %d/%d fails", numFails , numTests); } +void test_fapi2ToStringAll() +{ + FAPI_INF("test_fapi2ToStringAll>"); + int numTests = 0; + int numFails = 0; + + do { + TARGETING::Target* l_pMasterProcChip = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcChip); + TARGETING::ATTR_MODEL_type procModel = + l_pMasterProcChip->getAttr<TARGETING::ATTR_MODEL>(); + + GENERATE_TEST_TARGETS(test_fapi2GetChildren); + TARGETING::ATTR_FAPI_NAME_type fapiName = {0}; + +#define STRING_TEST(_targ) \ + fapi2::toString(_targ, fapiName, sizeof(fapiName));\ + FAPI_INF("_targ=%s",fapiName); + + STRING_TEST(fapi2_procTarget); + STRING_TEST(fapi2_eqTarget); + STRING_TEST(fapi2_exTarget); + STRING_TEST(fapi2_coreTarget); + STRING_TEST(fapi2_pecTarget); + STRING_TEST(fapi2_phbTarget); + STRING_TEST(fapi2_xbusTarget); + STRING_TEST(fapi2_obusTarget); + STRING_TEST(fapi2_oBrickTarget); + STRING_TEST(fapi2_ppeTarget); + STRING_TEST(fapi2_pervTarget); + STRING_TEST(fapi2_sbeTarget); + STRING_TEST(fapi2_cappTarget); + + if( procModel == TARGETING::MODEL_NIMBUS ) + { + STRING_TEST(fapi2_mcsTarget); + STRING_TEST(fapi2_mcaTarget); + STRING_TEST(fapi2_mcbistTarget); + } + + if( procModel == TARGETING::MODEL_CUMULUS ) + { + STRING_TEST(fapi2_mcTarget); + STRING_TEST(fapi2_miTarget); + STRING_TEST(fapi2_dmiTarget); + } + + if( procModel == TARGETING::MODEL_AXONE ) + { + STRING_TEST(fapi2_mcTarget); + STRING_TEST(fapi2_miTarget); + STRING_TEST(fapi2_omiTarget); + STRING_TEST(fapi2_omic0Target); + STRING_TEST(fapi2_omic2Target); + STRING_TEST(fapi2_mccTarget); + STRING_TEST(fapi2_ocmbTarget); + STRING_TEST(fapi2_memportTarget); + } + } while(0); + + FAPI_INF("test_fapi2ToStringAll:: Test Complete. %d/%d fails", numFails , numTests); + +} + }; |