summaryrefslogtreecommitdiffstats
path: root/tools/scripts
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2015-11-04 06:16:22 -0600
committerMartin Peschke <mpeschke@de.ibm.com>2015-11-05 05:26:41 -0600
commit1bfd1c30b8c3ddd6db9491a638d4d9e55d72c1fb (patch)
tree256ed0225347698a9a75c010978f6793bae0e02e /tools/scripts
parent36b8d154d9b6f17326f1835ac01ea798bf45429d (diff)
downloadtalos-sbe-1bfd1c30b8c3ddd6db9491a638d4d9e55d72c1fb.tar.gz
talos-sbe-1bfd1c30b8c3ddd6db9491a638d4d9e55d72c1fb.zip
FAPI cleanup in PPE
1) Removed importtemp/fapi2 2) Removed old files from import/ 3) Synced over parseErrorInfo.pl from ekb Change-Id: Ic830b9dd86b612f7892a40fb2d3158a73940d7af Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21760 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Diffstat (limited to 'tools/scripts')
-rwxr-xr-xtools/scripts/parseErrorInfo.pl88
1 files changed, 44 insertions, 44 deletions
diff --git a/tools/scripts/parseErrorInfo.pl b/tools/scripts/parseErrorInfo.pl
index 61b6c96d..e192f180 100755
--- a/tools/scripts/parseErrorInfo.pl
+++ b/tools/scripts/parseErrorInfo.pl
@@ -2,36 +2,34 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
-# $Source: src/usr/hwpf/fapi/fapiParseErrorInfo.pl $
+# $Source: hwpf/fapi2/tools/parseErrorInfo.pl $
#
-# OpenPOWER HostBoot Project
-#
-# Contributors Listed Below - COPYRIGHT 2011,2014
-# [+] International Business Machines Corp.
+# IBM CONFIDENTIAL
#
+# EKB Project
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# COPYRIGHT 2015
+# [+] International Business Machines Corp.
#
-# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# permissions and limitations under the License.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
# IBM_PROLOG_END_TAG
-# $Id: fapiParseErrorInfo.pl,v 1.30 2014/07/25 00:36:41 jmcgill Exp $
-# Purpose: This perl script will parse HWP Error XML files and create required
-# FAPI code.
#
-# Author: CamVan Nguyen and Mike Jones
-# Reworked for fapi2/P9
+# @file parseErrorInfo.pl
+# @brief This perl script will parse HWP Error XML files and generate required
+# FAPI code to create and error log and add FFDC to the error.
+#
+# *HWP HWP Owner: N/A
+# *HWP FW Owner: Thi Tran <thi@us.ibm.com>
+# *HWP Team: N/A
+# *HWP Level: 1
+# *HWP Consumed by: HB
#
# Usage:
-# fapiParseErrorInfo.pl <output dir> <filename1> <filename2> ...
+# parseErrorInfo.pl <output dir> <filename1> <filename2> ...
use strict;
@@ -102,7 +100,7 @@ if (($numArgs < 1) || ($arg_output_dir eq undef))
print (" - hwp_return_codes.H. HwpReturnCode enumeration (HWP generated errors)\n");
print (" - hwp_error_info.H. Error information (used by FAPI_SET_HWP_ERROR\n");
print (" when a HWP generates an error)\n");
- print (" - collect_reg_ffdc.C. Function to collect register FFDC\n");
+ print (" - collect_reg_ffdc.H. Function to collect register FFDC\n");
print (" - set_sbe_error.H. Macro to create an SBE error\n");
print (" The --empty-ffdc-classes option is for platforms which don't collect ffdc.\n");
exit(1);
@@ -352,7 +350,7 @@ open(ECFILE, ">", $ecFile);
my $crFile = $arg_output_dir;
$crFile .= "/";
-$crFile .= "collect_reg_ffdc.C";
+$crFile .= "collect_reg_ffdc.H";
open(CRFILE, ">", $crFile);
my $sbFile = $arg_output_dir;
@@ -396,28 +394,29 @@ print ECFILE " *\/\n";
print ECFILE "namespace fapi2\n{\n";
#------------------------------------------------------------------------------
-# Print start of file information to collectRegFfdc.C
+# Print start of file information to collectRegFfdc.H
#------------------------------------------------------------------------------
-print CRFILE "// collect_reg_ffdc.C\n";
+print CRFILE "// collect_reg_ffdc.H\n";
print CRFILE "// This file is generated by the perl script parseErrorInfo.pl\n\n";
+print CRFILE "#ifndef FAPI2_COLLECT_REG_FFDC_H_\n";
+print CRFILE "#define FAPI2_COLLECT_REG_FFDC_H_\n";
print CRFILE "#include <stdint.h>\n";
print CRFILE "#include <vector>\n";
-
+print CRFILE "#include <ffdc.H>\n";
+print CRFILE "#include <hwp_error_info.H>\n";
+print CRFILE "#include <error_info_defs.H>\n";
print CRFILE "#include <buffer.H>\n";
-print CRFILE "#include <collect_reg_ffdc.H>\n";
print CRFILE "#include <target.H>\n";
print CRFILE "#include <return_code.H>\n";
print CRFILE "#include <hw_access.H>\n";
-print CRFILE "#include <plat_trace.H>\n\n";
-
+print CRFILE "#include <plat_trace.H>\n";
print CRFILE "namespace fapi2\n";
print CRFILE "{\n";
+print CRFILE "template< TargetType C, TargetType P >\n";
print CRFILE "void collectRegFfdc(const fapi2::ffdc_t& i_target,\n";
print CRFILE " const fapi2::HwpFfdcId i_ffdcId,\n";
print CRFILE " fapi2::ReturnCode & o_rc,\n";
-print CRFILE " const TargetType i_child,\n";
-print CRFILE " const TargetType i_presChild,\n";
-print CRFILE " uint32_t i_childOffsetMult)\n";
+print CRFILE " uint32_t i_childOffsetMult = 0)\n";
print CRFILE "{\n";
print CRFILE " FAPI_INF(\"collectRegFfdc. FFDC ID: 0x%x\", i_ffdcId);\n";
print CRFILE " fapi2::ReturnCode l_rc;\n";
@@ -435,8 +434,6 @@ print CRFILE " static_cast<void>(l_scomData);\n";
print CRFILE " static_cast<void>(l_ffdcSize);\n";
print CRFILE " static_cast<const void>(i_target);\n";
print CRFILE " static_cast<void>(o_rc);\n";
-print CRFILE " static_cast<void>(i_child);\n";
-print CRFILE " static_cast<void>(i_presChild);\n";
print CRFILE " static_cast<void>(i_childOffsetMult);\n";
#------------------------------------------------------------------------------
# Print start of file information to setSbeError.H
@@ -550,7 +547,6 @@ foreach my $argnum (0 .. $#ARGV)
# right now. When we get further along, we can enable this code.
=begin NO_FFDC_COLLECT_HWP
$count = 0;
-
foreach my $collectFfdc (@{$err->{collectFfdc}})
{
if ($count == 0)
@@ -602,8 +598,8 @@ foreach my $argnum (0 .. $#ARGV)
#---------------------------------------------------------------------------------
if (exists $collectRegisterFfdc->{target})
{
- print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{target}, ";
- print EIFILE "fapi2::$id, RC, fapi2::TARGET_TYPE_NONE, fapi2::TARGET_TYPE_NONE); ";
+ print EIFILE "fapi2::collectRegFfdc<fapi2::TARGET_TYPE_NONE, fapi2::TARGET_TYPE_NONE>($collectRegisterFfdc->{target}, ";
+ print EIFILE "fapi2::$id, RC); ";
addFfdcMethod(\%methods, $collectRegisterFfdc->{target},
$err->{rc}, $target_ffdc_type);
}
@@ -619,8 +615,8 @@ foreach my $argnum (0 .. $#ARGV)
print ("parseErrorInfo.pl ERROR: childType missing from collectRegisterFfdc\n");
exit(1);
}
- print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{childTargets}->{parent}, fapi2::$id, ";
- print EIFILE "RC, fapi2::$collectRegisterFfdc->{childTargets}->{childType}, fapi2::TARGET_TYPE_NONE); ";
+ print EIFILE "fapi2::collectRegFfdc<fapi2::$collectRegisterFfdc->{childTargets}->{childType}, fapi2::TARGET_TYPE_NONE>";
+ print EIFILE "($collectRegisterFfdc->{childTargets}->{parent}, fapi2::$id, RC); ";
addFfdcMethod(\%methods, $collectRegisterFfdc->{childTargets}->{parent},
$err->{rc}, $target_ffdc_type);
}
@@ -641,8 +637,8 @@ foreach my $argnum (0 .. $#ARGV)
print ("parseErrorInfo.pl ERROR: childPosOffsetMultiplier missing from collectRegisterFfdc\n");
exit(1);
}
- print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{basedOnPresentChildren}->{target}, fapi2::$id, RC, ";
- print EIFILE "fapi2::TARGET_TYPE_NONE, fapi2::$collectRegisterFfdc->{basedOnPresentChildren}->{childType}, ";
+ print EIFILE "fapi2::collectRegFfdc<fapi2::$collectRegisterFfdc->{basedOnPresentChildren}->{childType}, fapi2::TARGET_TYPE_NONE>";
+ print EIFILE "($collectRegisterFfdc->{basedOnPresentChildren}->{target}, fapi2::$id, RC, ";
print EIFILE "$collectRegisterFfdc->{basedOnPresentChildren}->{childPosOffsetMultiplier}); ";
addFfdcMethod(\%methods, $collectRegisterFfdc->{basedOnPresentChildren}->{target},
$err->{rc}, $target_ffdc_type);
@@ -1251,6 +1247,7 @@ foreach my $argnum (0 .. $#ARGV)
#----------------------------------------------------------------------
print CRFILE " case $registerFfdc->{id}[0]:\n";
+# TODO: RTC 132226
=begin NEED_P9_REGISTERS
# Look for CFAM Register addresses
foreach my $cfamRegister (@{$registerFfdc->{cfamRegister}})
@@ -1281,16 +1278,17 @@ print CRFILE "i_ffdcId);\n";
print CRFILE " return;\n";
print CRFILE " }\n\n";
+# TODO: RTC 132226
=begin NEED_P9_REGISTERS
-
print CRFILE " uint8_t * l_pBuf = NULL;\n";
print CRFILE " uint8_t * l_pData = NULL;\n";
print CRFILE " std::vector<fapi::Target> l_targets;\n";
print CRFILE " uint32_t l_chipletPos32 = 0;\n";
+
#---------------------------------------------------------------------------------------------------------
# Populate chiplet vectors (if required by register collection method) and adjust buffer sizes accordingly
#---------------------------------------------------------------------------------------------------------
-print CRFILE " if (fapi2::TARGET_TYPE_NONE != i_child)\n";
+print CRFILE " if (C != TARGET_TYPE_NONE)\n";
print CRFILE " {\n";
print CRFILE " l_rc = fapiGetChildChiplets(i_target, i_child, l_targets, TARGET_STATE_FUNCTIONAL);\n";
print CRFILE " if (l_rc)\n";
@@ -1308,7 +1306,7 @@ print CRFILE " l_ffdcSize *= l_targets.size();\n";
print CRFILE " l_pBuf = new uint8_t[l_ffdcSize];\n";
print CRFILE " l_pData = l_pBuf;\n";
print CRFILE " }\n";
-print CRFILE " else if (fapi2::TARGET_TYPE_NONE != i_presChild)\n";
+print CRFILE " else if (P != TARGET_TYPE_NONE)\n";
print CRFILE " {\n";
print CRFILE " l_rc = fapiGetChildChiplets(i_target, i_presChild, l_targets, TARGET_STATE_PRESENT);\n";
print CRFILE " if (l_rc)\n";
@@ -1333,6 +1331,7 @@ print CRFILE " l_pBuf = new uint8_t[l_ffdcSize];\n";
print CRFILE " l_pData = l_pBuf;\n";
print CRFILE " l_targets.push_back(i_target);\n";
print CRFILE " }\n\n";
+
#---------------------------------------------------------------------------------------------------------
# Obtain target position and insert as the first word in the buffer
#---------------------------------------------------------------------------------------------------------
@@ -1428,11 +1427,12 @@ print CRFILE " }\n";
print CRFILE " }\n\n";
print CRFILE " o_rc.addEIFfdc(i_ffdcId, l_pBuf, l_ffdcSize);\n";
print CRFILE " delete [] l_pBuf;\n";
+
=cut NEED_P9_REGISTERS
print CRFILE "}\n";
print CRFILE "}\n";
-
+print CRFILE "#endif\n";
#------------------------------------------------------------------------------
# Print the fapiHwpReturnCodes.H file
OpenPOWER on IntegriCloud