summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-02-16 16:25:39 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-02-22 11:56:00 -0500
commit171c966b12edeac7c55ebad325232573145f77fa (patch)
treea01e22f3a4583b35402724cf5a8d655f2f6e40f9 /src
parent441ed258ed8dedb443c1cf12a0b3e20bcf995eeb (diff)
downloadtalos-hostboot-171c966b12edeac7c55ebad325232573145f77fa.tar.gz
talos-hostboot-171c966b12edeac7c55ebad325232573145f77fa.zip
Initial Support for VDM data from #W keyword of VPD in Hostboot
Make MVPD additions and updates to add support for #W keyword. Change-Id: Id124bc5bdb5c6336b042ff7f41250626643a608e RTC:162011 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36637 Tested-by: Jenkins Server <pfd-jenkins+hostboot@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> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/fapi2/attribute_service.H27
-rw-r--r--src/include/usr/vpd/mvpdenums.H1
-rw-r--r--src/usr/fapi2/attribute_service.C35
-rwxr-xr-xsrc/usr/fapi2/fapi2.mk3
-rwxr-xr-xsrc/usr/fapi2/plat_mvpd_access.C1
-rw-r--r--src/usr/fapi2/test/fapi2MvpdTestCxx.H102
-rw-r--r--src/usr/vpd/mvpd.H1
-rwxr-xr-xsrc/usr/vpd/test/mvpdtest.H3
8 files changed, 169 insertions, 4 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index fb82f8a90..d02e29df7 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -219,6 +219,23 @@ ReturnCode platGetFusedCoreMode(uint8_t & o_isFused);
ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
uint8_t * o_poundVData);
+///
+/// @brief This function is called by the FAPI_ATTR_GET macro when getting
+/// ATTR_POUNDW_BUCKET_DATA. It should not be called directly
+///
+///
+/// @param[in] i_fapiTarget FAPI2 Target reference
+/// Don't need to check the type here, get macro
+/// does it for us, thus use the all type to
+/// allow streamlined dump of ATTR
+/// @param[out] o_pos Output pound w bucket data
+/// @return ReturnCode Always FAPI2_RC_SUCCESS, this cannot fail
+/// if a toplevel target cannot be found then
+/// an assert triggers in the platform call
+///
+ReturnCode platGetPoundWBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ uint8_t * o_poundWData);
+
// -----------------------------------------------------------------------------
// End TODO: End to be supported functions
// -----------------------------------------------------------------------------
@@ -292,4 +309,12 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
? fapi2::ReturnCode() : \
fapi2::platAttrSvc::platGetPoundVBucketData(TARGET,VAL)
+//------------------------------------------------------------------------------
+// MACRO to route ATTR_POUNDW_BUCKET_DATA access to the correct HB function
+//------------------------------------------------------------------------------
+#define ATTR_POUNDW_BUCKET_DATA_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::platGetPoundWBucketData(TARGET,VAL)
+
#endif // ATTRIBUTESERVICE_H_
diff --git a/src/include/usr/vpd/mvpdenums.H b/src/include/usr/vpd/mvpdenums.H
index fb0a1a00f..4b8084707 100644
--- a/src/include/usr/vpd/mvpdenums.H
+++ b/src/include/usr/vpd/mvpdenums.H
@@ -123,6 +123,7 @@ enum mvpdKeyword
L6 = 0x28,
L7 = 0x29,
L8 = 0x2A,
+ pdW = 0x2B,
// Last Keyword
MVPD_LAST_KEYWORD,
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C
index ef588a5ef..c622683d1 100644
--- a/src/usr/fapi2/attribute_service.C
+++ b/src/usr/fapi2/attribute_service.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,6 +53,8 @@
#include <plat_attr_override_sync.H>
#include <vpd/spdenums.H>
#include <p9_pm_get_poundv_bucket_attr.H>
+// TODO RTC:162011 after new .H file is mirrored
+//#include <p9_pm_get_poundw_bucket_attr.H>
#include <errl/errlmanager.H>
#include <targeting/common/targetservice.H>
@@ -441,7 +443,7 @@ ReturnCode platGetFusedCoreMode(uint8_t & o_isFused)
return fapi2::ReturnCode();
}
-// ******************************************************************************
+//******************************************************************************
// fapi2::platAttrSvc::platGetPoundVBucketData function
//******************************************************************************
ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
@@ -470,6 +472,35 @@ ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
return rc;
}
+//******************************************************************************
+// fapi2::platAttrSvc::platGetPoundWBucketData function
+//******************************************************************************
+ReturnCode platGetPoundWBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ uint8_t * o_poundWData)
+{
+ fapi2::ReturnCode rc;
+
+ // Don't need to check the type here, the FAPI_ATTR_GET macro clause
+ // "fapi2::Target<ID##_TargetType>(TARGET)" does it for us. However,
+ // to enable a streamlined dump of the attributes, all plat code must use
+ // the generic TARGET_TYPE_ALL -- so convert back to the correct type
+ // manually
+ TARGETING::Target * l_pTarget = NULL;
+ errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget);
+ if (l_errl)
+ {
+ FAPI_ERR("getTargetingAttr: Error from getTargetingTarget");
+ rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ }
+ else
+ {
+ fapi2::Target<TARGET_TYPE_EQ> l_fapiTarget( l_pTarget);
+// TODO RTC:162011 after new .C file is mirrored
+// rc = p9_pm_get_poundw_bucket_attr(l_fapiTarget,o_poundWData);
+ }
+
+ return rc;
+}
diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk
index f32e4646a..679214c98 100755
--- a/src/usr/fapi2/fapi2.mk
+++ b/src/usr/fapi2/fapi2.mk
@@ -126,6 +126,9 @@ 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_attr.mk
+# TODO RTC:162011 after new .mk files are mirrored
+#include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundw_bucket.mk
+#include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundw_bucket_attr.mk
VPATH += ${HWP_PATH}/hwp/accessors
VPATH += ${ROOTPATH}/src/import/hwpf/fapi2/src/
diff --git a/src/usr/fapi2/plat_mvpd_access.C b/src/usr/fapi2/plat_mvpd_access.C
index 8200c1b22..d927f7f61 100755
--- a/src/usr/fapi2/plat_mvpd_access.C
+++ b/src/usr/fapi2/plat_mvpd_access.C
@@ -245,6 +245,7 @@ fapi2::ReturnCode MvpdKeywordXlate(const fapi2::MvpdKeyword i_fapiKeyword,
{MVPD::L6, MVPD_KEYWORD_L6},
{MVPD::L7, MVPD_KEYWORD_L7},
{MVPD::L8, MVPD_KEYWORD_L8},
+ {MVPD::pdW, MVPD_KEYWORD_PDW},
/*Keywords available in HB but not in FAPI enum*/
//{MVPD::PM, MVPD_KEYWORD_PM},
diff --git a/src/usr/fapi2/test/fapi2MvpdTestCxx.H b/src/usr/fapi2/test/fapi2MvpdTestCxx.H
index 077bc7c7a..45f0cc202 100644
--- a/src/usr/fapi2/test/fapi2MvpdTestCxx.H
+++ b/src/usr/fapi2/test/fapi2MvpdTestCxx.H
@@ -42,6 +42,8 @@
#include <fapi2.H>
#include <devicefw/userif.H>
#include <p9_pm_get_poundv_bucket.H>
+// TODO RTC:162011 after new .H file is mirrored
+//#include <p9_pm_get_poundw_bucket.H>
#include <utilFilter.H>
#include <vpd/mvpdenums.H>
@@ -404,6 +406,106 @@ public:
FAPI_INF("MvpdGetPoundVBucket:: Test Complete. %d/%d fails", numFails , numTests);
FAPI_INF("MvpdGetPoundVBucket Test exit... ");
}
+
+ void testMvpdGetPoundWBucket(void)
+ {
+ int numTests = 0;
+ int numFails = 0;
+ fapi2::ReturnCode l_rc;
+ FAPI_INF("MvpdGetPoundWBucket 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);
+// TODO RTC:162011 after new .H file is mirrored
+// fapi2::vdmData_t vdmData;
+
+ for(const auto & eqChiplet : l_chipletList )
+ {
+ fapi2::Target<TARGET_TYPE_EQ> l_fapi_eq_target(eqChiplet);
+#if 0 // TODO RTC:162011 after new files are mirrored
+ numTests++;
+ l_rc = p9_pm_get_poundw_bucket(l_fapi_eq_target, vdmData);
+ if(l_rc)
+ {
+ numFails++;
+ TS_FAIL("Error: Error occurred while trying to read voltage "
+ "data from mvpd");
+ continue;
+ }
+
+ //Set up a char array to hold the bucket data from an attr read
+ fapi2::ATTR_POUNDW_BUCKET_DATA_Type l_bucketAttr;
+
+ //Perform an ATTR_GET for POUNDW_BUCKET data on the EQ target
+ FAPI_ATTR_GET(fapi2::ATTR_POUNDW_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(vdmData.bucketId != 2)
+ {
+ numFails++;
+ TS_FAIL("Error:p9_pm_get_poundw_bucket with EQ with HUID = "
+ "0x%X should have returned bucket ID 2, not %d",
+ l_huid,
+ vdmData.bucketId);
+ }
+
+ numTests++;
+ if(*l_bucketAttr != 2)
+ {
+ numFails++;
+ TS_FAIL("Error:FAPI_ATTR_GET(fapi2::ATTR_POUNDW_BUCKET_DATA "
+ "EQ with HUID = 0x%X should have bucket ID 1, not %d",
+ l_huid,
+ vdmData.bucketId);
+ }
+
+ continue;
+ }
+
+ numTests++;
+ if(vdmData.bucketId != 1)
+ {
+ numFails++;
+ TS_FAIL("Error:p9_pm_get_poundw_bucket with EQ with HUID = "
+ "0x%X should have returned bucket ID 1, not %d",
+ l_huid,
+ vdmData.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,
+ vdmData.bucketId);
+ }
+
+ FAPI_INF("Bucket for HUID: 0x%X is = %d", l_huid, vdmData.bucketId);
+#endif
+ }
+
+ FAPI_INF("MvpdGetPoundWBucket:: Test Complete. %d/%d fails",
+ numFails,
+ numTests);
+ FAPI_INF("MvpdGetPoundWBucket Test exit... ");
+ } //testMvpdGetPoundWBucket
};
#endif
diff --git a/src/usr/vpd/mvpd.H b/src/usr/vpd/mvpd.H
index 610de3b6c..bd8b1160e 100644
--- a/src/usr/vpd/mvpd.H
+++ b/src/usr/vpd/mvpd.H
@@ -134,6 +134,7 @@ namespace MVPD
{ L6, "L6" },
{ L7, "L7" },
{ L8, "L8" },
+ { pdW, "#W" },
// -------------------------------------------------------------------
// DO NOT USE!! This is for test purposes ONLY!
diff --git a/src/usr/vpd/test/mvpdtest.H b/src/usr/vpd/test/mvpdtest.H
index 04fac6476..36dffe093 100755
--- a/src/usr/vpd/test/mvpdtest.H
+++ b/src/usr/vpd/test/mvpdtest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2016 */
+/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -68,6 +68,7 @@ mvpdTestData mvpdData[] =
{ MVPD::CRP0, MVPD::ED },
{ MVPD::CRP0, MVPD::TE },
{ MVPD::CRP0, MVPD::DD },
+ { MVPD::CRP0, MVPD::pdW },
{ MVPD::CP00, MVPD::VD },
{ MVPD::CP00, MVPD::PG },
// { MVPD::CP00, MVPD::PK }, // no PK in test data
OpenPOWER on IntegriCloud