summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2016-09-02 11:49:30 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-09-20 16:48:23 -0400
commit2428ea76bd997fed3d9b5438251b29254455c2e3 (patch)
treebfe4acb8247dc4c045aacda4fe935b87c8ff4453
parente56f5294541eb7b241f3ad85c69443b96e344b83 (diff)
downloadtalos-hostboot-2428ea76bd997fed3d9b5438251b29254455c2e3.tar.gz
talos-hostboot-2428ea76bd997fed3d9b5438251b29254455c2e3.zip
PRD: add getConnected wrappers for ExtensibleChip
Change-Id: I9bcfec53ef239fde8e2633d204cd3327cc3555f9 RTC: 160348 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29190 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29963 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.C47
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.H25
2 files changed, 71 insertions, 1 deletions
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.C b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
index 3bd478e72..64bf3f4ab 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.C
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
@@ -34,10 +34,15 @@
#include <prdfTargetServices.H>
+// Framework includes
+#include <iipSystem.h>
#include <prdfAssert.h>
-#include <prdfGlobal.H>
#include <prdfErrlUtil.H>
+#include <prdfExtensibleChip.H>
+#include <prdfGlobal.H>
#include <prdfTrace.H>
+
+// External includes
#include <algorithm>
//#include <fapi.H> TODO RTC 136126
#include <targeting/common/targetservice.H>
@@ -833,6 +838,46 @@ TargetHandle_t getConnectedChild( TargetHandle_t i_target, TYPE i_connType,
//------------------------------------------------------------------------------
+ExtensibleChip * getConnectedParent( ExtensibleChip * i_child,
+ TYPE i_parentType )
+{
+ PRDF_ASSERT( nullptr != i_child );
+
+ ExtensibleChip * o_parent = nullptr;
+
+ TargetHandle_t trgt = getConnectedParent( i_child->getTrgt(),
+ i_parentType );
+ if ( nullptr != trgt )
+ {
+ o_parent = (ExtensibleChip *)systemPtr->GetChip( trgt );
+ }
+
+ return o_parent;
+}
+
+//------------------------------------------------------------------------------
+
+ExtensibleChip * getConnectedChild( ExtensibleChip * i_parent,
+ TARGETING::TYPE i_childType,
+ uint32_t i_childPos )
+{
+ PRDF_ASSERT( nullptr != i_parent );
+
+ ExtensibleChip * o_child = nullptr;
+
+ TargetHandle_t trgt = getConnectedChild( i_parent->getTrgt(),
+ i_childType,
+ i_childPos );
+ if ( nullptr != trgt )
+ {
+ o_child = (ExtensibleChip *)systemPtr->GetChip( trgt );
+ }
+
+ return o_child;
+}
+
+//------------------------------------------------------------------------------
+
TargetHandle_t getConnectedPeerTarget( TargetHandle_t i_target )
{
#define PRDF_FUNC "[PlatServices::getConnectedPeerTarget] "
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.H b/src/usr/diag/prdf/common/plat/prdfTargetServices.H
index 74ddd773f..c27f73127 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.H
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.H
@@ -47,6 +47,7 @@
namespace PRDF
{
+class ExtensibleChip;
//class CenRank; TODO: RTC 136126
namespace PlatServices
@@ -197,6 +198,30 @@ TARGETING::TargetHandle_t getConnectedChild( TARGETING::TargetHandle_t i_target,
uint32_t i_position );
/**
+ * @brief ExtensibleChip wrapper for targeting version of getConnectedParent().
+ * @param i_child The child ExtensibleChip.
+ * @param i_parentType The targeting type of the parent.
+ * @note If the child is the same type as the parent type, the child is
+ * returned.
+ * @return The connected parent, nullptr if not found.
+ */
+ExtensibleChip * getConnectedParent( ExtensibleChip * i_child,
+ TARGETING::TYPE i_parentType );
+
+/**
+ * @brief ExtensibleChip wrapper for targeting version of getConnectedChild().
+ * @param i_parent The parent ExtensibleChip.
+ * @param i_childType The targeting type of the child.
+ * @param i_childPos The position of the child relative to the parent.
+ * @note If the parent is the same type as the child type, the parent is
+ * returned.
+ * @return The connected child, nullptr if not found.
+ */
+ExtensibleChip * getConnectedChild( ExtensibleChip * i_parent,
+ TARGETING::TYPE i_childType,
+ uint32_t i_childPos );
+
+/**
* @brief Returns the target of a PROC that is connected via the given
* target's XBUS or ABUS.
* @param i_procTarget Target of TYPE_PROC.
OpenPOWER on IntegriCloud