diff options
| author | crgeddes <crgeddes@us.ibm.com> | 2016-04-29 17:06:27 -0500 |
|---|---|---|
| committer | William G. Hoffa <wghoffa@us.ibm.com> | 2016-05-05 15:20:57 -0400 |
| commit | c3d3e344210055c1070c4af070a7877d7ec77bd4 (patch) | |
| tree | 37bb825e4ddbd2195ee172a920e7bfc9c1fc4450 /src/usr/fapi2/test | |
| parent | 9ffe7c2c5d8555b5d35d968dbff3e4f07bb5fc8f (diff) | |
| download | talos-hostboot-c3d3e344210055c1070c4af070a7877d7ec77bd4.tar.gz talos-hostboot-c3d3e344210055c1070c4af070a7877d7ec77bd4.zip | |
Implement GET_POUNDV_BUCKET_DATA_MACRO and backing function
The fapi2 PM attribute poundv_bucket_data is backed in HB by a function
that calls FAPI2 code that reads MVPD data off of pnor in order to find
the proper #V bucket data. This commit sets up that macro and function
as well as adds some testing to make sure it is working properly
Change-Id: Ie506230c1270bdff43c3d8a8ec95ebb75010cf53
RTC:127421
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23901
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/test')
| -rw-r--r-- | src/usr/fapi2/test/fapi2MvpdTestCxx.H | 89 | ||||
| -rw-r--r-- | src/usr/fapi2/test/makefile | 6 |
2 files changed, 93 insertions, 2 deletions
diff --git a/src/usr/fapi2/test/fapi2MvpdTestCxx.H b/src/usr/fapi2/test/fapi2MvpdTestCxx.H index c961434fe..8adeb0d7e 100644 --- a/src/usr/fapi2/test/fapi2MvpdTestCxx.H +++ b/src/usr/fapi2/test/fapi2MvpdTestCxx.H @@ -41,6 +41,8 @@ #include "../plat_mvpd_access.C" #include <fapi2.H> #include <devicefw/userif.H> +#include <p9_pm_get_poundv_bucket.H> +#include <utilFilter.H> #include <vpd/mvpdenums.H> using namespace TARGETING; @@ -332,6 +334,93 @@ class MVPDTest: public CxxTest::TestSuite FAPI_INF("testMvpdValidate: EXIT !!"); } //testMvpdValidate + + void testMvpdGetPoundVBucket(void) + { + int numTests = 0; + int numFails = 0; + fapi2::ReturnCode l_rc; + FAPI_INF("MvpdGetPoundVBucket Test entry... "); + + // Create a vector of TARGETING::Target pointers + TARGETING::TargetHandleList l_chipletList; + + // Get a list of all of the EQ chips + TARGETING::getChipletResources(l_chipletList, + TARGETING::TYPE_EQ, + TARGETING::UTIL_FILTER_PRESENT); + fapi2::voltageBucketData_t voltageData; + + for(const auto & eqChiplet : l_chipletList ) + { + fapi2::Target<TARGET_TYPE_EQ> + l_fapi_eq_target(eqChiplet); + l_rc = p9_pm_get_poundv_bucket(l_fapi_eq_target, voltageData); + + + //Set up a char array to hold the bucket data from an attr read + fapi2::ATTR_POUNDV_BUCKET_DATA_Type l_bucketAttr; + + //Perform an ATTR_GET for POUNDV_BUCKET data on the EQ target + FAPI_ATTR_GET(fapi2::ATTR_POUNDV_BUCKET_DATA, + l_fapi_eq_target, + l_bucketAttr); + + uint32_t l_huid = TARGETING::get_huid(l_fapi_eq_target); + uint32_t l_pos = eqChiplet->getAttr<TARGETING::ATTR_CHIP_UNIT>(); + + //PROC0EQ1 has an override set in nimbus's standalone xml, this branch checks it + if(l_pos == 1) + { + + numTests++; + if(voltageData.bucketId != 2) + { + numFails++; + TS_FAIL("Error:p9_pm_get_poundv_bucket with EQ with HUID = 0x%X should have returned bucket ID 2, not %d",l_huid, voltageData.bucketId); + } + + numTests++; + if(*l_bucketAttr != 2) + { + numFails++; + TS_FAIL("Error:FAPI_ATTR_GET(fapi2::ATTR_POUNDV_BUCKET_DATA EQ with HUID = 0x%X should have bucket ID 1, not %d",l_huid, voltageData.bucketId); + } + + if(l_rc) + { + numFails++; + TS_FAIL("Error: Error occured while trying to read voltage data from mvpd"); + continue; + } + continue; + } + numTests++; + if(voltageData.bucketId != 1) + { + numFails++; + TS_FAIL("Error:p9_pm_get_poundv_bucket with EQ with HUID = 0x%X should have returned bucket ID 1, not %d",l_huid, voltageData.bucketId); + continue; + } + numTests++; + if(*l_bucketAttr != 1) + { + numFails++; + TS_FAIL("Error:FAPI_ATTR_GET(fapi2::ATTR_POUNDV_BUCKET_DATA EQ with HUID = 0x%X should have bucket ID 1, not %d",l_huid, voltageData.bucketId); + } + + if(l_rc) + { + numFails++; + TS_FAIL("Error: Error occured while trying to read voltage data from mvpd"); + continue; + } + FAPI_INF("Bucket for HUID: 0x%X is = %d", l_huid, voltageData.bucketId); + } + + FAPI_INF("MvpdGetPoundVBucket:: Test Complete. %d/%d fails", numFails , numTests); + FAPI_INF("MvpdGetPoundVBucket Test exit... "); + } }; #endif diff --git a/src/usr/fapi2/test/makefile b/src/usr/fapi2/test/makefile index 58f0cf231..472c748e4 100644 --- a/src/usr/fapi2/test/makefile +++ b/src/usr/fapi2/test/makefile @@ -34,7 +34,8 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/ EXTRAINCDIR += ${ROOTPATH}/src/usr/fapi2/test/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/ - +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/ +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/targeting/common/ # Procedures @@ -42,6 +43,7 @@ OBJS += p9_sample_procedure.o OBJS += p9_hwtests.o OBJS += fapi2TestUtils.o + TESTS += fapi2HwpTest.H TESTS += fapi2HwAccessTest.H TESTS += fapi2GetParentTest.H @@ -53,5 +55,5 @@ TESTS += fapi2MvpdTestCxx.H include ${ROOTPATH}/config.mk -vpath %.C ${GENDIR} +vpath %.C ${GENDIR} ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/ |

