summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2016-08-23 10:57:09 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-08-31 18:02:33 -0400
commitebe99ba5331a96e7bb1fb5328e78596b6cf0e5ab (patch)
treeb7d0f5161194fe4204aa986b2d478faa534c8c5b
parent95aa654c3cd18d2d6e209c5554e405bfe871378e (diff)
downloadtalos-hostboot-ebe99ba5331a96e7bb1fb5328e78596b6cf0e5ab.tar.gz
talos-hostboot-ebe99ba5331a96e7bb1fb5328e78596b6cf0e5ab.zip
PRD: updated PlatServices getChipLevel() and getChipModel()
Converted getProcModel() into getChipModel() so that any unit of the chip can be given as a parameter (to match getChipLevel() behavior). Change-Id: I753602c78e113754ce61ace753af89a99c4ee276 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28688 Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28817 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.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