From aeab2730d48435cada4a3c30a0552f33cfdaa96c Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 5 Nov 2015 07:27:29 -0500 Subject: Revert "FAPI cleanup in PPE" This reverts commit b267f6014899a92bdde19d4034c6c4d992d828ea. Reverting on Santosh's request, because this patch needs follow-up patches, which can not be merged promptly, in order not to break SBE tests. Change-Id: Ieaee095b76925b10b99deb6ac61be25d5b79ea4a Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21771 Tested-by: Jenkins Server Reviewed-by: Santosh S. Puranik Reviewed-by: Martin Peschke --- tools/image/Makefile | 13 +++--- tools/scripts/parseErrorInfo.pl | 88 ++++++++++++++++++++--------------------- 2 files changed, 51 insertions(+), 50 deletions(-) (limited to 'tools') diff --git a/tools/image/Makefile b/tools/image/Makefile index 9a015590..c9229c2d 100644 --- a/tools/image/Makefile +++ b/tools/image/Makefile @@ -5,7 +5,7 @@ # Make targets: -# all : +# all : # # utilities : Build utility programs and procedures # @@ -21,7 +21,7 @@ CTEPATH = /afs/awd/projects/cte endif # Locations of required headers. -INCLUDES += -I. -I../../ -I../../utils +INCLUDES += -I. -I../../ -I../../utils INCLUDES += -I ../../sbe/image/ INCLUDES += -I ../../sbe/sbefw/ INCLUDES += -I ../../sbe/hwpf/include/plat @@ -33,7 +33,8 @@ INCLUDES += -I ../../pk/kernel/ INCLUDES += -I ../../pk/std/ INCLUDES += -I ../../pk/trace/ INCLUDES += -I ../../tools/ppetracepp/ -INCLUDES += -I ../../import/hwpf/fapi2/include/ +INCLUDES += -I ../../importtemp/fapi2/include/plat +INCLUDES += -I ../../importtemp/fapi2/include/ # Under Linux the scheme is to use a common compiler to create procedures. # However, the common compiler can be VERY slow, so if the system compiler is @@ -57,7 +58,7 @@ CC = gcc CXX = g++ endif -#UTILITIES-SOURCES += ../../sbe/image/sbe_xip_image.c +#UTILITIES-SOURCES += ../../sbe/image/sbe_xip_image.c UTILITIES-SOURCES = sbe_xip_tool.c sbe_default_tool.c UTILITIES = sbe_xip_tool sbe_default_tool @@ -73,7 +74,7 @@ UTILITIES-EXECUTABLES = $(patsubst %,bin/%,$(UTILITIES)) utilities: buildBinDir $(UTILITIES-EXECUTABLES) buildBinDir: - mkdir -p bin + mkdir -p bin bin/%.o: %.c $(CXX) -std=c++11 $(INCLUDES) $(CXXFLAGS) -DDEBUG_SBE_XIP_IMAGE=1 -DFAPI2_NO_FFDC -c -o $@ $< @@ -85,7 +86,7 @@ bin/sbe_xip_tool: bin/sbe_xip_image.o bin/p9_ring_identification.o bin/sbe_xip_t $(CXX) $(CXXFLAGS) ${INCLUDES} -o $@ $^ ln -sf bin/sbe_xip_tool sbe_xip_tool -bin/sbe_default_tool: bin/sbe_xip_image.o bin/sbe_default_tool.o +bin/sbe_default_tool: bin/sbe_xip_image.o bin/sbe_default_tool.o $(CXX) $(CXXFLAGS) ${INCLUDES} -o $@ $^ ln -sf bin/sbe_default_tool sbe_default_tool diff --git a/tools/scripts/parseErrorInfo.pl b/tools/scripts/parseErrorInfo.pl index e192f180..61b6c96d 100755 --- a/tools/scripts/parseErrorInfo.pl +++ b/tools/scripts/parseErrorInfo.pl @@ -2,34 +2,36 @@ # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # -# $Source: hwpf/fapi2/tools/parseErrorInfo.pl $ +# $Source: src/usr/hwpf/fapi/fapiParseErrorInfo.pl $ # -# IBM CONFIDENTIAL +# OpenPOWER HostBoot Project # -# EKB Project -# -# COPYRIGHT 2015 +# Contributors Listed Below - COPYRIGHT 2011,2014 # [+] International Business Machines Corp. # # -# 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. +# 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 # -# IBM_PROLOG_END_TAG +# 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. # -# @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. +# 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. # -# *HWP HWP Owner: N/A -# *HWP FW Owner: Thi Tran -# *HWP Team: N/A -# *HWP Level: 1 -# *HWP Consumed by: HB +# Author: CamVan Nguyen and Mike Jones +# Reworked for fapi2/P9 # # Usage: -# parseErrorInfo.pl ... +# fapiParseErrorInfo.pl ... use strict; @@ -100,7 +102,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.H. Function to collect register FFDC\n"); + print (" - collect_reg_ffdc.C. 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); @@ -350,7 +352,7 @@ open(ECFILE, ">", $ecFile); my $crFile = $arg_output_dir; $crFile .= "/"; -$crFile .= "collect_reg_ffdc.H"; +$crFile .= "collect_reg_ffdc.C"; open(CRFILE, ">", $crFile); my $sbFile = $arg_output_dir; @@ -394,29 +396,28 @@ print ECFILE " *\/\n"; print ECFILE "namespace fapi2\n{\n"; #------------------------------------------------------------------------------ -# Print start of file information to collectRegFfdc.H +# Print start of file information to collectRegFfdc.C #------------------------------------------------------------------------------ -print CRFILE "// collect_reg_ffdc.H\n"; +print CRFILE "// collect_reg_ffdc.C\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 \n"; print CRFILE "#include \n"; -print CRFILE "#include \n"; -print CRFILE "#include \n"; -print CRFILE "#include \n"; + print CRFILE "#include \n"; +print CRFILE "#include \n"; print CRFILE "#include \n"; print CRFILE "#include \n"; print CRFILE "#include \n"; -print CRFILE "#include \n"; +print CRFILE "#include \n\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 " uint32_t i_childOffsetMult = 0)\n"; +print CRFILE " const TargetType i_child,\n"; +print CRFILE " const TargetType i_presChild,\n"; +print CRFILE " uint32_t i_childOffsetMult)\n"; print CRFILE "{\n"; print CRFILE " FAPI_INF(\"collectRegFfdc. FFDC ID: 0x%x\", i_ffdcId);\n"; print CRFILE " fapi2::ReturnCode l_rc;\n"; @@ -434,6 +435,8 @@ print CRFILE " static_cast(l_scomData);\n"; print CRFILE " static_cast(l_ffdcSize);\n"; print CRFILE " static_cast(i_target);\n"; print CRFILE " static_cast(o_rc);\n"; +print CRFILE " static_cast(i_child);\n"; +print CRFILE " static_cast(i_presChild);\n"; print CRFILE " static_cast(i_childOffsetMult);\n"; #------------------------------------------------------------------------------ # Print start of file information to setSbeError.H @@ -547,6 +550,7 @@ 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) @@ -598,8 +602,8 @@ foreach my $argnum (0 .. $#ARGV) #--------------------------------------------------------------------------------- if (exists $collectRegisterFfdc->{target}) { - print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{target}, "; - print EIFILE "fapi2::$id, RC); "; + print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{target}, "; + print EIFILE "fapi2::$id, RC, fapi2::TARGET_TYPE_NONE, fapi2::TARGET_TYPE_NONE); "; addFfdcMethod(\%methods, $collectRegisterFfdc->{target}, $err->{rc}, $target_ffdc_type); } @@ -615,8 +619,8 @@ foreach my $argnum (0 .. $#ARGV) print ("parseErrorInfo.pl ERROR: childType missing from collectRegisterFfdc\n"); exit(1); } - print EIFILE "fapi2::collectRegFfdc{childTargets}->{childType}, fapi2::TARGET_TYPE_NONE>"; - print EIFILE "($collectRegisterFfdc->{childTargets}->{parent}, fapi2::$id, RC); "; + print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{childTargets}->{parent}, fapi2::$id, "; + print EIFILE "RC, fapi2::$collectRegisterFfdc->{childTargets}->{childType}, fapi2::TARGET_TYPE_NONE); "; addFfdcMethod(\%methods, $collectRegisterFfdc->{childTargets}->{parent}, $err->{rc}, $target_ffdc_type); } @@ -637,8 +641,8 @@ foreach my $argnum (0 .. $#ARGV) print ("parseErrorInfo.pl ERROR: childPosOffsetMultiplier missing from collectRegisterFfdc\n"); exit(1); } - print EIFILE "fapi2::collectRegFfdc{basedOnPresentChildren}->{childType}, fapi2::TARGET_TYPE_NONE>"; - print EIFILE "($collectRegisterFfdc->{basedOnPresentChildren}->{target}, fapi2::$id, RC, "; + print EIFILE "fapi2::collectRegFfdc($collectRegisterFfdc->{basedOnPresentChildren}->{target}, fapi2::$id, RC, "; + print EIFILE "fapi2::TARGET_TYPE_NONE, fapi2::$collectRegisterFfdc->{basedOnPresentChildren}->{childType}, "; print EIFILE "$collectRegisterFfdc->{basedOnPresentChildren}->{childPosOffsetMultiplier}); "; addFfdcMethod(\%methods, $collectRegisterFfdc->{basedOnPresentChildren}->{target}, $err->{rc}, $target_ffdc_type); @@ -1247,7 +1251,6 @@ 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}}) @@ -1278,17 +1281,16 @@ 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 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 (C != TARGET_TYPE_NONE)\n"; +print CRFILE " if (fapi2::TARGET_TYPE_NONE != i_child)\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"; @@ -1306,7 +1308,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 (P != TARGET_TYPE_NONE)\n"; +print CRFILE " else if (fapi2::TARGET_TYPE_NONE != i_presChild)\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"; @@ -1331,7 +1333,6 @@ 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 #--------------------------------------------------------------------------------------------------------- @@ -1427,12 +1428,11 @@ 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 -- cgit v1.2.1