summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2
diff options
context:
space:
mode:
authorMatt Derksen <v2cibmd@us.ibm.com>2016-07-21 15:04:02 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-08-02 17:40:56 -0400
commit40247b31479f4c3d784e1a15a2b1b2b2375fb1df (patch)
tree8059ff885462bdb2dbbeea767906ee62286057c1 /src/usr/fapi2
parent5320654ff092cedeac94b65cfd70b88de72807ec (diff)
downloadtalos-hostboot-40247b31479f4c3d784e1a15a2b1b2b2375fb1df.tar.gz
talos-hostboot-40247b31479f4c3d784e1a15a2b1b2b2375fb1df.zip
Parse HWP errors
Change-Id: I2c12557c60cb903d8ab0e79d31074c2d249fd846 RTC:151336 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27340 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rwxr-xr-xsrc/usr/fapi2/fapi2.mk12
-rwxr-xr-xsrc/usr/fapi2/platCreateHwpErrParser.pl56
-rw-r--r--src/usr/fapi2/plat_utils.C2
3 files changed, 55 insertions, 15 deletions
diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk
index 89f00e9c7..a94852a06 100755
--- a/src/usr/fapi2/fapi2.mk
+++ b/src/usr/fapi2/fapi2.mk
@@ -103,11 +103,17 @@ FAPI2_PLAT_INCLUDE += $(addsuffix /common/include, \
#------------------------------------------------------------------------------
# The PLAT HWP RC and FFDC parser file generated from Error XML files
#------------------------------------------------------------------------------
-PLAT_HWP_ERR_PARSER = platHwpErrParser.H
+PLAT_HWP_ERR_PARSER_TARGET = hbfwPlatHwpErrParser.H
+PLAT_HWP_ERR_PARSER_FFDC_TARGET = hbfwPlatHwpErrParserFFDC.H
+
GENDIR_PLUGINS = $(ROOTPATH)/obj/genfiles/plugins
GENPLUGINTARGET = $(addprefix $(GENDIR_PLUGINS)/, $(1))
-GENFILES_PLUGINS = ${PLAT_HWP_ERR_PARSER}
-$(call GENPLUGINTARGET, ${PLAT_HWP_ERR_PARSER}) : \
+GENFILES_PLUGINS = ${PLAT_HWP_ERR_PARSER_TARGET}
+GENFILES_PLUGINS += ${PLAT_HWP_ERR_PARSER_FFDC_TARGET}
+
+
+$(call GENPLUGINTARGET, ${PLAT_HWP_ERR_PARSER_TARGET}) \
+$(call GENPLUGINTARGET, ${PLAT_HWP_ERR_PARSER_FFDC_TARGET}) : \
$(ROOTPATH)/src/usr/fapi2/platCreateHwpErrParser.pl ${FAPI2_ERROR_XML}
$< $(dir $@) ${FAPI2_ERROR_XML}
diff --git a/src/usr/fapi2/platCreateHwpErrParser.pl b/src/usr/fapi2/platCreateHwpErrParser.pl
index ec002ac59..62ea13a5b 100755
--- a/src/usr/fapi2/platCreateHwpErrParser.pl
+++ b/src/usr/fapi2/platCreateHwpErrParser.pl
@@ -42,7 +42,7 @@ if ($numArgs < 2)
{
print ("Usage: platCreateHwpErrParser.pl <output dir> <filename1> <filename2> ...\n");
print (" This perl script will parse HWP Error XML files and create\n");
- print (" a file called fapiPlatHwpErrParser.H that contains functions to\n");
+ print (" two files hbfwPlatHwpErrParser.H and hbfwPlatHwpErrParserFFDC.H that\n");
print (" parse the return code and FFDC data in HWP error logs\n");
exit(1);
}
@@ -62,24 +62,24 @@ my $xml = new XML::Simple (KeyAttr=>[]);
#------------------------------------------------------------------------------
my $rcFile = $ARGV[0];
$rcFile .= "/";
-$rcFile .= "platHwpErrParser.H";
+$rcFile .= "hbfwPlatHwpErrParser.H";
open(TGFILE, ">", $rcFile);
#------------------------------------------------------------------------------
# Print start of file information
#------------------------------------------------------------------------------
-print TGFILE "// platHwpErrParser.H\n";
+print TGFILE "// hbfwPlatHwpErrParser.H\n";
print TGFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n";
-print TGFILE "#ifndef PLATHWPERRPARSER_H_\n";
-print TGFILE "#define PLATHWPERRPARSER_H_\n\n";
+print TGFILE "#ifndef HBFWPLATHWPERRPARSER_H_\n";
+print TGFILE "#define HBFWPLATHWPERRPARSER_H_\n\n";
print TGFILE "#ifdef PARSER\n\n";
print TGFILE "namespace fapi2\n";
print TGFILE "{\n\n";
-print TGFILE "void parseHwpRc(ErrlUsrParser & i_parser,\n";
+print TGFILE "void hbfwParseHwpRc(ErrlUsrParser & i_parser,\n";
print TGFILE " void * i_pBuffer,\n";
print TGFILE " const uint32_t i_buflen)\n";
print TGFILE "{\n";
-print TGFILE " uint32_t l_rc = ntohll(*(static_cast<uint32_t *>(i_pBuffer)));\n";
+print TGFILE " uint32_t l_rc = ntohl(*(static_cast<uint32_t *>(i_pBuffer)));\n";
print TGFILE " switch(l_rc)\n";
print TGFILE " {\n";
@@ -133,15 +133,49 @@ foreach my $argnum (1 .. $#ARGV)
#------------------------------------------------------------------------------
print TGFILE " default:\n";
print TGFILE " i_parser.PrintNumber(\"Unrecognized Error ID\", \"0x%x\", l_rc);\n";
+print TGFILE " if (i_buflen) {i_parser.PrintHexDump(i_pBuffer, i_buflen);}\n";
print TGFILE " }\n";
print TGFILE "}\n\n";
#------------------------------------------------------------------------------
-# Print start of fapiParseHwpFfdc function
+# Print end of file info
+#------------------------------------------------------------------------------
+print TGFILE "}\n\n";
+print TGFILE "#endif\n";
+print TGFILE "#endif\n";
+
+#------------------------------------------------------------------------------
+# Close output file
+#------------------------------------------------------------------------------
+close(TGFILE);
+
+
+#------------------------------------------------------------------------------
+# Open output files for writing
+#------------------------------------------------------------------------------
+my $rcFile = $ARGV[0];
+$rcFile .= "/";
+$rcFile .= "hbfwPlatHwpErrParserFFDC.H";
+open(TGFILE, ">", $rcFile);
+
+#------------------------------------------------------------------------------
+# Print start of file information
+#------------------------------------------------------------------------------
+print TGFILE "// hbfwPlatHwpErrParserFFDC.H\n";
+print TGFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n";
+print TGFILE "#ifndef HBFWPLATHWPERRPARSERFFDC_H_\n";
+print TGFILE "#define HBFWPLATHWPERRPARSERFFDC_H_\n\n";
+print TGFILE "#ifdef PARSER\n\n";
+print TGFILE "#include <netinet/in.h>\n\n";
+print TGFILE "namespace fapi2\n";
+print TGFILE "{\n\n";
+
+#------------------------------------------------------------------------------
+# Print start of hbfwParseHwpFfdc function
#------------------------------------------------------------------------------
-print TGFILE "void parseHwpFfdc(ErrlUsrParser & i_parser,\n";
-print TGFILE " void * i_pBuffer,\n";
-print TGFILE " const uint32_t i_buflen)\n";
+print TGFILE "void hbfwParseHwpFfdc(ErrlUsrParser & i_parser,\n";
+print TGFILE " void * i_pBuffer,\n";
+print TGFILE " const uint32_t i_buflen)\n";
print TGFILE "{\n";
print TGFILE " const uint32_t CFAM_DATA_LEN = 4;\n";
print TGFILE " const uint32_t SCOM_DATA_LEN = 8;\n";
diff --git a/src/usr/fapi2/plat_utils.C b/src/usr/fapi2/plat_utils.C
index c9f0a1d93..596e139df 100644
--- a/src/usr/fapi2/plat_utils.C
+++ b/src/usr/fapi2/plat_utils.C
@@ -809,7 +809,7 @@ errlHndl_t rcToErrl(ReturnCode & io_rc,
if (io_rc)
{
- uint64_t l_rcValue = io_rc;
+ uint32_t l_rcValue = io_rc;
// ReturnCode contains an error. Find out which component of the HWPF
// created the error
OpenPOWER on IntegriCloud