summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2013-09-13 14:59:14 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-10 12:02:04 -0500
commitae5f2aa9194b6f26893bfb21b1fc115d3cae0dcb (patch)
tree01d6128e1c9f8c8aa3b412160d08af827093a7d2 /src/usr
parent95bf47c534737019f956fbcca2c622c98dacc266 (diff)
downloadblackbird-hostboot-ae5f2aa9194b6f26893bfb21b1fc115d3cae0dcb.tar.gz
blackbird-hostboot-ae5f2aa9194b6f26893bfb21b1fc115d3cae0dcb.zip
HWPF Error XML: Allow callout/deconfigure/gard of DIMM(s) related to MBA
Change-Id: Ibd067f73cf381b18eab5e48cf1f72f961450a1f2 RTC:81669 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6208 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwpf/fapi/fapiErrorInfo.C12
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseErrorInfo.pl71
-rw-r--r--src/usr/hwpf/fapi/fapiReturnCode.C32
-rw-r--r--src/usr/hwpf/hwp/fapiHwpErrorInfo.xml79
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpError.C67
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwpInvoker.C101
-rw-r--r--src/usr/hwpf/plat/fapiPlatUtil.C11
-rw-r--r--src/usr/hwpf/test/fapiRcTest.C10
-rw-r--r--src/usr/hwpf/test/hwpftest.H16
9 files changed, 350 insertions, 49 deletions
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C
index 27f505383..ecac27b76 100644
--- a/src/usr/hwpf/fapi/fapiErrorInfo.C
+++ b/src/usr/hwpf/fapi/fapiErrorInfo.C
@@ -42,6 +42,8 @@
* mjjones 05/20/2013 Support Bus Callouts
* mjjones 06/24/2013 Support Children CDGs
* mjjones 08/26/2013 Support HW Callouts
+ * rjknight 09/24/2013 Support dimm callouts
+ * based on mba parent target
*/
#include <fapiErrorInfo.H>
@@ -242,14 +244,16 @@ void ErrorInfoCDG::operator delete(void * i_ptr)
// ErrorInfoChildrenCDG Constructor
//******************************************************************************
ErrorInfoChildrenCDG::ErrorInfoChildrenCDG(
- const Target & i_parentChip,
+ const Target & i_parent,
const TargetType i_childType,
const bool i_callout,
const bool i_deconfigure,
const bool i_gard,
- const CalloutPriorities::CalloutPriority i_priority)
-: iv_parentChip(i_parentChip), iv_childType(i_childType), iv_callout(i_callout),
- iv_calloutPriority(i_priority), iv_deconfigure(i_deconfigure), iv_gard(i_gard)
+ const CalloutPriorities::CalloutPriority i_priority,
+ const uint8_t i_childPort, const uint8_t i_childNum )
+: iv_parent(i_parent), iv_childType(i_childType), iv_callout(i_callout),
+ iv_calloutPriority(i_priority), iv_deconfigure(i_deconfigure),
+ iv_gard(i_gard), iv_childPort(i_childPort), iv_childNumber(i_childNum)
{
}
diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
index dc20d3625..9ff2e1d73 100755
--- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
@@ -59,9 +59,10 @@
# mjjones 08/20/13 Use constants for Reg FFDC collection
# mjjones 08/26/13 Support HW Callouts
# dedahle 09/30/13 Support chiplet register FFDC collection
+# rjknight 09/24/13 Allow callout/deconfigure/gard of
+# DIMM(s) related to MBA
#
-# End Change Log ******************************************************
-
+# End Change Log *****************************************************
#
# Usage:
# fapiParseErrorInfo.pl <output dir> <filename1> <filename2> ...
@@ -580,6 +581,7 @@ foreach my $argnum (1 .. $#ARGV)
$cdgTargetHash{$callout->{target}}{callout} = 1;
$cdgTargetHash{$callout->{target}}{priority} =
$callout->{priority};
+
$elementsFound++;
}
if (exists $callout->{childTargets})
@@ -590,6 +592,7 @@ foreach my $argnum (1 .. $#ARGV)
print ("fapiParseErrorInfo.pl ERROR in $err->{rc}. Child Callout parent missing\n");
exit(1);
}
+
if (! exists $callout->{childTargets}->{childType})
{
print ("fapiParseErrorInfo.pl ERROR in $err->{rc}. Child Callout childType missing\n");
@@ -603,7 +606,22 @@ foreach my $argnum (1 .. $#ARGV)
$cdgChildHash{$parent}{$childType}{callout} = 1;
$cdgChildHash{$parent}{$childType}{priority} =
$callout->{priority};
+
$elementsFound++;
+
+ if (exists $callout->{childTargets}->{childPort})
+ {
+ my $childPort = $callout->{childTargets}->{childPort};
+
+ $cdgChildHash{$parent}{$childType}{childPort} = $childPort;
+ }
+
+ if (exists $callout->{childTargets}->{childNumber})
+ {
+ my $childNum = $callout->{childTargets}->{childNumber};
+ $cdgChildHash{$parent}{$childType}{childNumber} = $childNum;
+ }
+
}
if ($elementsFound == 0)
{
@@ -647,7 +665,22 @@ foreach my $argnum (1 .. $#ARGV)
my $parent = $deconfigure->{childTargets}->{parent};
my $childType = $deconfigure->{childTargets}->{childType};
$cdgChildHash{$parent}{$childType}{deconf} = 1;
+
$elementsFound++;
+
+ if ( exists $deconfigure->{childTargets}->{childPort})
+ {
+ my $childPort = $deconfigure->{childTargets}->{childPort};
+
+ $cdgChildHash{$parent}{$childType}{childPort} = $childPort;
+ }
+
+ if ( exists $deconfigure->{childTargets}->{childNumber})
+ {
+ my $childNum = $deconfigure->{childTargets}->{childNumber};
+ $cdgChildHash{$parent}{$childType}{childNumber} = $childNum;
+
+ }
}
if ($elementsFound == 0)
{
@@ -691,7 +724,22 @@ foreach my $argnum (1 .. $#ARGV)
my $parent = $gard->{childTargets}->{parent};
my $childType = $gard->{childTargets}->{childType};
$cdgChildHash{$parent}{$childType}{gard} = 1;
+
$elementsFound++;
+
+ if ( exists $gard->{childTargets}->{childPort})
+ {
+ my $childPort = $gard->{childTargets}->{childPort};
+
+ $cdgChildHash{$parent}{$childType}{childPort} = $childPort;
+
+ }
+
+ if ( exists $gard->{childTargets}->{childNumber})
+ {
+ my $childNum = $gard->{childTargets}->{childNumber};
+ $cdgChildHash{$parent}{$childType}{childNumber} = $childNum;
+ }
}
if ($elementsFound == 0)
{
@@ -758,6 +806,8 @@ foreach my $argnum (1 .. $#ARGV)
my $priority = 'LOW';
my $deconf = 0;
my $gard = 0;
+ my $childPort = 0xFF;
+ my $childNumber = 0xFF;
if (exists $cdgChildHash{$parent}{$childType}->{callout})
{
@@ -772,11 +822,22 @@ foreach my $argnum (1 .. $#ARGV)
{
$deconf = 1;
}
+ if (exists $cdgChildHash{$parent}->{$childType}->{childPort})
+ {
+ $childPort =
+ $cdgChildHash{$parent}->{$childType}->{childPort} ;
+ }
+ if (exists $cdgChildHash{$parent}->{$childType}->{childNumber})
+ {
+ $childNumber =
+ $cdgChildHash{$parent}->{$childType}->{childNumber} ;
+ }
if (exists $cdgChildHash{$parent}->{$childType}->{gard})
{
$gard = 1;
}
+
# Add the Target to the objectlist if it doesn't already exist
my $objNum = addEntryToArray(\@eiObjects, $parent);
@@ -784,7 +845,7 @@ foreach my $argnum (1 .. $#ARGV)
$eiEntryStr .=
" l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG; \\\n";
$eiEntryStr .=
- " l_entries[$eiEntryCount].children_cdg.iv_parentChipObjIndex = $objNum; \\\n";
+ " l_entries[$eiEntryCount].children_cdg.iv_parentObjIndex = $objNum; \\\n";
$eiEntryStr .=
" l_entries[$eiEntryCount].children_cdg.iv_callout = $callout; \\\n";
$eiEntryStr .=
@@ -792,6 +853,10 @@ foreach my $argnum (1 .. $#ARGV)
$eiEntryStr .=
" l_entries[$eiEntryCount].children_cdg.iv_childType = fapi::$childType; \\\n";
$eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_childPort = $childPort; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_childNumber = $childNumber; \\\n";
+ $eiEntryStr .=
" l_entries[$eiEntryCount].children_cdg.iv_gard = $gard; \\\n";
$eiEntryStr .=
" l_entries[$eiEntryCount].children_cdg.iv_calloutPriority = fapi::CalloutPriorities::$priority; \\\n";
diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C
index 587020bee..6feb1d4e6 100644
--- a/src/usr/hwpf/fapi/fapiReturnCode.C
+++ b/src/usr/hwpf/fapi/fapiReturnCode.C
@@ -252,7 +252,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
// The FFDC is a ecmdDataBufferBase
const ecmdDataBufferBase * l_pDb =
static_cast<const ecmdDataBufferBase *>(l_pObject);
-
+
size_t byteLength = l_pDb->getWordLength() * sizeof(uint32_t);
uint32_t * l_pData =
reinterpret_cast<uint32_t*>(fapiMalloc(byteLength));
@@ -264,7 +264,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
// Deliberately not checking return code from extract
l_pDb->extract(l_pData, 0, l_pDb->getBitLength());
addEIFfdc(l_ffdcId, l_pData, (l_pDb->getWordLength() * 4));
-
+
fapiFree(l_pData);
}
else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_TARGET)
@@ -272,7 +272,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
// The FFDC is a fapi::Target
const fapi::Target * l_pTarget =
static_cast<const fapi::Target *>(l_pObject);
-
+
const char * l_ecmdString = l_pTarget->toEcmdString();
addEIFfdc(l_ffdcId, l_ecmdString, (strlen(l_ecmdString) + 1));
}
@@ -363,26 +363,29 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
}
else if (l_type == EI_TYPE_CHILDREN_CDG)
{
- uint8_t l_parentChipIndex =
- i_pEntries[i].children_cdg.iv_parentChipObjIndex;
+ uint8_t l_parentIndex =
+ i_pEntries[i].children_cdg.iv_parentObjIndex;
TargetType l_childType = static_cast<TargetType>(
i_pEntries[i].children_cdg.iv_childType);
uint8_t l_callout = i_pEntries[i].children_cdg.iv_callout;
uint8_t l_deconf = i_pEntries[i].children_cdg.iv_deconfigure;
uint8_t l_gard = i_pEntries[i].children_cdg.iv_gard;
+ uint8_t l_childPort = i_pEntries[i].children_cdg.iv_childPort;
+ uint8_t l_childNumber =
+ i_pEntries[i].children_cdg.iv_childNumber;
CalloutPriorities::CalloutPriority l_pri =
static_cast<CalloutPriorities::CalloutPriority>(
i_pEntries[i].children_cdg.iv_calloutPriority);
// Get the Parent Target of the children to cdg
- const Target * l_pParentChip = static_cast<const Target *>(
- i_pObjects[l_parentChipIndex]);
+ const Target * l_pParent = static_cast<const Target *>(
+ i_pObjects[l_parentIndex]);
// Add the ErrorInfo
FAPI_ERR("addErrorInfo: Adding children cdg (%d:%d:%d), type: 0x%08x, pri: %d",
l_callout, l_deconf, l_gard, l_childType, l_pri);
- addEIChildrenCdg(*l_pParentChip, l_childType, l_callout, l_deconf,
- l_gard, l_pri);
+ addEIChildrenCdg(*l_pParent, l_childType, l_callout, l_deconf,
+ l_gard, l_pri, l_childPort, l_childNumber );
}
else
{
@@ -538,16 +541,19 @@ void ReturnCode::addEICdg(
// addEIChildrenCdg function
//******************************************************************************
void ReturnCode::addEIChildrenCdg(
- const Target & i_parentChip,
+ const Target & i_parent,
const TargetType i_childType,
const bool i_callout,
const bool i_deconfigure,
const bool i_gard,
- const CalloutPriorities::CalloutPriority i_priority)
+ const CalloutPriorities::CalloutPriority i_priority,
+ const uint8_t i_childPort,
+ const uint8_t i_childNum)
{
// Create an ErrorInfoChildrenCDG object and add it to the Error Information
- ErrorInfoChildrenCDG * l_pCdg = new ErrorInfoChildrenCDG(i_parentChip,
- i_childType, i_callout, i_deconfigure, i_gard, i_priority);
+ ErrorInfoChildrenCDG * l_pCdg = new ErrorInfoChildrenCDG(i_parent,
+ i_childType, i_callout, i_deconfigure, i_gard, i_priority,
+ i_childPort, i_childNum);
getCreateReturnCodeDataRef().getCreateErrorInfo().
iv_childrenCDGs.push_back(l_pCdg);
}
diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
index aaca27edf..33d09bafd 100644
--- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
+++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml
@@ -118,8 +118,85 @@
</hw>
<priority>MEDIUM</priority>
</callout>
+ -->
+ </hwpError>
+
+ <hwpError>
+ <rc>RC_TEST_DIMM_CALLOUT_MBA_A</rc>
+ <description>DIMM Callout generated by Unit Test, passing in
+ MBA target and port number.</description>
+ <!-- Callout ALL dimms on specified MBA port with MEDIUM priority-->
+ <callout>
+ <childTargets>
+ <parent>UNIT_TEST_MBA_TARGET</parent>
+ <childType>TARGET_TYPE_DIMM</childType>
+ <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort>
+ </childTargets>
+ <priority>MEDIUM</priority>
+ </callout>
+ </hwpError>
+ <!-- Callout a specific DIMM on a specified PORT of MBA -->
+ <hwpError>
+ <rc>RC_TEST_DIMM_CALLOUT_MBA_B</rc>
+ <description>DIMM Callout generated by Unit Test, passing in
+ MBA target,port number and specific DIMM number.</description>
+ <callout>
+ <childTargets>
+ <parent>UNIT_TEST_MBA_TARGET</parent>
+ <childType>TARGET_TYPE_DIMM</childType>
+ <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort>
+ <childNumber>UNIT_TEST_DIMM_NUMBER</childNumber>
+ </childTargets>
+ <priority>LOW</priority>
+ </callout>
+ </hwpError>
+ <!-- Callout all dimms on all ports of a specfied MBA -->
+ <hwpError>
+ <rc>RC_TEST_DIMM_CALLOUT_MBA_C</rc>
+ <description>DIMM Callout generated by Unit Test, passing in
+ only MBA target to callout all dimms under it.</description>
+ <callout>
+ <childTargets>
+ <parent>UNIT_TEST_MBA_TARGET</parent>
+ <childType>TARGET_TYPE_DIMM</childType>
+ </childTargets>
+ <priority>HIGH</priority>
+ </callout>
+ </hwpError>
+ <!-- Deconfigure ALL dimms on specified MBA port with MEDIUM priority-->
+ <hwpError>
+ <rc>RC_TEST_DIMM_DECONFIGURE_MBA_A</rc>
+ <description>DIMM DECONFIGURE generated by Unit Test, passing in
+ MBA target and port number.</description>
+ <!-- Commented out to avoid actually calling out chiplets in UT
+ <deconfigure>
+ <childTargets>
+ <parent>UNIT_TEST_MBA_TARGET</parent>
+ <childType>TARGET_TYPE_DIMM</childType>
+ <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort>
+ </childTargets>
+ <priority>MEDIUM</priority>
+ </deconfigure>
+ -->
+ </hwpError>
+ <!-- Gard a specific DIMM on a specified PORT of MBA -->
+ <hwpError>
+ <rc>RC_TEST_DIMM_GARD_MBA_B</rc>
+ <description>DIMM Callout generated by Unit Test, passing in
+ MBA target,port number and specific DIMM number.</description>
+ <!--
+ <gard>
+ <childTargets>
+ <parent>UNIT_TEST_MBA_TARGET</parent>
+ <childType>TARGET_TYPE_DIMM</childType>
+ <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort>
+ <childNumber>UNIT_TEST_DIMM_NUMBER</childNumber>
+ </childTargets>
+ <priority>LOW</priority>
+ </gard>
+ -->
+ </hwpError>
-->
- </hwpError>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_TEST_ERROR_B</rc>
diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C
index b7e1119c1..e5df32461 100644
--- a/src/usr/hwpf/hwp/fapiTestHwpError.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpError.C
@@ -36,6 +36,8 @@
* mjjones 10/06/2011 Major updates due to new
* ErrorInfo design
* mjjones 10/17/2011 Moved AnalyzeError to new file
+ * rjknight 09/28/2013 Added callout test for MBA
+ * dimm callout support
*
*
* HWP_IGNORE_VERSION_CHECK
@@ -49,7 +51,8 @@ extern "C"
//******************************************************************************
// hwpTestError function
//******************************************************************************
-fapi::ReturnCode hwpTestError(const fapi::Target & i_target)
+fapi::ReturnCode hwpTestError(const fapi::Target & i_procTarget,
+ const fapi::Target & i_mbaTarget )
{
FAPI_INF("hwpTestError: Start HWP");
@@ -62,13 +65,13 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target)
l_buf.setBit(64);
FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_A");
- const fapi::Target & UNIT_TEST_FFDC_MASTER_CHIP_TARGET = i_target;
+ const fapi::Target & UNIT_TEST_FFDC_MASTER_CHIP_TARGET = i_procTarget;
uint32_t & UNIT_TEST_FFDC_DATA_INTEGER = l_ffdc;
ecmdDataBufferBase & UNIT_TEST_FFDC_DATA_BUF = l_buf;
FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A);
// Log the error
- fapiLogError(l_rc, fapi::FAPI_ERRL_SEV_PREDICTIVE);
+ fapiLogError(l_rc, fapi::FAPI_ERRL_SEV_PREDICTIVE, true);
// Check that the return code is set to success
if (!l_rc.ok())
@@ -77,7 +80,63 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target)
"expected success", static_cast<uint32_t>(l_rc));
}
- // Generate the same error again
+
+ FAPI_INF("Test calling out all DIMMs based on mba port 0");
+
+ // all dimms on a specific port
+ FAPI_ERR("Generating RC_TEST_DIMM_CALLOUT_MBA_A");
+
+ const fapi::Target & UNIT_TEST_MBA_TARGET = i_mbaTarget;
+ uint8_t UNIT_TEST_MBA_PORT_NUMBER = 0x0;
+
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_CALLOUT_MBA_A);
+
+ fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true );
+
+ // specific dimm on a specific port
+ FAPI_INF("Test calling out DIMM3 based on port and dimm number");
+
+ UNIT_TEST_MBA_PORT_NUMBER = 0x1;
+ uint8_t UNIT_TEST_DIMM_NUMBER = 0x01;
+
+ FAPI_ERR("Generating RC_TEST_DIMM_CALLOUT_MBA_B");
+
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_CALLOUT_MBA_B);
+
+ fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true );
+
+
+ FAPI_INF("Test calling out all dimms of an mba");
+ // all dimms on an mba target
+ FAPI_ERR("Generating RC_TEST_DIMM_CALLOUT_MBA_C");
+
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_CALLOUT_MBA_C);
+
+ fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true );
+
+ // commented out due to ci test failing on deconfigured parts
+ FAPI_INF("Test deconfigure all dimms of mba with port 0 specified");
+ UNIT_TEST_MBA_PORT_NUMBER = 0x0;
+ // deconfigure all dimms on port 0
+ FAPI_ERR("Generating RC_TEST_DIMM_DECONFIGURE_MBA_A ");
+
+ FAPI_SET_HWP_ERROR(l_rc,RC_TEST_DIMM_DECONFIGURE_MBA_A);
+
+ fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true );
+
+ FAPI_INF("Test gard of DIMM2");
+ // gard dimm 0 onn port 1
+ UNIT_TEST_DIMM_NUMBER = 0x00;
+ UNIT_TEST_MBA_PORT_NUMBER = 0x01;
+
+ FAPI_ERR("Generating RC_TEST_DIMM_GARD_MBA_B ");
+
+ FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_GARD_MBA_B);
+
+ fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true );
+
+ // Generate the same error again need to return an error
+ // to make the test code happy
FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_A again");
FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A);
diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
index 6739be5b2..a4ff9b3a3 100644
--- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
+++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C
@@ -28,6 +28,7 @@
#include <fapiTarget.H>
#include <fapiReturnCode.H>
+#include <fapiSystemConfig.H>
#include <fapiPlatTrace.H>
#include <fapiErrorInfo.H>
#include <hwpf/hwpf_reasoncodes.H>
@@ -132,6 +133,10 @@ HWAS::epubProcedureID xlateProcedureCallout(
return l_proc;
}
+void getChildTargetsForCDG(
+ TARGETING::Target * i_pParent, TARGETING::TYPE i_childType,
+ TARGETING::TargetHandleList & o_childTargets, uint8_t i_childPort,
+ uint8_t i_childNumber);
/**
* @brief Translates a FAPI target type to a Targeting target type
@@ -404,6 +409,10 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo,
i_errInfo.iv_childrenCDGs.begin();
l_itr != i_errInfo.iv_childrenCDGs.end(); ++l_itr)
{
+
+ uint8_t l_childNumber = (*l_itr)->iv_childNumber;
+ uint8_t l_childPort = (*l_itr)->iv_childPort;
+
TARGETING::TYPE l_childType =
xlateTargetType((*l_itr)->iv_childType);
@@ -414,9 +423,9 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo,
}
else
{
- TARGETING::Target * l_pParentChip =
- reinterpret_cast<TARGETING::Target*>(
- (*l_itr)->iv_parentChip.get());
+ TARGETING::Target * l_pParent =
+ reinterpret_cast<TARGETING::Target *>
+ ((*l_itr)->iv_parent.get());
HWAS::callOutPriority l_priority =
xlateCalloutPriority((*l_itr)->iv_calloutPriority);
@@ -435,14 +444,18 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo,
// Get a list of functional children
TARGETING::TargetHandleList l_children;
- TARGETING::getChildChiplets(l_children, l_pParentChip, l_childType);
+
+ getChildTargetsForCDG( l_pParent, l_childType, l_children,
+ l_childPort, l_childNumber );
// Callout/Deconfigure/GARD each child as appropriate
for (TARGETING::TargetHandleList::const_iterator
l_itr = l_children.begin();
- l_itr != l_children.end(); ++l_itr)
+ l_itr != l_children.end(); ++l_itr)
{
- FAPI_ERR("processEIChildrenCDGs: Calling out target (type: 0x%02x, pri:%d, deconf:%d, gard:%d)",
+
+ FAPI_ERR("processEIChildrenCDGs: Calling out target"
+ " (type: 0x%02x, pri:%d, deconf:%d, gard:%d)",
l_childType, l_priority, l_deconfig, l_gard);
io_pError->addHwCallout(*l_itr, l_priority, l_deconfig, l_gard);
}
@@ -450,6 +463,78 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo,
}
}
+void getChildTargetsForCDG(
+ TARGETING::Target * i_pParent, TARGETING::TYPE i_childType,
+ TARGETING::TargetHandleList & o_childTargets, uint8_t i_childPort,
+ uint8_t i_childNumber )
+{
+ o_childTargets.clear();
+ bool l_functional = true;
+
+ // dimms are not considered as a chiplet but
+ // a logical card so we need special processing here
+ if( i_childType == TARGETING::TYPE_DIMM )
+ {
+ TARGETING::TargetHandleList l_dimmList;
+
+ TARGETING:: getChildAffinityTargets( l_dimmList, i_pParent,
+ TARGETING::CLASS_LOGICAL_CARD,
+ TARGETING::TYPE_DIMM, l_functional);
+
+ for (TARGETING::TargetHandleList::const_iterator
+ l_itr = l_dimmList.begin();
+ l_itr != l_dimmList.end();
+ ++l_itr)
+ {
+
+ uint8_t l_mbaPort =
+ (*l_itr)->getAttr<TARGETING::ATTR_MBA_PORT>();
+
+ uint8_t l_mbaDimm =
+ (*l_itr)->getAttr<TARGETING::ATTR_MBA_DIMM>();
+
+ // if childPort was not set in the callout
+ // the caller is trying to callout either all dimms
+ // connected to this MBA or a specific dimm number on both
+ // ports
+ if( i_childPort == FAPI_ALL_MBA_PORTS )
+ {
+ // if the caller reqested all children on all ports
+ // or if this dimm matches the requested dimm on
+ // either port then add it
+ if( ( i_childNumber == FAPI_ALL_MBA_DIMMS ) ||
+ ( i_childNumber == l_mbaDimm ))
+ {
+ FAPI_DBG("adding callout for i_childNumber=%d "
+ "and i_childPort %d ",
+ i_childNumber, i_childPort );
+
+ o_childTargets.push_back( *l_itr );
+ }
+ }
+ else
+ {
+ // if caller requested all dimms on a specific port or if this
+ // child is the one requested then add it
+ if((( i_childNumber == FAPI_ALL_MBA_DIMMS ) ||
+ ( i_childNumber == l_mbaDimm )) &&
+ ( i_childPort == l_mbaPort ))
+ {
+ FAPI_DBG("adding callout for i_childNumber=%d "
+ " and i_childPort %d",
+ i_childNumber, i_childPort );
+
+ o_childTargets.push_back( *l_itr );
+ }
+ }
+ }
+ }
+ else
+ {
+ TARGETING::getChildChiplets(o_childTargets, i_pParent, i_childType);
+ }
+}
+
//******************************************************************************
// fapiRcToErrl function. Converts a fapi::ReturnCode to an error log
//******************************************************************************
@@ -468,7 +553,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc,
{
// PLAT error. Release the errlHndl_t
FAPI_ERR("fapiRcToErrl: PLAT error: 0x%08x",
- static_cast<uint32_t>(io_rc));
+ static_cast<uint32_t>(io_rc));
l_pError = reinterpret_cast<errlHndl_t> (io_rc.releasePlatData());
}
else if (l_creator == ReturnCode::CREATOR_HWP)
@@ -492,7 +577,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc,
// Add the rcValue as FFDC. This will explain what the error was
l_pError->addFFDC(HWPF_COMP_ID, &l_rcValue, sizeof(l_rcValue), 1,
- HWPF_UDT_HWP_RCVALUE);
+ HWPF_UDT_HWP_RCVALUE);
// Get the Error Information Pointer
const ErrorInfo * l_pErrorInfo = io_rc.getErrorInfo();
diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C
index 939f695cf..0aad15fbf 100644
--- a/src/usr/hwpf/plat/fapiPlatUtil.C
+++ b/src/usr/hwpf/plat/fapiPlatUtil.C
@@ -92,20 +92,15 @@ fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles)
// fapiLogError
//******************************************************************************
void fapiLogError(fapi::ReturnCode & io_rc,
- fapi::fapiErrlSeverity_t i_sev)
+ fapi::fapiErrlSeverity_t i_sev,
+ bool i_unitTestError)
{
// ENUM CONVERSION FAPI to PLATFORM
errlHndl_t l_pError = NULL;
- bool l_unitTestError = false;
FAPI_ERR("fapiLogError: logging error");
- if (fapi::RC_TEST_ERROR_A == static_cast<uint32_t>(io_rc))
- {
- l_unitTestError = true;
- }
-
// Convert a FAPI severity to a ERRORLOG severity
ERRORLOG::errlSeverity_t l_sev = ERRORLOG::ERRL_SEV_UNRECOVERABLE;
switch (i_sev)
@@ -130,7 +125,7 @@ void fapiLogError(fapi::ReturnCode & io_rc,
// Commit the error log. This will delete the error log and set the handle
// to NULL.
- if (l_unitTestError)
+ if (i_unitTestError)
{
errlCommit(l_pError, CXXTEST_COMP_ID);
}
diff --git a/src/usr/hwpf/test/fapiRcTest.C b/src/usr/hwpf/test/fapiRcTest.C
index 1de3728a1..0e9949924 100644
--- a/src/usr/hwpf/test/fapiRcTest.C
+++ b/src/usr/hwpf/test/fapiRcTest.C
@@ -640,7 +640,7 @@ uint32_t rcTest12()
l_entries[3].target_cdg.iv_gard = 0;
l_entries[3].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::HIGH;
l_entries[4].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG;
- l_entries[4].children_cdg.iv_parentChipObjIndex = 1;
+ l_entries[4].children_cdg.iv_parentObjIndex = 1;
l_entries[4].children_cdg.iv_callout = 0;
l_entries[4].children_cdg.iv_deconfigure = 1;
l_entries[4].children_cdg.iv_childType = fapi::TARGET_TYPE_ABUS_ENDPOINT;
@@ -804,7 +804,7 @@ uint32_t rcTest12()
break;
}
- if (l_pErrInfo->iv_childrenCDGs[0]->iv_parentChip != l_target)
+ if (l_pErrInfo->iv_childrenCDGs[0]->iv_parent != l_target)
{
FAPI_ERR("rcTest12. parent chip mismatch");
l_result = 19;
@@ -1174,7 +1174,7 @@ uint32_t rcTest16()
l_entries[7].bus_callout.iv_endpoint2ObjIndex = 3;
l_entries[7].bus_callout.iv_calloutPriority = fapi::CalloutPriorities::HIGH;
l_entries[8].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG;
- l_entries[8].children_cdg.iv_parentChipObjIndex = 2;
+ l_entries[8].children_cdg.iv_parentObjIndex = 2;
l_entries[8].children_cdg.iv_callout = 1;
l_entries[8].children_cdg.iv_deconfigure = 1;
l_entries[8].children_cdg.iv_childType = fapi::TARGET_TYPE_ABUS_ENDPOINT;
@@ -1182,7 +1182,7 @@ uint32_t rcTest16()
l_entries[8].children_cdg.iv_calloutPriority =
fapi::CalloutPriorities::HIGH;
l_entries[9].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG;
- l_entries[9].children_cdg.iv_parentChipObjIndex = 3;
+ l_entries[9].children_cdg.iv_parentObjIndex = 3;
l_entries[9].children_cdg.iv_callout = 1;
l_entries[9].children_cdg.iv_deconfigure = 0;
l_entries[9].children_cdg.iv_childType = fapi::TARGET_TYPE_MBA_CHIPLET;
@@ -1436,7 +1436,7 @@ uint32_t rcTest16()
break;
}
- if (l_pErrInfo->iv_childrenCDGs[0]->iv_parentChip != l_target)
+ if (l_pErrInfo->iv_childrenCDGs[0]->iv_parent != l_target)
{
FAPI_ERR("rcTest16. parent chip mismatch 1");
l_result = 31;
diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H
index fc2f9e584..c1f2a8157 100644
--- a/src/usr/hwpf/test/hwpftest.H
+++ b/src/usr/hwpf/test/hwpftest.H
@@ -198,16 +198,25 @@ public:
// Create a FAPI Target and invoke the hwpTestError HWP. The HWP
// returns an error to test out error handling
fapi::Target l_fapiTarget(TARGET_TYPE_PROC_CHIP,
- reinterpret_cast<void *> (l_pTarget));
+ reinterpret_cast<void *> (l_pTarget));
+
+ TARGETING::TargetHandleList l_mbaTargetList;
+ TARGETING::getAllChiplets(l_mbaTargetList, TARGETING::TYPE_MBA);
- FAPI_INVOKE_HWP(l_err, hwpTestError, l_fapiTarget);
+ // just grab the first one in the list.
+ TARGETING::Target * l_mbaTarget = l_mbaTargetList[0];
+ // Cast to a FAPI type of target.
+ fapi::Target l_fapiMbaTarget( fapi::TARGET_TYPE_MBA_CHIPLET,
+ (reinterpret_cast<void *>( l_mbaTarget)) );
+
+ FAPI_INVOKE_HWP(l_err, hwpTestError, l_fapiTarget, l_fapiMbaTarget);
if (l_err)
{
// Delete the error rather than committing it to avoid it getting
// interpreted as a real problem
TS_TRACE("testHwpf2: Unit Test passed. "
- "hwpTestError failed. Error deleted");
+ "hwpTestError failed. Error deleted");
delete l_err;
l_err = NULL;
}
@@ -895,6 +904,7 @@ public:
} while(0);
}
+
};
#endif
OpenPOWER on IntegriCloud