From 1bfd1c30b8c3ddd6db9491a638d4d9e55d72c1fb Mon Sep 17 00:00:00 2001 From: Santosh Puranik Date: Wed, 4 Nov 2015 06:16:22 -0600 Subject: 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 Reviewed-by: Martin Peschke --- tools/image/Makefile | 13 +++--- tools/scripts/parseErrorInfo.pl | 88 ++++++++++++++++++++--------------------- 2 files changed, 50 insertions(+), 51 deletions(-) (limited to 'tools') diff --git a/tools/image/Makefile b/tools/image/Makefile index c9229c2d..9a015590 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,8 +33,7 @@ INCLUDES += -I ../../pk/kernel/ INCLUDES += -I ../../pk/std/ INCLUDES += -I ../../pk/trace/ INCLUDES += -I ../../tools/ppetracepp/ -INCLUDES += -I ../../importtemp/fapi2/include/plat -INCLUDES += -I ../../importtemp/fapi2/include/ +INCLUDES += -I ../../import/hwpf/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 @@ -58,7 +57,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 @@ -74,7 +73,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 $@ $< @@ -86,7 +85,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 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 +# *HWP Team: N/A +# *HWP Level: 1 +# *HWP Consumed by: HB # # Usage: -# fapiParseErrorInfo.pl ... +# parseErrorInfo.pl ... 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 \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 "#include \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(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 @@ -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($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{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{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 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 -- cgit v1.2.1