summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.C52
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.H21
-rw-r--r--src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C2
3 files changed, 23 insertions, 52 deletions
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.C b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
index 81fe0e8f9..3bd478e72 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.C
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
@@ -333,31 +333,26 @@ TARGETING::CLASS getTargetClass( TARGETING::TargetHandle_t i_target )
//------------------------------------------------------------------------------
-uint8_t getChipLevel( TARGETING::TargetHandle_t i_target )
+TARGETING::MODEL getChipModel( TARGETING::TargetHandle_t i_trgt )
{
- uint8_t o_chipLvl = 0;
+ PRDF_ASSERT( NULL != i_trgt );
- do
- {
- if ( NULL == i_target ) break;
+ TargetHandle_t parent = getParentChip( i_trgt );
+ PRDF_ASSERT( NULL != parent );
- TargetHandle_t l_parentTarget = getParentChip( i_target );
- if ( NULL == l_parentTarget ) break;
+ return parent->getAttr<ATTR_MODEL>();
+}
- if ( !l_parentTarget->tryGetAttr<ATTR_EC>(o_chipLvl) )
- {
- PRDF_ERR( "[getChipLevel] Failed to get ATTR_EC" );
- o_chipLvl = 0; // Just in case
- }
+//------------------------------------------------------------------------------
- } while (0);
+uint8_t getChipLevel( TARGETING::TargetHandle_t i_trgt )
+{
+ PRDF_ASSERT( NULL != i_trgt );
- if ( 0 == o_chipLvl )
- {
- PRDF_ERR( "[getChipLevel] Failed: i_target=0x%08x", getHuid(i_target) );
- }
+ TargetHandle_t parent = getParentChip( i_trgt );
+ PRDF_ASSERT( NULL != parent );
- return o_chipLvl;
+ return parent->getAttr<ATTR_EC>();
}
//------------------------------------------------------------------------------
@@ -1097,27 +1092,6 @@ uint32_t getTargetPosition( TARGETING::TargetHandle_t i_target )
//------------------------------------------------------------------------------
-TARGETING::MODEL getProcModel( TARGETING::TargetHandle_t i_proc )
-{
- #define PRDF_FUNC "[PlatServices::getProcModel] "
-
- MODEL l_model = MODEL_NA;
- if( TYPE_PROC == getTargetType( i_proc ) )
- {
- l_model = i_proc->getAttr<ATTR_MODEL>();
- }
- else
- {
- PRDF_ERR( PRDF_FUNC "Invalid Target Huid = 0x%08x", getHuid( i_proc ) );
- }
-
- return l_model;
-
- #undef PRDF_FUNC
-}
-
-//------------------------------------------------------------------------------
-
uint32_t getPhbConfig( TARGETING::TargetHandle_t i_proc )
{
#define PRDF_FUNC "[PlatServices::getPhbConfig] "
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.H b/src/usr/diag/prdf/common/plat/prdfTargetServices.H
index d208c39ca..74ddd773f 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.H
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.H
@@ -136,11 +136,16 @@ TARGETING::TYPE getTargetType( TARGETING::TargetHandle_t i_target );
TARGETING::CLASS getTargetClass( TARGETING::TargetHandle_t i_target );
/**
- * @brief Get the chip level (DD level) of this target.
- * @param i_target Any chip or unit target.
- * @return The chip level or 0 function failed.
+ * @param i_trgt A chip target or any unit target within the chip.
+ * @return The model of a chip.
+ */
+TARGETING::MODEL getChipModel( TARGETING::TargetHandle_t i_trgt );
+
+/**
+ * @param i_trgt A chip target or any unit target within the chip.
+ * @return The level (EC level) of a chip.
*/
-uint8_t getChipLevel( TARGETING::TargetHandle_t i_target );
+uint8_t getChipLevel( TARGETING::TargetHandle_t i_trgt );
/**
* @brief set hw changed state for a target
@@ -260,14 +265,6 @@ TARGETING::TargetHandle_t getMasterProc();
uint32_t getTargetPosition( TARGETING::TargetHandle_t i_target );
/**
- * @brief Returns Model associated with Proc.
- * Model expected is either MURANO or VENICE or NAPLES.
- * @param i_proc a proc target
- * @return proc model if target is valid else MODEL_NA
- */
-TARGETING::MODEL getProcModel( TARGETING::TargetHandle_t i_proc );
-
-/**
* @brief Returns Phb Config associated with the Proc target.
* Config number indicates about slot bifurcation and
* associated PHB with the slot.
diff --git a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C
index 6b4aa9c8f..9389db2ad 100644
--- a/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C
+++ b/src/usr/diag/prdf/occ_firdata/prdfWriteHomerFirData.C
@@ -660,7 +660,7 @@ errlHndl_t writeData( uint8_t * i_hBuf, size_t i_hBufSize,
// Check Processor type
bool isNaples = false;
TargetHandleList list = getFunctionalTargetList( TYPE_PROC );
- if ((list.size() > 0) && (MODEL_NAPLES == getProcModel(list[0])))
+ if ((list.size() > 0) && (MODEL_NAPLES == getChipModel(list[0])))
isNaples = true;
// Get the ultimate buffer size.
OpenPOWER on IntegriCloud