summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorBenjamin Weisenbeck <bweisenb@us.ibm.com>2017-08-28 14:22:59 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2017-09-05 16:09:12 -0400
commitc749a8867ef8cc29551ce2d316aa12553b5ac3a5 (patch)
treef9eee027dfc3e293fa8c0377312feff4d17c4031 /src/usr
parentfe7836157e36e7b5820fcfc52101031fd78764df (diff)
downloadtalos-hostboot-c749a8867ef8cc29551ce2d316aa12553b5ac3a5.tar.gz
talos-hostboot-c749a8867ef8cc29551ce2d316aa12553b5ac3a5.zip
PRD: Reorganized some pll code
Change-Id: I301e457d21acaeb00af5dfc89fc99aa8ea4585e7 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45250 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45569 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C173
1 files changed, 45 insertions, 128 deletions
diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C
index 116706577..2f5994e2b 100644
--- a/src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C
+++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Pll.C
@@ -60,55 +60,73 @@ enum
OSC_SW_MF_REF = 37,
};
-void ClearChipletParityError(ExtensibleChip * i_chip,
- TARGETING::TYPE i_chpltType)
+void getChpltList ( ExtensibleChip * i_chip,
+ TARGETING::TYPE i_chpltType,
+ const char * &o_errRegStr,
+ const char * &o_cfgRegStr,
+ ExtensibleChipList & o_chpltList )
{
- #define PRDF_FUNC "[Proc::ClearChipletParityError ]"
-
- int32_t rc = SUCCESS;
- const char * errRegStr = NULL;
-
+ #define PRDF_FUNC "[Proc::getChpltList ]"
switch (i_chpltType)
{
case TYPE_PROC:
- errRegStr = "TP_ERROR_REG";
+ o_errRegStr = "TP_ERROR_REG";
+ o_cfgRegStr = "TP_CONFIG_REG";
break;
case TYPE_OBUS:
- errRegStr = "OBUS_ERROR_REG";
+ o_errRegStr = "OBUS_ERROR_REG";
+ o_cfgRegStr = "OBUS_CONFIG_REG";
break;
case TYPE_XBUS:
- errRegStr = "XBUS_ERROR_REG";
+ o_errRegStr = "XBUS_ERROR_REG";
+ o_cfgRegStr = "XBUS_CONFIG_REG";
break;
case TYPE_PEC:
- errRegStr = "PCI_ERROR_REG";
+ o_errRegStr = "PCI_ERROR_REG";
+ o_cfgRegStr = "PCI_CONFIG_REG";
break;
case TYPE_MCBIST:
- errRegStr = "MC_ERROR_REG";
+ o_errRegStr = "MC_ERROR_REG";
+ o_cfgRegStr = "MC_CONFIG_REG";
break;
case TYPE_EQ:
- errRegStr = "EQ_ERROR_REG";
+ o_errRegStr = "EQ_ERROR_REG";
+ o_cfgRegStr = "EQ_CONFIG_REG";
break;
case TYPE_CORE:
- errRegStr = "EC_ERROR_REG";
+ o_errRegStr = "EC_ERROR_REG";
+ o_cfgRegStr = "EC_CONFIG_REG";
break;
default:
- // Unexpected chiplet type, just return
PRDF_ERR(PRDF_FUNC "Unexpected chiplet type %x for for 0x%08x",
i_chpltType, i_chip->getHuid());
- return;
+ PRDF_ASSERT(false);
}
- ExtensibleChipList chpltList;
-
if ( i_chpltType == TYPE_PROC || i_chpltType == TYPE_XBUS )
{
- chpltList.push_back(i_chip);
+ o_chpltList.push_back(i_chip);
}
else
{
- chpltList = PlatServices::getConnected(i_chip, i_chpltType);
+ o_chpltList = PlatServices::getConnected(i_chip, i_chpltType);
}
+ #undef PRDF_FUNC
+}
+
+void ClearChipletParityError(ExtensibleChip * i_chip,
+ TARGETING::TYPE i_chpltType)
+{
+ #define PRDF_FUNC "[Proc::ClearChipletParityError ]"
+
+ int32_t rc = SUCCESS;
+ const char * errRegStr = nullptr;
+ const char * cfgRegStr = nullptr;
+ ExtensibleChipList chpltList;
+
+ getChpltList( i_chip, i_chpltType, errRegStr, cfgRegStr, chpltList );
+
for ( auto chplt : chpltList )
{
SCAN_COMM_REGISTER_CLASS * errReg = chplt->getRegister(errRegStr);
@@ -130,42 +148,11 @@ void ClearChipletPll(ExtensibleChip * i_chip, TARGETING::TYPE i_chpltType)
#define PRDF_FUNC "[Proc::ClearChipletPll] "
int32_t rc = SUCCESS;
- const char * errRegStr = NULL;
-
- switch (i_chpltType)
- {
- case TYPE_PROC:
- errRegStr = "TP_ERROR_REG";
- break;
- case TYPE_OBUS:
- errRegStr = "OBUS_ERROR_REG";
- break;
- case TYPE_XBUS:
- errRegStr = "XBUS_ERROR_REG";
- break;
- case TYPE_PEC:
- errRegStr = "PCI_ERROR_REG";
- break;
- case TYPE_MCBIST:
- errRegStr = "MC_ERROR_REG";
- break;
- default:
- // Unexpected chiplet type, just return
- PRDF_ERR(PRDF_FUNC "Unexpected chiplet type %x for for 0x%08x",
- i_chpltType, i_chip->getHuid());
- return;
- }
-
+ const char * errRegStr = nullptr;
+ const char * cfgRegStr = nullptr;
ExtensibleChipList chpltList;
- if ( i_chpltType == TYPE_PROC || i_chpltType == TYPE_XBUS )
- {
- chpltList.push_back(i_chip);
- }
- else
- {
- chpltList = PlatServices::getConnected(i_chip, i_chpltType);
- }
+ getChpltList( i_chip, i_chpltType, errRegStr, cfgRegStr, chpltList );
for ( auto chplt : chpltList )
{
@@ -189,7 +176,6 @@ void ClearChipletPll(ExtensibleChip * i_chip, TARGETING::TYPE i_chpltType)
errRegStr, chplt->getHuid());
continue;
}
-
}
#undef PRDF_FUNC
@@ -200,42 +186,11 @@ void MaskChipletPll(ExtensibleChip * i_chip, TARGETING::TYPE i_chpltType)
#define PRDF_FUNC "[Proc::MaskChipletPll] "
int32_t rc = SUCCESS;
- const char * cfgRegStr = NULL;
-
- switch (i_chpltType)
- {
- case TYPE_PROC:
- cfgRegStr = "TP_CONFIG_REG";
- break;
- case TYPE_OBUS:
- cfgRegStr = "OBUS_CONFIG_REG";
- break;
- case TYPE_XBUS:
- cfgRegStr = "XBUS_CONFIG_REG";
- break;
- case TYPE_PEC:
- cfgRegStr = "PCI_CONFIG_REG";
- break;
- case TYPE_MCBIST:
- cfgRegStr = "MC_CONFIG_REG";
- break;
- default:
- // Unexpected chiplet type, just return
- PRDF_ERR(PRDF_FUNC "Unexpected chiplet type %x for for 0x%08x",
- i_chpltType, i_chip->getHuid());
- return;
- }
-
+ const char * errRegStr = nullptr;
+ const char * cfgRegStr = nullptr;
ExtensibleChipList chpltList;
- if ( i_chpltType == TYPE_PROC || i_chpltType == TYPE_XBUS )
- {
- chpltList.push_back(i_chip);
- }
- else
- {
- chpltList = PlatServices::getConnected(i_chip, i_chpltType);
- }
+ getChpltList( i_chip, i_chpltType, errRegStr, cfgRegStr, chpltList );
for ( auto chplt : chpltList )
{
@@ -268,46 +223,9 @@ bool CheckChipletPll(ExtensibleChip * i_chip, TARGETING::TYPE i_chpltType)
bool pllErrFound = false;
const char * errRegStr = NULL;
const char * cfgRegStr = NULL;
-
- switch (i_chpltType)
- {
- case TYPE_PROC:
- errRegStr = "TP_ERROR_REG";
- cfgRegStr = "TP_CONFIG_REG";
- break;
- case TYPE_OBUS:
- errRegStr = "OBUS_ERROR_REG";
- cfgRegStr = "OBUS_CONFIG_REG";
- break;
- case TYPE_XBUS:
- errRegStr = "XBUS_ERROR_REG";
- cfgRegStr = "XBUS_CONFIG_REG";
- break;
- case TYPE_PEC:
- errRegStr = "PCI_ERROR_REG";
- cfgRegStr = "PCI_CONFIG_REG";
- break;
- case TYPE_MCBIST:
- errRegStr = "MC_ERROR_REG";
- cfgRegStr = "MC_CONFIG_REG";
- break;
- default:
- // Unexpected chiplet type, just return false
- PRDF_ERR(PRDF_FUNC "Unexpected chiplet type %x for for 0x%08x",
- i_chpltType, i_chip->getHuid());
- return false;
- }
-
ExtensibleChipList chpltList;
- if ( i_chpltType == TYPE_PROC || i_chpltType == TYPE_XBUS )
- {
- chpltList.push_back(i_chip);
- }
- else
- {
- chpltList = PlatServices::getConnected(i_chip, i_chpltType);
- }
+ getChpltList( i_chip, i_chpltType, errRegStr, cfgRegStr, chpltList );
for ( auto chplt : chpltList )
{
@@ -346,7 +264,6 @@ bool CheckChipletPll(ExtensibleChip * i_chip, TARGETING::TYPE i_chpltType)
int32_t CheckErrorType( ExtensibleChip * i_chip, uint32_t & o_errType )
{
#define PRDF_FUNC "[Proc::CheckErrorType] "
-
int32_t rc = SUCCESS;
SCAN_COMM_REGISTER_CLASS * TP_LFIR =
OpenPOWER on IntegriCloud