summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/fapi
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2013-06-25 17:07:46 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-07-02 14:57:29 -0500
commit4c3292e066ded88bb475db3339ae0b98c976768e (patch)
treea8e06fc1921a73d318c48ebbc5c98bac2c45e94d /src/usr/hwpf/fapi
parentfdd698d541e219dbbb57d4d248dd15ef08be564a (diff)
downloadtalos-hostboot-4c3292e066ded88bb475db3339ae0b98c976768e.tar.gz
talos-hostboot-4c3292e066ded88bb475db3339ae0b98c976768e.zip
HWPF: Support Children callout/deconfigure/GARD in FAPI Error XML
Change-Id: I72584c095e8c15a56e84cca67260935ac875b7fb RTC: 69794 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5187 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/fapi')
-rw-r--r--src/usr/hwpf/fapi/fapiErrorInfo.C17
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseErrorInfo.pl174
-rw-r--r--src/usr/hwpf/fapi/fapiReturnCode.C44
3 files changed, 208 insertions, 27 deletions
diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C
index 2d700ad7a..237be79a5 100644
--- a/src/usr/hwpf/fapi/fapiErrorInfo.C
+++ b/src/usr/hwpf/fapi/fapiErrorInfo.C
@@ -40,6 +40,7 @@
* mjjones 09/19/2012 Replace FFDC type with ID
* mjjones 03/22/2013 Support Procedure Callouts
* mjjones 05/20/2013 Support Bus Callouts
+ * mjjones 06/24/2013 Support Children CDGs
*/
#include <fapiErrorInfo.H>
@@ -117,6 +118,22 @@ ErrorInfoCDG::ErrorInfoCDG(const Target & i_target,
}
//******************************************************************************
+// ErrorInfoChildrenCDG Constructor
+//******************************************************************************
+ErrorInfoChildrenCDG::ErrorInfoChildrenCDG(
+ const Target & i_parentChip,
+ 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)
+{
+
+}
+
+//******************************************************************************
// ErrorInfo Destructor
//******************************************************************************
ErrorInfo::~ErrorInfo()
diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
index 8ca5884c6..cbab50f07 100755
--- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl
@@ -55,6 +55,7 @@
# mjjones 04/25/13 Allow multiple register ffdc ids in a
# collectRegisterFfdc element
# mjjones 05/20/13 Support Bus Callouts
+# mjjones 06/24/13 Support Children CDGs
#
# End Change Log ******************************************************
@@ -448,7 +449,8 @@ foreach my $argnum (1 .. $#ARGV)
my $eiObjectStr = "const void * l_objects[] = {";
my $eiEntryStr = "";
my $eiEntryCount = 0;
- my %cdgHash; # Records the callout/deconfigure/gards for each Target
+ my %cdgTargetHash; # Records the callout/deconfigure/gards for Targets
+ my %cdgChildHash; # Records the callout/deconfigure/gards for Children
# Local FFDC
foreach my $ffdc (@{$err->{ffdc}})
@@ -469,7 +471,7 @@ foreach my $argnum (1 .. $#ARGV)
$eiEntryCount++;
}
- # Procedure/Target/Bus callouts
+ # Procedure/Target/Bus/Child callouts
foreach my $callout (@{$err->{callout}})
{
if (! exists $callout->{priority})
@@ -516,48 +518,115 @@ foreach my $argnum (1 .. $#ARGV)
}
elsif (exists $callout->{target})
{
- # Add the Target to cdgHash to be processed with any
+ # Add the Target to cdgTargetHash to be processed with any
# deconfigure and GARD requests
- $cdgHash{$callout->{target}}{callout} = 1;
- $cdgHash{$callout->{target}}{priority} = $callout->{priority};
+ $cdgTargetHash{$callout->{target}}{callout} = 1;
+ $cdgTargetHash{$callout->{target}}{priority} =
+ $callout->{priority};
+ }
+ elsif (exists $callout->{childTargets})
+ {
+ # Check that the parent and childType subelements exist
+ if (! exists $callout->{childTargets}->{parent})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Child Callout parent missing\n");
+ exit(1);
+ }
+ if (! exists $callout->{childTargets}->{childType})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Child Callout childType missing\n");
+ exit(1);
+ }
+
+ # Add the child info to cdgChildHash to be processed with
+ # any deconfigure and GARD requests
+ my $parent = $callout->{childTargets}->{parent};
+ my $childType = $callout->{childTargets}->{childType};
+ $cdgChildHash{$parent}{$childType}{callout} = 1;
+ $cdgChildHash{$parent}{$childType}{priority} =
+ $callout->{priority};
}
else
{
- print ("fapiParseErrorInfo.pl ERROR. Callout procedure/target/bus missing\n");
+ print ("fapiParseErrorInfo.pl ERROR. Callout incomplete\n");
exit(1);
}
}
- # Target deconfigures
+ # Target/Child deconfigures
foreach my $deconfigure (@{$err->{deconfigure}})
{
- if (! exists $deconfigure->{target})
+ if (exists $deconfigure->{target})
{
- print ("fapiParseErrorInfo.pl ERROR. Deconfigure target missing\n");
- exit(1);
+ # Add the Target to cdgTargetHash to be processed with any
+ # callout and GARD requests
+ $cdgTargetHash{$deconfigure->{target}}{deconf} = 1;
}
+ elsif (exists $deconfigure->{childTargets})
+ {
+ # Check that the parent and childType subelements exist
+ if (! exists $deconfigure->{childTargets}->{parent})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Child Deconfigure parent missing\n");
+ exit(1);
+ }
+ if (! exists $deconfigure->{childTargets}->{childType})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Child Deconfigure childType missing\n");
+ exit(1);
+ }
- # Add the Target to cdgHash to be processed with any
- # callout and gard requests
- $cdgHash{$deconfigure->{target}}{deconf} = 1;
+ # Add the child info to cdgChildHash to be processed with
+ # any callout and GARD requests
+ my $parent = $deconfigure->{childTargets}->{parent};
+ my $childType = $deconfigure->{childTargets}->{childType};
+ $cdgChildHash{$parent}{$childType}{deconf} = 1;
+ }
+ else
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Deconfigure incomplete\n");
+ exit(1);
+ }
}
- # Target Gards
+ # Target/Child Gards
foreach my $gard (@{$err->{gard}})
{
- if (! exists $gard->{target})
+ if (exists $gard->{target})
{
- print ("fapiParseErrorInfo.pl ERROR. Gard target missing\n");
- exit(1);
+ # Add the Target to cdgTargetHash to be processed with any
+ # callout and deconfigure requests
+ $cdgTargetHash{$gard->{target}}{deconf} = 1;
}
+ elsif (exists $gard->{childTargets})
+ {
+ # Check that the parent and childType subelements exist
+ if (! exists $gard->{childTargets}->{parent})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Child GARD parent missing\n");
+ exit(1);
+ }
+ if (! exists $gard->{childTargets}->{childType})
+ {
+ print ("fapiParseErrorInfo.pl ERROR. Child GARD childType missing\n");
+ exit(1);
+ }
- # Add the Target to cdgHash (this target may also have
- # callout and deconfigure requests
- $cdgHash{$gard->{target}}{gard} = 1;
+ # Add the child info to cdgChildHash to be processed with
+ # any callout and deconfigure requests
+ my $parent = $gard->{childTargets}->{parent};
+ my $childType = $gard->{childTargets}->{childType};
+ $cdgChildHash{$parent}{$childType}{gard} = 1;
+ }
+ else
+ {
+ print ("fapiParseErrorInfo.pl ERROR. GARD incomplete\n");
+ exit(1);
+ }
}
# Process the callout, deconfigures and GARDs for each Target
- foreach my $cdg (keys %cdgHash)
+ foreach my $cdg (keys %cdgTargetHash)
{
# Check the type
print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$cdg); \\\n";
@@ -567,19 +636,19 @@ foreach my $argnum (1 .. $#ARGV)
my $deconf = 0;
my $gard = 0;
- if (exists $cdgHash{$cdg}->{callout})
+ if (exists $cdgTargetHash{$cdg}->{callout})
{
$callout = 1;
}
- if (exists $cdgHash{$cdg}->{priority})
+ if (exists $cdgTargetHash{$cdg}->{priority})
{
- $priority = $cdgHash{$cdg}->{priority};
+ $priority = $cdgTargetHash{$cdg}->{priority};
}
- if (exists $cdgHash{$cdg}->{deconf})
+ if (exists $cdgTargetHash{$cdg}->{deconf})
{
$deconf = 1;
}
- if (exists $cdgHash{$cdg}->{gard})
+ if (exists $cdgTargetHash{$cdg}->{gard})
{
$gard = 1;
}
@@ -597,6 +666,59 @@ foreach my $argnum (1 .. $#ARGV)
$eiEntryCount++;
}
+ # Process the callout, deconfigures and GARDs for Child Targets
+ foreach my $parent (keys %cdgChildHash)
+ {
+ # Check the type
+ print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$parent); \\\n";
+
+ foreach my $childType (keys %{$cdgChildHash{$parent}})
+ {
+ my $callout = 0;
+ my $priority = 'LOW';
+ my $deconf = 0;
+ my $gard = 0;
+
+ if (exists $cdgChildHash{$parent}{$childType}->{callout})
+ {
+ $callout = 1;
+ }
+ if (exists $cdgChildHash{$parent}->{$childType}->{priority})
+ {
+ $priority =
+ $cdgChildHash{$parent}->{$childType}->{priority};
+ }
+ if (exists $cdgChildHash{$parent}->{$childType}->{deconf})
+ {
+ $deconf = 1;
+ }
+ 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);
+
+ # Add an EI entry to eiEntryStr
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_parentChipObjIndex = $objNum; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_callout = $callout; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_deconfigure = $deconf; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_childType = fapi::$childType; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_gard = $gard; \\\n";
+ $eiEntryStr .=
+ " l_entries[$eiEntryCount].children_cdg.iv_calloutPriority = fapi::CalloutPriorities::$priority; \\\n";
+ $eiEntryCount++;
+ }
+ }
+
# Add all objects to $eiObjectStr
my $objCount = 0;
diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C
index 621b649e1..2b15a82f6 100644
--- a/src/usr/hwpf/fapi/fapiReturnCode.C
+++ b/src/usr/hwpf/fapi/fapiReturnCode.C
@@ -50,6 +50,7 @@
* mjjones 09/19/2012 Add FFDC ID to error info
* mjjones 03/22/2013 Support Procedure Callouts
* mjjones 05/20/2013 Support Bus Callouts
+ * mjjones 06/24/2013 Support Children CDGs
*/
#include <fapiReturnCode.H>
@@ -325,10 +326,33 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects,
i_pObjects[l_targIndex]);
// Add the ErrorInfo
- FAPI_ERR("addErrorInfo: Adding target cdg (%d%d%d), pri: %d",
+ FAPI_ERR("addErrorInfo: Adding target cdg (%d:%d:%d), pri: %d",
l_callout, l_deconf, l_gard, l_pri);
addEICdg(*l_pTarget, l_callout, l_deconf, l_gard, l_pri);
}
+ else if (l_type == EI_TYPE_CHILDREN_CDG)
+ {
+ uint8_t l_parentChipIndex =
+ i_pEntries[i].children_cdg.iv_parentChipObjIndex;
+ 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;
+ 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]);
+
+ // 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);
+ }
else
{
FAPI_ERR("addErrorInfo: Unrecognized EI type: %d", l_type);
@@ -462,4 +486,22 @@ void ReturnCode::addEICdg(
iv_CDGs.push_back(l_pCdg);
}
+//******************************************************************************
+// addEIChildrenCdg function
+//******************************************************************************
+void ReturnCode::addEIChildrenCdg(
+ const Target & i_parentChip,
+ const TargetType i_childType,
+ const bool i_callout,
+ const bool i_deconfigure,
+ const bool i_gard,
+ const CalloutPriorities::CalloutPriority i_priority)
+{
+ // 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);
+ getCreateReturnCodeDataRef().getCreateErrorInfo().
+ iv_childrenCDGs.push_back(l_pCdg);
+}
+
}
OpenPOWER on IntegriCloud