summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2016-07-24 05:00:14 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-08-03 12:22:58 -0400
commitf9dcbda88e98d5679a34570092c9e57ee29c1c43 (patch)
treeda554c1d3f1abae86c224d42c1acdfec5bc380a6 /src
parent69d265f2d758cd8a988da1961bd113f8d115ca32 (diff)
downloadtalos-hostboot-f9dcbda88e98d5679a34570092c9e57ee29c1c43.tar.gz
talos-hostboot-f9dcbda88e98d5679a34570092c9e57ee29c1c43.zip
Make ATTR take generic target types
Change-Id: I5c996feaae8180d2093ef400d23b7548836aadae RTC:127348 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27416 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@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.H5
-rw-r--r--src/usr/fapi2/attribute_service.C32
2 files changed, 18 insertions, 19 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index 008e432de..2236e9583 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -210,12 +210,15 @@ ReturnCode platGetFusedCoreMode(uint8_t & o_isFused);
///
///
/// @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 v 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 platGetPoundVBucketData(const Target<TARGET_TYPE_EQ>& i_fapiTarget,
+ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
uint8_t * o_poundVData);
// -----------------------------------------------------------------------------
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C
index 995ed9b02..9896db0f3 100644
--- a/src/usr/fapi2/attribute_service.C
+++ b/src/usr/fapi2/attribute_service.C
@@ -441,33 +441,29 @@ ReturnCode platGetFusedCoreMode(uint8_t & o_isFused)
// ******************************************************************************
// fapi2::platAttrSvc::platGetPoundVBucketData function
//******************************************************************************
-ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_EQ>& i_fapiTarget,
+ReturnCode platGetPoundVBucketData(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
uint8_t * o_poundVData)
{
fapi2::ReturnCode rc;
- if(i_fapiTarget.getType() != TARGET_TYPE_EQ)
+
+ // 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)
{
- /*@
- * @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);
+ FAPI_ERR("getTargetingAttr: Error from getTargetingTarget");
rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
}
else
{
- rc = p9_pm_get_poundv_bucket_attr(i_fapiTarget,o_poundVData);
+ fapi2::Target<TARGET_TYPE_EQ> l_fapiTarget( l_pTarget);
+ rc = p9_pm_get_poundv_bucket_attr(l_fapiTarget,o_poundVData);
}
+
return rc;
}
OpenPOWER on IntegriCloud