Skip to content

Commit

Permalink
Pushing HB plugins and related files for building errltool
Browse files Browse the repository at this point in the history
Change-Id: I91d432a901fb4ee6de469ca8076637eaa2e1315d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/60027
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sampa Misra <sampmisr@in.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
venkateshsainath authored and dcrowell77 committed Nov 15, 2018
1 parent 208f80e commit 73cad1f
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/build/mkrules/dist.rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
# COPYRIGHT International Business Machines Corp. 2012,2014
# Contributors Listed Below - COPYRIGHT 2012,2018
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -206,7 +208,7 @@ $(foreach targ,$(COPY_FILES), \
define __COPY_RENAME_TARGET_RULE
$(TARGET_DIR)$(3)/$(1): $(ROOTPATH)/$(2) $(TESTVAR_CHANGED_FILE)
@mkdir -p $$(dir $$@)
@echo " CP-RENAME $$(notdir $$<) $$(notdir $$@)" && cp -r $$< $$@
@echo " CP-RENAME $$(notdir $$<) $$(notdir $$@)" && cp -Lr $$< $$@
endef
define COPY_RENAME_TARGET_RULE
$(call __COPY_RENAME_TARGET_RULE,$(1),$(2))
Expand Down Expand Up @@ -443,4 +445,3 @@ $(1)_TARGET_ECHO_START:

endef
$(foreach targ,$(VALID_TARGETS),$(eval $(call INSTANTIATE_TARGET,$(targ))))

47 changes: 44 additions & 3 deletions src/build/mkrules/dist.targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ROOTPATH = ../../..
#

# Content targets.
VALID_TARGETS = fsp tools openpower vpo
VALID_TARGETS = fsp tools openpower vpo errltool

#
# Files which are to be directly copied into content targets.
Expand Down Expand Up @@ -149,8 +149,49 @@ COPY_RENAME_FILES = \
securerom.list.bz2:img/securerom.list.bz2:tools,vpo,openpower \
securerom.bin.modinfo:img/securerom.bin.modinfo:tools,vpo,openpower \
$(foreach file, $(call ROOTPATH_WILDCARD,src/build/debug/Hostboot/*.pm), \
Hostboot/$(notdir $(file)):$(file):tools,vpo,openpower)

Hostboot/$(notdir $(file)):$(file):tools,vpo,openpower) \
$(foreach file, $(call ROOTPATH_WILDCARD,obj/genfiles/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
hbplugins/Makefile:obj/genfiles/plugins/Makefile:errltool \
hbplugins/prdf/Makefile:obj/genfiles/plugins/prdf/Makefile_errl:errltool \
$(foreach file, $(call ROOTPATH_WILDCARD,obj/genfiles/plugins/prdf/*.h), \
hbplugins/prdf/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,obj/genfiles/plugins/prdf/*.C), \
hbplugins/prdf/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,obj/genfiles/plugins/prdf/*.H), \
hbplugins/prdf/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/sbeio/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/initservice/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/mbox/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/secureboot/common/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/errl/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/fsi/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/vpd/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/i2c/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/runtime/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/isteps/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/usr/scom/plugins/*.*), \
hbplugins/$(notdir $(file)):$(file):errltool) \
$(foreach file, $(call ROOTPATH_WILDCARD,src/import/chips/p9/common/include/*.H), \
hbplugins/prdf/$(notdir $(file)):$(file):errltool) \
hwas/common/hwasCallout.H:src/include/usr/hwas/common/hwasCallout.H:errltool \
devicefw/driverif.H:src/include/usr/devicefw/driverif.H:errltool \
devicefw/userif.H:src/include/usr/devicefw/userif.H:errltool \
hbplugins/prdf/p9_pm_recovery_ffdc_defines.H:src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_defines.H:errltool \
hbplugins/prdf/p9_hcd_memmap_base.H:src/import/chips/p9/procedures/hwp/lib/p9_hcd_memmap_base.H:errltool \
hbplugins/prdf/p9_hcd_header_defs.H:src/import/chips/p9/procedures/hwp/lib/p9_hcd_header_defs.H:errltool \
hbplugins/prdf/p9_ppe_defs.H:src/import/chips/p9/procedures/hwp/lib/p9_ppe_defs.H:errltool

#
# Symbolic links created in the target.
#
Expand Down
8 changes: 7 additions & 1 deletion src/build/tools/hbDistribute
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ do
shift
;;

"--errltool")
TARGET="errltool_TARGET"
shift
;;

"--release")
TARGET="ALL"
shift
Expand Down Expand Up @@ -156,7 +161,8 @@ fi
echo "sbfw dir = ${SBFW_DIR}"
# Verify SBFW directory or default to sandbox.
if [ "${SBFW_DIR}" == "invalid directory" -a \
"${TARGET}" != "openpower_TARGET" ]; then
"${TARGET}" != "openpower_TARGET" -a \
"${TARGET}" != "errltool_TARGET" ]; then
if [ -z "${SANDBOXROOT}" -o -z "${SANDBOXNAME}" ]; then
echo "ERROR:SBFW - No path specified and \$SANDBOXBASE undefined."
print_usage
Expand Down
8 changes: 4 additions & 4 deletions src/include/usr/hwas/common/hwasCallout.H
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
/******************************************************************************/
// Includes
/******************************************************************************/
#ifndef PARSER
#if !defined(PARSER) && !defined(LOGPARSER)
#include <targeting/common/target.H>
#endif // not PARSER
#endif // not LOGPARSER

namespace HWAS
{
Expand Down Expand Up @@ -306,7 +306,7 @@ typedef struct callout_ud
} __attribute__ ((packed)) callout_ud_t;


#ifndef PARSER
#if !defined(PARSER) && !defined(LOGPARSER)

/* BUS callout Structure: This structure contains all the parameters needed for callout
// in platHandleAddBusCallout, Fields are:
Expand Down Expand Up @@ -480,7 +480,7 @@ errlHndl_t platHandleI2cDeviceCallout(
callOutPriority i_priority,
errlHndl_t &io_errl);

#endif // not PARSER
#endif // not LOGPARSER

}; // end namespace
#endif
7 changes: 7 additions & 0 deletions src/usr/diag/prdf/common/iipconst.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
/* Includes */
/*--------------------------------------------------------------------*/
#include <prdf_types.h>

#ifndef LOGPARSER
#include <targeting/common/attributes.H>
#endif

/*--------------------------------------------------------------------*/
/* User Types */
Expand All @@ -49,7 +52,11 @@

namespace PRDF
{
#ifndef LOGPARSER
typedef TARGETING::ATTR_HUID_type HUID;
#else
typedef uint32_t HUID;
#endif

// FIXME: RTC: 62867 will resolve this
enum { INVALID_HUID = 0 };
Expand Down
1 change: 1 addition & 0 deletions src/usr/diag/prdf/common/plugins/prdfProcLogParse.C
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <p9_quad_scom_addresses.H>
#include <p9_ppe_defs.H>
#include <map>
#include <vector>
#include <string>

namespace PRDF
Expand Down
60 changes: 60 additions & 0 deletions src/usr/diag/prdf/plugins/Makefile_errl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/diag/prdf/plugins/Makefile $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [+] International Business Machines Corp.
#
#
# 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
#
# 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.
#
# IBM_PROLOG_END_TAG
#
#

include ../../../rules.mk

CMDS = libhbprdfplugins.a

LDFLAGS += -static

CXXFLAGS += -DPRDF_HOSTBOOT_ERRL_PLUGIN -D__HOSTBOOT_MODULE -DLOGPARSER -DPRDPARSER -I. -I../.. -I../../targeting -I../../../include -I../../../include/util -I../../../include/extras -I../../../include/genfiles

PRDF_PLUGIN_OBJS = prdfBitString.o prdrErrlPluginsSupt.o p9_capp.prf.err.o \
p9_eq.prf.err.o p9_mca.prf.err.o p9_mcs.prf.err.o \
p9_obus.prf.err.o p9_phb.prf.err.o prdfLogParse.o \
p9_capp.prf.reg.o p9_eq.prf.reg.o p9_mca.prf.reg.o \
p9_mcs.prf.reg.o p9_obus.prf.reg.o p9_phb.prf.reg.o \
prdfLogParse_common.o prdfMemLogParse.o p9_ec.prf.err.o \
p9_ex.prf.err.o p9_mcbist.prf.err.o p9_nimbus.prf.err.o \
p9_pec.prf.err.o p9_xbus.prf.err.o prdfParserUtils.o \
p9_ec.prf.reg.o p9_ex.prf.reg.o p9_mcbist.prf.reg.o \
p9_nimbus.prf.reg.o p9_pec.prf.reg.o p9_xbus.prf.reg.o prdfProcLogParse.o


all: $(CMDS)

libhbprdfplugins.a: $(PRDF_PLUGIN_OBJS)
@echo "LD $(WORK_DIR)/$@"
ar rvs $@ $(PRDF_PLUGIN_OBJS)

$(PRDF_PLUGIN_OBJS):%.o: %.C
@echo "$(CC) $(CXXFLAGS) $(WORK_DIR)/$@"
@$(CC) $(CXXFLAGS) -c $<

clean:
@echo "Cleaning up $(WORK_DIR) files..."
@rm -rf $(CMDS) $(PRDF_PLUGIN_OBJS)
55 changes: 54 additions & 1 deletion src/usr/errl/parser/genErrlParsers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,59 @@ sub print_term_rc
$compValToUdFilesHash{$compVal} = $ofiles;
}

#------------------------------------------------------------------------------
# Generate the makefile that builds the Hostboot error log parsers for errltool
#------------------------------------------------------------------------------
$outputFileName = $outputDir . "/Makefile";
open(OFILE, ">", $outputFileName) or die("Cannot open: $outputFileName: $!");

print OFILE "\# Automatically generated by Hostboot's $0\n";
print OFILE "\# Do not modify this file in the errltool tree, it is provided by\n";
print OFILE "\# Hostboot and will be overwritten\n";
print OFILE "\#\n";

print OFILE "CXXFLAGS += -D__HOSTBOOT_MODULE -DLOGPARSER \n\n";
print OFILE "CXXFLAGS += -I. -I../ -I../targeting -I../../include -I../../include/util -I../../include/extras -I../../include/genfiles\n\n";

print OFILE "LDFLAGS += -static\n\n";

print OFILE "\#-------------------------------------------------------------\n";
print OFILE "\# Call PRD makefile for prdf plugins\n";
print OFILE "\#-------------------------------------------------------------\n";
print OFILE "SUBDIRS = prdf\n\n";

print OFILE "CMDS = libhbplugins.a\n\n";

print OFILE "\#-------------------------------------------------------------\n";
print OFILE "\# SRC Parsers\n";
print OFILE "\#-------------------------------------------------------------\n";

print OFILE "HB_PLUGIN_SRC_OBJS = ";
foreach my $compValue (keys %compValueToParseHash)
{
print OFILE "\\\n";
print OFILE " hbfwSrcParse$compValue.o ";
}

print OFILE "\n\n";
print OFILE "all: \$(CMDS)\n";
print OFILE "\t\@\$(MAKE) -C prdf\n\n";
print OFILE "libhbplugins.a: \$(HB_PLUGIN_SRC_OBJS)\n";
print OFILE "\t\@echo \"LD \$(WORK_DIR)/\$\@\"\n";
print OFILE "\tar rvs \$\@ \$(HB_PLUGIN_SRC_OBJS)\n\n";

print OFILE "\$(HB_PLUGIN_SRC_OBJS):%.o: %.C\n";
print OFILE "\t\@echo \"\$(CC) \$(CXXFLAGS) \$(WORK_DIR)/\$\@\"\n";
print OFILE "\t\$(CC) \$(CXXFLAGS) -c \$<\n\n";

print OFILE "clean:\n";
print OFILE "\t\@echo \"Cleaning up \$(WORK_DIR) files...\"\n";
print OFILE "\trm -rf \$(CMDS) \$(HB_PLUGIN_SRC_OBJS)\n";
print OFILE "\t\@\$(foreach d,\$(SUBDIRS), \$(MAKE) -C \$d clean;)\n\n";

print OFILE "\n\ninclude ../../rules.mk\n";

close(OFILE);
#------------------------------------------------------------------------------
# Generate the FSP makefile that builds the Hostboot error log parsers
#------------------------------------------------------------------------------
Expand All @@ -989,7 +1042,7 @@ sub print_term_rc
print OFILE "\# Hostboot and will be overwritten\n";
print OFILE "\#\n";

print OFILE "CFLAGS += -DPARSER\n\n";
print OFILE "CFLAGS += -DPARSER \n\n";
print OFILE "EXPLIBS =\n\n";

print OFILE "\#-------------------------------------------------------------\n";
Expand Down
6 changes: 5 additions & 1 deletion src/usr/errl/plugins/errludparser.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
Expand Down Expand Up @@ -33,6 +35,7 @@

#include <netinet/in.h>

#ifndef LOGPARSER
/**
* @brief Endian swap a uint64_t. This is not provided by in.h
*/
Expand All @@ -57,6 +60,7 @@ inline uint64_t ntohll( uint64_t i )
#else
#error Unexpected endian context.
#endif
#endif

// FSP includes
#include <errlplugins.H>
Expand Down
3 changes: 2 additions & 1 deletion src/usr/errl/plugins/errludsensor.H
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
*/

#include "errluserdetails.H"
#ifndef LOGPARSER
#include <targeting/common/target.H>

#endif
namespace ERRORLOG
{

Expand Down
3 changes: 2 additions & 1 deletion src/usr/errl/plugins/errludstate.H
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
*/

#include "errluserdetails.H"
#ifndef LOGPARSER
#include <targeting/common/target.H>

#endif
namespace ERRORLOG
{

Expand Down
4 changes: 2 additions & 2 deletions src/usr/fapi2/platCreateHwpErrParser.pl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
print TGFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n";
print TGFILE "#ifndef HBFWPLATHWPERRPARSER_H_\n";
print TGFILE "#define HBFWPLATHWPERRPARSER_H_\n\n";
print TGFILE "#ifdef PARSER\n\n";
print TGFILE "#if defined(PARSER) || defined(LOGPARSER)\n\n";
print TGFILE "namespace fapi2\n";
print TGFILE "{\n\n";
print TGFILE "void hbfwParseHwpRc(ErrlUsrParser & i_parser,\n";
Expand Down Expand Up @@ -207,7 +207,7 @@
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 "#if defined(PARSER) || defined(LOGPARSER)\n\n";
print TGFILE "#include <netinet/in.h>\n\n";
print TGFILE "namespace fapi2\n";
print TGFILE "{\n\n";
Expand Down

0 comments on commit 73cad1f

Please sign in to comment.