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 | |
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')
-rw-r--r-- | src/usr/fapi2/attribute_service.C | 38 | ||||
-rwxr-xr-x | src/usr/fapi2/makefile | 6 | ||||
-rw-r--r-- | src/usr/fapi2/test/fapi2MvpdTestCxx.H | 89 | ||||
-rw-r--r-- | src/usr/fapi2/test/makefile | 6 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 4 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml | 2 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/target_types.xml | 3 | ||||
-rw-r--r-- | src/usr/targeting/xmltohb/makefile | 42 |
8 files changed, 161 insertions, 29 deletions
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C index a59a881c9..c45caafe2 100644 --- a/src/usr/fapi2/attribute_service.C +++ b/src/usr/fapi2/attribute_service.C @@ -52,7 +52,7 @@ #include <devicefw/driverif.H> #include <plat_attr_override_sync.H> #include <vpd/spdenums.H> - +#include <p9_pm_get_poundv_bucket.H> #include <errl/errlmanager.H> #include <targeting/common/targetservice.H> @@ -391,6 +391,42 @@ ReturnCode platGetFusedCoreMode(uint8_t & o_isFused) return fapi2::ReturnCode(); } +//****************************************************************************** +// fapi2::platAttrSvc::platGetPoundVBucketData function +//****************************************************************************** +ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_EQ>& i_fapiTarget, + uint8_t * o_poundVData) +{ + fapi2::ReturnCode rc; + if(i_fapiTarget.getType() != TARGET_TYPE_EQ) + { + /*@ + * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid fapi2::MOD_FAPI2_MVPD_ACCESS + * @reasoncode RC_INCORRECT_TARGET + * @userdata1 Actual Target Type + * @userdata2 Expected Target Type + * @devdesc Attempted to read attribute from wrong target type + * @custdesc Firmware Error + */ + errlHndl_t l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + MOD_FAPI2_MVPD_ACCESS, + RC_INCORRECT_TARGET, + i_fapiTarget.getType(), + TARGET_TYPE_EQ, + true); + rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); + } + else + { + rc = p9_pm_get_poundv_bucket_attr(i_fapiTarget,o_poundVData); + } + return rc; +} + + + + } // End platAttrSvc namespace } // End fapi2 namespace diff --git a/src/usr/fapi2/makefile b/src/usr/fapi2/makefile index 391f67c64..ef4ee6d90 100755 --- a/src/usr/fapi2/makefile +++ b/src/usr/fapi2/makefile @@ -34,6 +34,8 @@ GENPATH?=$(ROOTPATH)/obj/genfiles MODULE = fapi2 SUBDIRS += test.d +EXTRAINCDIR += $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/ + include ${ROOTPATH}/src/build/mkrules/verbose.rules.mk define __CLEAN_TARGET CLEAN_TARGETS += $(1) @@ -41,11 +43,13 @@ endef include fapi2.mk +include ${ROOTPATH}/procedure.rules.mk include ${ROOTPATH}/src/import/tools/build/common.dir/script.rules.mk include ${ROOTPATH}/src/import/hwpf/fapi2/tools/parseErrorInfo.mk include ${ROOTPATH}/src/import/hwpf/fapi2/tools/parseAttributeInfo.mk include ${ROOTPATH}/src/import/hwpf/fapi2/tools/createIfAttrService.mk +include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucket.mk include ${ROOTPATH}/config.mk -vpath %.C ${GENDIR} +vpath %.C ${GENDIR} $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/ 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/ diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 7196d1fdd..02f43c6c6 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -21588,9 +21588,9 @@ DEPRECATED!!!! bucket to use to set power management data. </description> <simpleType> - <uint64_t> + <uint8_t> <default>0</default> - </uint64_t> + </uint8_t> </simpleType> <!--TODO RTC:144077 This should be volatile-zeroed but cannot test without a way to do attribute overrides so we have to edit the system xml diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml index 0fbf323a4..654e16d43 100644 --- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml @@ -332,7 +332,7 @@ then we can get rid of these poundv attributes for this EQ--> <attribute> <id>POUNDV_BUCKET_NUM</id> - <default>1</default> + <default>2</default> </attribute> <attribute> <id>POUNDV_BUCKET_NUM_OVERRIDE</id> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 050a7e7e4..dcce3bc65 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -584,7 +584,8 @@ <attribute><id>PROC_PCIE_HOTPLUG_NUM_ENABLE_ACTIONS</id></attribute> <attribute><id>PROC_PCIE_HOTPLUG_DISABLE_ACTIONS</id></attribute> <attribute><id>PROC_PCIE_HOTPLUG_NUM_DISABLE_ACTIONS</id></attribute> - + <attribute><id>POUNDV_BUCKET_NUM</id><default>0</default></attribute> + <attribute><id>POUNDV_BUCKET_NUM_OVERRIDE</id><default>0</default></attribute> <attribute><id>UNIT_TEST_MCA_MEMORY_SIZES</id></attribute> </targetType> diff --git a/src/usr/targeting/xmltohb/makefile b/src/usr/targeting/xmltohb/makefile index 773551986..7be5a6d97 100644 --- a/src/usr/targeting/xmltohb/makefile +++ b/src/usr/targeting/xmltohb/makefile @@ -99,26 +99,26 @@ VMM_CONSTS_FILE = \ GENFILES = ${XMLTOHB_TARGETS} #debug : -# @echo COMMON_TARGETING_PATH_PREFIX = ${COMMON_TARGETING_PATH_PREFIX} -# @echo COMMON_TARGETING_REL_PATH = ${COMMON_TARGETING_REL_PATH} -# @echo COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_MAKEFILE} -# @echo XMLTOHB_HEADER_TARGETS = ${XMLTOHB_HEADER_TARGETS} -# @echo XMLTOHB_SOURCE_TARGETS = ${XMLTOHB_SOURCE_TARGETS} -# @echo XMLTOHB_SYSTEM_BINARIES = ${XMLTOHB_SYSTEM_BINARIES} -# @echo XMLTOHB_TARGETS = ${XMLTOHB_TARGETS} -# @echo XMLTOHB_GENERIC_SOURCES = ${XMLTOHB_GENERIC_SOURCES} -# @echo FAPI_ATTR_SOURCE_DIR = ${FAPI_ATTR_SOURCE_DIR} -# @echo FAPI_ATTR_SOURCES = ${FAPI_ATTR_SOURCES} -# @echo XMLTOHB_FAPIATTR_SOURCES = ${XMLTOHB_FAPIATTR_SOURCES} -# @echo HB_TEMP_DFLT_SOURCES = ${HB_TEMP_DFLT_SOURCES} -# @echo XMLTOHB_COMMON_ATTRIBUTE_SOURCES = ${XMLTOHB_COMMON_ATTRIBUTE_SOURCES} -# @echo XMLTOHB_COMMON_TARGET_SOURCES = ${XMLTOHB_COMMON_TARGET_SOURCES} -# @echo TEMP_DEFAULT_SOURCES = ${TEMP_DEFAULT_SOURCES} -# @echo XMLTOHB_HB_ATTRIBUTE_SOURCES = ${XMLTOHB_HB_ATTRIBUTE_SOURCES} -# @echo XMLTOHB_HB_TARGET_SOURCES = ${XMLTOHB_HB_TARGET_SOURCES} -# @echo XMLTOHB_MERGED_COMMON_TARGET_SOURCES = ${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} -# @echo TEMP_GENERIC_XML = ${TEMP_GENERIC_XML} -# @echo VPATH = ${VPATH} + @echo COMMON_TARGETING_PATH_PREFIX = ${COMMON_TARGETING_PATH_PREFIX} + @echo COMMON_TARGETING_REL_PATH = ${COMMON_TARGETING_REL_PATH} + @echo COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_MAKEFILE} + @echo XMLTOHB_HEADER_TARGETS = ${XMLTOHB_HEADER_TARGETS} + @echo XMLTOHB_SOURCE_TARGETS = ${XMLTOHB_SOURCE_TARGETS} + @echo XMLTOHB_SYSTEM_BINARIES = ${XMLTOHB_SYSTEM_BINARIES} + @echo XMLTOHB_TARGETS = ${XMLTOHB_TARGETS} + @echo XMLTOHB_GENERIC_SOURCES = ${XMLTOHB_GENERIC_SOURCES} + @echo FAPI_ATTR_SOURCE_DIR = ${FAPI_ATTR_SOURCE_DIR} + @echo FAPI_ATTR_SOURCES = ${FAPI_ATTR_SOURCES} + @echo XMLTOHB_FAPIATTR_SOURCES = ${XMLTOHB_FAPIATTR_SOURCES} + @echo HB_TEMP_DFLT_SOURCES = ${HB_TEMP_DFLT_SOURCES} + @echo XMLTOHB_COMMON_ATTRIBUTE_SOURCES = ${XMLTOHB_COMMON_ATTRIBUTE_SOURCES} + @echo XMLTOHB_COMMON_TARGET_SOURCES = ${XMLTOHB_COMMON_TARGET_SOURCES} + @echo TEMP_DEFAULT_SOURCES = ${TEMP_DEFAULT_SOURCES} + @echo XMLTOHB_HB_ATTRIBUTE_SOURCES = ${XMLTOHB_HB_ATTRIBUTE_SOURCES} + @echo XMLTOHB_HB_TARGET_SOURCES = ${XMLTOHB_HB_TARGET_SOURCES} + @echo XMLTOHB_MERGED_COMMON_TARGET_SOURCES = ${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} + @echo TEMP_GENERIC_XML = ${TEMP_GENERIC_XML} + @echo VPATH = ${VPATH} EXTRA_PARTS = $(addprefix $(IMGDIR)/, $(XMLTOHB_SYSTEM_BINARIES)) @@ -179,7 +179,7 @@ ${GENDIR}/${XMLTOHB_GENERIC_XML}: \ ./${XMLTOHB_TEMPS_MERGE_SCRIPT} \ --generic=${GENDIR}/${TEMP_GENERIC_XML} \ --fapi=${GENDIR}/${XMLTOHB_FAPI_XML} \ - --fapi_inc=${GENDIR}/${HB_PLAT_ATTR_SRVC_H} \ + --fapi_inc=${ROOTPATH}/src/include/usr/fapi2/attribute_service.H \ --fw_dflts=${HB_TEMP_DFLT_SOURCES} \ --defaults=${COMMON_TARGETING_REL_PATH}/${TEMP_DEFAULT_SOURCES} > $@ |