diff options
author | Chris Phan <cphan@us.ibm.com> | 2012-03-20 14:00:18 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-04-19 11:11:05 -0500 |
commit | 1b0a35720413defe69a4944331d937284ba7e755 (patch) | |
tree | 3ca7a41e95a66b08943c419ff6ab844e718d865a | |
parent | 22a489a13ad5fde3d584b3c770178c9018a21e4f (diff) | |
download | talos-hostboot-1b0a35720413defe69a4944331d937284ba7e755.tar.gz talos-hostboot-1b0a35720413defe69a4944331d937284ba7e755.zip |
Initial PRD code structure in Hostboot
- RTC: 37733
- Add HUID debug trace and update from review comments
Change-Id: I3894c1daa1fae4c307816ad3fab4014a38fca786
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/776
Tested-by: Jenkins Server
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-x | src/include/usr/diag/prdf/prdf_proto.H | 199 | ||||
-rwxr-xr-x | src/include/usr/diag/prdf/prdf_service_codes.H | 119 | ||||
-rw-r--r-- | src/include/usr/hbotcompid.H | 9 | ||||
-rw-r--r-- | src/makefile | 8 | ||||
-rw-r--r-- | src/usr/diag/makefile | 2 | ||||
-rwxr-xr-x | src/usr/diag/prdf/iipconst.h | 88 | ||||
-rwxr-xr-x | src/usr/diag/prdf/iipglobl.h | 58 | ||||
-rwxr-xr-x | src/usr/diag/prdf/makefile | 65 | ||||
-rwxr-xr-x | src/usr/diag/prdf/prd_framework.mk | 30 | ||||
-rwxr-xr-x | src/usr/diag/prdf/prdfTrace.C | 39 | ||||
-rwxr-xr-x | src/usr/diag/prdf/prdfTrace.H | 84 | ||||
-rwxr-xr-x | src/usr/diag/prdf/prdf_main.C | 154 | ||||
-rwxr-xr-x | src/usr/diag/prdf/prdf_types.h | 40 | ||||
-rw-r--r-- | src/usr/diag/prdf/test/makefile | 37 | ||||
-rw-r--r-- | src/usr/diag/prdf/test/prdfTest.H | 137 | ||||
-rw-r--r-- | src/usr/initservice/extinitsvc/extinitsvctasks.H | 12 |
16 files changed, 1076 insertions, 5 deletions
diff --git a/src/include/usr/diag/prdf/prdf_proto.H b/src/include/usr/diag/prdf/prdf_proto.H new file mode 100755 index 000000000..4a4d0a267 --- /dev/null +++ b/src/include/usr/diag/prdf/prdf_proto.H @@ -0,0 +1,199 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/diag/prdf/prdf_proto.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + + +#ifndef PRDF_PROTO_H +#define PRDF_PROTO_H + +/** + * @file prdf_proto.H + * @brief Interface to Processor Run-time Diagnostics (PRD) + * @par + * This includes all type definitions, function interfaces/contracts and + * return codes for PRD. + * These prototypes specify the functions that can be called externally + * from other binds. + */ + + +#include <stdint.h> +#include <errlentry.H> +#include <target.H> + +namespace PRDF +{ + +// Move here from iipsdbug.h +/** + * @brief Enum specifying attention type + */ +enum ATTENTION_VALUE_TYPE +{ + INVALID_ATTENTION_TYPE = 0, + MACHINE_CHECK = 1, + CHECK_STOP = MACHINE_CHECK, + UNIT_CS = 2, + PROC_CS = UNIT_CS, + RECOVERABLE = 3, + SPECIAL = 4, + END_ATTENTION_TYPE = 5 +}; + +// Move here from xspprdsdbug.C +/** + * @brief Structure of target handle and its attention type + */ +struct AttnData +{ + TARGETING::TargetHandle_t targetHndl; + ATTENTION_VALUE_TYPE attnType; +}; + +typedef std::vector<AttnData> AttnList; + + +/** + * @brief Enum specifying all possible PRD returned code + */ +enum prd_return_code_t +{ + //! DD00: An assert statement failed in PRD + PRD_ASSERT = 0xDD00, + + //! DD01: An attention of this type is not expected + PRD_INVALID_ATTENTION_TYPE = 0xDD01, + + /*! DD02: A Scan Comm Register Read indicates no bits are set in the SCR + where active bits were expected */ + PRD_SCAN_COMM_REGISTER_ZERO = 0xDD02, + + /*! DD03: Attempted to cross a chip connection but could not resolve target + * chip */ + PRD_UNRESOLVED_CHIP_CONNECTION = 0xDD03, + + //! DD05: Error is internal to PRD code + PRD_INTERNAL_CODE_ERROR = 0xDD05, + + //! DD09: Failure accessing attention data from Registry + PRD_ATTN_DATA_ACCESS_FAILED = 0xDD09, + + //! DD11: SRC ACCESS FAILED + SCR_ACCESS_FAILED = 0xDD11, + + //! DD12: HOM ACCESS FAILED + HOM_ACCESS_FAILED = 0xDD12, + + //! DD20: System Analyze() is called with no domains in System (init failed?) + NO_DOMAINS_IN_SYSTEM = 0xDD20, + + //! DD21: System Analyze() is called, but no domains in the system are at attention + NO_DOMAINS_AT_ATTENTION = 0xDD21, + + //! DD23: PRD did not perform an analysis - Unknown chip raised attention + NO_PRD_ANALYSIS = 0xDD23, + + //! DD24: prdMain() called before prdInitialize() + PRD_NOT_INITIALIZED = 0xDD24, + + //! DD28: PrdStartScrub failure + PRD_RBS_START_SCRUB_ERROR = 0xDD28, + + //! DD29: PrdResoreRbs failure + PRD_RBS_RESTORE_ERROR = 0xDD29, + + //! DD81: Multiple bits on in Error Register + PRD_MULTIPLE_ERRORS = 0xDD81, + + //! DD90: Scan comm access from Error Register failed + PRD_SCANCOM_FAILURE = 0xDD90, + + //! DD91: Scan comm access from Error Register failed due to Power Fault + PRD_POWER_FAULT = 0xDD91, + + //! DDFF: Special return code indicating Not to reset or mask FIR bits. + PRD_NO_CLEAR_FIR_BITS = 0xDDFF, + + //! 7FFD: word13 of src 7FFDxxxx - An assert failed in PRD + PRD_ASSERT_ERROR_SIGNATURE = 0x7FFD, + + //! 7FFF: word13 of src 7FFFxxxx - xxxx will describe the error + PRD_EXECUTION_ERROR_SIGNATURE = 0x7FFF + +}; + + +/** + * @brief Initialize PRD system model and data + * @return - Error log if error occurs + */ +extern errlHndl_t PrdInitialize(); + +/** + * @brief analyze attention errors + * @param[in] i_attnType - global attention type + * @param[in] i_attnList - list of chips at attention + * @return - Error log if error occurs + * + * @note If the i_attnType is CHECK_STOP than an error log is returned + * containing the analysis; otherwise, for other attention types, PRD + * commits the error log itself and NULL is returned. + */ +extern errlHndl_t PrdMain(ATTENTION_VALUE_TYPE i_attnType, const AttnList & i_attnList); + +/** + * @brief initiate memory background scrubbing + * @param[in] i_pTarget - Target handle of System or Node + * @return - Error log if error occurs + */ +extern errlHndl_t PrdStartScrub(const TARGETING::TargetHandle_t i_pTarget); + +/** + * @brief Restores hardware DRAM repairs to reflect what is stored in VPD. + * @param[in] i_pTarget - Target handle of the memory controller + * @return Non-SUCCESS if conditions are such that a callout had to be made, SUCCESS othewise. + */ +extern int32_t prdfRestoreDramRepairs(const TARGETING::TargetHandle_t i_pTarget); + + +/** + * @brief Clean up pieces of PRD for fresh IPLs. + * + * Cleans up the PRD persistent storage areas in P1. + */ +extern void PrdIplCleanup(); + + +#ifndef __HOSTBOOT_MODULE + +/** + * @brief handle service data collector sync over + * @return - Error log if error occurs + */ +extern errlHndl_t prdfFailoverComplete(void); + +#endif + + +} // End namespace PRDF + +#endif // PRDF_PROTO_H diff --git a/src/include/usr/diag/prdf/prdf_service_codes.H b/src/include/usr/diag/prdf/prdf_service_codes.H new file mode 100755 index 000000000..0ac17a978 --- /dev/null +++ b/src/include/usr/diag/prdf/prdf_service_codes.H @@ -0,0 +1,119 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/diag/prdf/prdf_service_codes.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + + +/** + @file prdf_service_codes.H + @brief File contains file IDs and reason codes +*/ + +// NOTE: the change log is at the bottom of the file + +#ifndef prdf_services_codes_H +#define prdf_services_codes_H + +#ifdef __HOSTBOOT_MODULE + +#include <hbotcompid.H> +#define PRDF_COMP_ID HBPRDF_COMP_ID //FIXME: will need to make a change in hbotcompid.H later +#define PRDF_COMP_NAME HBPRDF_COMP_NAME //FIXME + +#else + +#include <fips_comp_id.H> + +#endif + +/** + * @brief Enum specifying File IDs + */ +enum +{ + PRDF_FILE_ID = (PRDF_COMP_ID << 16) | 0x0001 +}; + + +/** + * @brief Enum specifying "Module ids" for prdf CODE_FAIL SRCs. + * Each module Id corresponds to a particular + * method in a class or an individual function. + */ +enum prdfModId +{ + PRDF_MAIN = 0x01, + PRDF_HOM_HOM_TYPE = 0x02, + PRDF_HOM_SCOM = 0x03, + PRDF_HOM_SCAN = 0x04, + PRDF_SDBUG_INIT = 0x05, + PRDF_PRDRLOADCHIP = 0x06, + PRDF_PRDFRULECHIP = 0x07, + PRDF_EXTENSIBLEDOMAIN = 0x08, + PRDF_ERRLSMARTPTR = 0x09, + PRDF_ASSERT = 0x0A +}; + +/*********************************************************************************************/ +// NOTE!!! PLEASE READ THIS IF YOU ADD A NEW REASON CODE: +// Each new Reason code must have Service Tags (for the Serviceablity tools). +// The tags need to be in a .C file - the tools won't pick up if in a .H file. +// In theory the tags should be right in with the code that generates the Reason Code. +// For prdf this is not possible in most instances. +// prdf_ras_services.C is the default place holder for the Service tags. +// So the Service tags should be either added to a prdf .C file for a unique instance, or in ras services. +/*********************************************************************************************/ + +/** + * @brief Enum specifying Reason Codes (Refcodes), start at 0xE501 (through 0xE5FF) + */ +enum +{ + PRDF_HARDWARE_FAIL = PRDF_COMP_ID | 0x01, + PRDF_FIRST_REASONCODE = PRDF_COMP_ID | 0x01, //Start of PRD Reason code range + + PRDF_THERMAL_FAIL = PRDF_COMP_ID | 0x03, //PRD Thermal Error Log + + //Note: ranges from 0x04 through -0x3f are reserved for when callouts are all hardware only. + PRDF_DETECTED_FAIL_HARDWARE = PRDF_COMP_ID | 0x04, + + //Note: ranges from 0x40 through 0x4f are reserved for when callouts are Hardware, but also include Software or Second Level Support. + PRDF_DETECTED_FAIL_HARDWARE_PROBABLE = PRDF_COMP_ID | 0x40, + + //Note: ranges from 0x50 through 0x5f are reserved for when at least one callout is Software High, and also include some hardware callouts. + PRDF_DETECTED_FAIL_SOFTWARE_PROBABLE = PRDF_COMP_ID | 0x50, + + //Note: ranges from 0x60 through 0x6f are reserved for when callouts are all Software and Second Level Support only. + PRDF_DETECTED_FAIL_SOFTWARE = PRDF_COMP_ID | 0x60, + + //Note: ranges from 0x70 through 0x7f are currently reserved (unused). + + //Note: ranges from 0x80 through 0xff are reserved for PRD software callouts. When PRD detects a code problem in PRD itself or as a result of interaction with another FSP component. . + PRDF_CODE_FAIL = PRDF_COMP_ID | 0x80, //This is the 'generic' PRD analysis internal code error. + + PRDF_ECMD_DATA_BUFFER_FAIL = PRDF_COMP_ID | 0x81, //Error from ecmdDataBuffer + + + + PRDF_LAST_REASONCODE = PRDF_COMP_ID | 0xFF //End of PRD Reason code range, update if range chgs +}; + +#endif //prdf_services_codes_H diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H index 7888327f3..8f257680a 100644 --- a/src/include/usr/hbotcompid.H +++ b/src/include/usr/hbotcompid.H @@ -194,6 +194,14 @@ const compId_t MVPD_COMP_ID = 0x1200; const char MVPD_COMP_NAME[] = "mvpd"; //@} +/** @name PRDF + * PRDF component + */ +//@{ +const compId_t HBPRDF_COMP_ID = 0x1300; //FIXME working with ERRL owner to resolve errl parsing issue +const char HBPRDF_COMP_NAME[] = "prdf"; //FIXME +//@} + /** @name RESERVED * Reserved component ID. x3100 is the component ID * of FipS ERRL component. Due to our use of @@ -203,6 +211,7 @@ const char MVPD_COMP_NAME[] = "mvpd"; //@{ const compId_t FIPS_ERRL_COMP_ID = 0x3100; const char FIPS_ERRL_COMP_NAME[] = "hb-trace"; +//@} // ---------------------------------------------------------- // CXXTEST Unit Test, reserve compid near the end... diff --git a/src/makefile b/src/makefile index 651d640db..ccffb4a52 100644 --- a/src/makefile +++ b/src/makefile @@ -50,13 +50,13 @@ RUNTIME_OBJECTS = BASE_MODULES = trace errl devicefw scom xscom initservice \ - pnor vfs + pnor vfs -EXTENDED_MODULES = targeting ecmddatabuffer fapi hwp plat \ +EXTENDED_MODULES = targeting ecmddatabuffer fapi hwp plat \ extinitsvc istepdisp hwas fsi fsiscom i2c intr \ spd dmi_training fapiporeve poreve util \ sbe_centaur_init mc_init dram_training \ - mdia mbox mvpd \ + mdia mbox mvpd prdf \ activate_powerbus build_winkle_images \ core_activate dram_initialization edi_ei_initialization \ establish_system_smp load_payload \ @@ -69,7 +69,7 @@ TESTCASE_MODULES = cxxtest testerrl testdevicefw testsyslib \ testscom testxscom testtargeting testinitservice testkernel \ testhwpf testecmddatabuffer initsvctesttask testcxxtest \ testpnor testi2c testfsi testvfs testhwas testintr testspd \ - testpore testutil testmbox testmdia testmvpd + testpore testutil testmbox testmdia testmvpd testprdf RELOCATABLE_IMAGE_LDFLAGS = -pie --export-dynamic diff --git a/src/usr/diag/makefile b/src/usr/diag/makefile index 118391c9e..d55ba0d84 100644 --- a/src/usr/diag/makefile +++ b/src/usr/diag/makefile @@ -22,6 +22,6 @@ # IBM_PROLOG_END ROOTPATH = ../../.. -SUBDIRS = mdia.d +SUBDIRS = mdia.d prdf.d include ${ROOTPATH}/config.mk diff --git a/src/usr/diag/prdf/iipconst.h b/src/usr/diag/prdf/iipconst.h new file mode 100755 index 000000000..455af2769 --- /dev/null +++ b/src/usr/diag/prdf/iipconst.h @@ -0,0 +1,88 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/iipconst.h $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + +#ifndef IIPCONST_H +#define IIPCONST_H + +/** + @file iipconst.h + @brief Common iternal constants used by PRD +*/ + +/*--------------------------------------------------------------------*/ +/* Includes */ +/*--------------------------------------------------------------------*/ + +#if !defined(PRDF_TYPES_H) +#include <prdf_types.h> +#endif + +#include <target.H> + +/*--------------------------------------------------------------------*/ +/* User Types */ +/*--------------------------------------------------------------------*/ + +// Type Specification ////////////////////////////////////////////////// +// +// Purpose: CHIP_ID_TYPE is used to identify a Chip instance. +// +// End Type Specification ////////////////////////////////////////////// + +typedef TARGETING::TargetHandle_t CHIP_ID_TYPE; + +/*--------------------------------------------------------------------*/ +/* Constants */ +/*--------------------------------------------------------------------*/ + +#ifndef SUCCESS +#define SUCCESS 0 +#endif + +#ifndef FAIL +#define FAIL -1 +#endif + + +/** + * @brief Enum specifying domain ids + */ +enum DOMAIN_ID +{ + UKNOWN_DOMAIN = 0, + FABRIC_DOMAIN, + EX_DOMAIN, + MCS_DOMAIN, + MEMBUF_DOMAIN, + MBA_DOMAIN, + CLOCK_DOMAIN_FAB, + CLOCK_DOMAIN_MCS, + CLOCK_DOMAIN_MEMBUF, + + END_DOMAIN_ID +}; + + + + +#endif diff --git a/src/usr/diag/prdf/iipglobl.h b/src/usr/diag/prdf/iipglobl.h new file mode 100755 index 000000000..a966b13cf --- /dev/null +++ b/src/usr/diag/prdf/iipglobl.h @@ -0,0 +1,58 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/iipglobl.h $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + +#ifndef IIPGLOBL_H +#define IIPGLOBL_H + + +/* Module Description *************************************************/ +/* */ +/* Name: iipglobl.h */ +/* */ +/* Description: This module contains the Processor Runtime + Diagnostics global variable and type declarations. */ +/* */ +/* End Module Description *********************************************/ + + +/*--------------------------------------------------------------------*/ +/* Includes */ +/*--------------------------------------------------------------------*/ + +#include <prdfTrace.H> + +// FIXME: will need to merge with the FSP version +// as we continue to port code over + +/*--------------------------------------------------------------------*/ +/* Global Variables */ +/*--------------------------------------------------------------------*/ + + +/*--------------------------------------------------------------------*/ +/* Function Prototypes */ +/*--------------------------------------------------------------------*/ + + + +#endif diff --git a/src/usr/diag/prdf/makefile b/src/usr/diag/prdf/makefile new file mode 100755 index 000000000..453b61016 --- /dev/null +++ b/src/usr/diag/prdf/makefile @@ -0,0 +1,65 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/makefile $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2012 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or other- +# wise divested of its trade secrets, irrespective of what has +# been deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END + + +ROOTPATH = ../../../.. + +MODULE = prdf + +#------------------------------------------------------------------------------ +# paths +#------------------------------------------------------------------------------ + +VPATH = \ + framework: \ + + +EXTRAINCDIR += ${ROOTPATH}/src/include +EXTRAINCDIR += ${ROOTPATH}/src/include/sys +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/util +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/targeting +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/errl +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer + + +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/diag/prdf +EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/prdf +EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/prdf/framework/service + +#------------------------------------------------------------------------------ +# objects +#------------------------------------------------------------------------------ +include prd_framework.mk + + +OBJS = ${prd_framework} + + + +SUBDIRS = test.d + +include ${ROOTPATH}/config.mk diff --git a/src/usr/diag/prdf/prd_framework.mk b/src/usr/diag/prdf/prd_framework.mk new file mode 100755 index 000000000..4d176a7dc --- /dev/null +++ b/src/usr/diag/prdf/prd_framework.mk @@ -0,0 +1,30 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/prd_framework.mk $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2012 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or other- +# wise divested of its trade secrets, irrespective of what has +# been deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END + + + +######## Framework ######## + +prd_framework = \ + prdf_main.o \ + prdfTrace.o diff --git a/src/usr/diag/prdf/prdfTrace.C b/src/usr/diag/prdf/prdfTrace.C new file mode 100755 index 000000000..e229489a9 --- /dev/null +++ b/src/usr/diag/prdf/prdfTrace.C @@ -0,0 +1,39 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/prdfTrace.C $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + + +/** + * @file prdfTrace.C + * @brief prdf trace descriptor + */ + +#include "prdfTrace.H" + +namespace PRDF +{ + +tracDesc_t traceDesc = 0; + +TRAC_INIT(&traceDesc, PRDF_COMP_NAME, 4096); + +} diff --git a/src/usr/diag/prdf/prdfTrace.H b/src/usr/diag/prdf/prdfTrace.H new file mode 100755 index 000000000..14cc7edc5 --- /dev/null +++ b/src/usr/diag/prdf/prdfTrace.H @@ -0,0 +1,84 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/prdfTrace.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + + +#ifndef PRDF_TRACE_H +#define PRDF_TRACE_H + + +#include <tracinterface.H> +#include <prdf_service_codes.H> + +namespace PRDF +{ + +#ifdef __HOSTBOOT_MODULE + +typedef trace_desc_t* tracDesc_t; +#define PRDF_COMP_ID HBPRDF_COMP_ID //FIXME: will need to make a change in hbotcompid.H later +#define PRDF_COMP_NAME HBPRDF_COMP_NAME //FIXME + +#endif + +extern tracDesc_t traceDesc; + +} + +// FIXME: do this for now so that we don't have to change all of the existing traces +#define gTraceDescriptor PRDF::traceDesc + +#define PRDF_SIGNATURE "Signature" + +// field traces ------------------- + +#define PRDF_ENTER(args...) \ + TRACFCOMP(PRDF::traceDesc, ENTER_MRK"" args) + +#define PRDF_EXIT(args...) \ + TRACFCOMP(PRDF::traceDesc, EXIT_MRK""args) + +#define PRDF_SIG(args...) \ + TRACFCOMP(PRDF::traceDesc, PRDF_SIGNATURE" " args) + +#define PRDF_ERR(args...) \ + TRACFCOMP(PRDF::traceDesc, ERR_MRK"" args) + +#define PRDF_INF(args...) \ + TRACFCOMP(PRDF::traceDesc, INFO_MRK"" args) + +#define PRDF_BIN(args...) \ + TRACFBIN(PRDF::traceDesc, "" args) + +// debug traces ------------------- + +#define PRDF_DENTER(args...) \ + TRACDCOMP(PRDF::traceDesc, ENTER_MRK"" args) + +#define PRDF_DEXIT(args...) \ + TRACDCOMP(PRDF::traceDesc, EXIT_MRK"" args) + +#define PRDF_DINF(args...) \ + TRACDCOMP(PRDF::traceDesc, INFO_MRK"" args) + + +#endif // PRDF_TRACE_H diff --git a/src/usr/diag/prdf/prdf_main.C b/src/usr/diag/prdf/prdf_main.C new file mode 100755 index 000000000..ec8fa0cbb --- /dev/null +++ b/src/usr/diag/prdf/prdf_main.C @@ -0,0 +1,154 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/prdf_main.C $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + + +/** + * @file prdf_main.C + * @brief PRD entry points + */ + +#define iipMain_C + +#include <prdf_proto.H> +#include <iipglobl.h> +#include <iipconst.h> +#include <targetservice.H> + +#undef iipMain_C + + +namespace PRDF +{ + +//------------------------------------------------------------------------------ +// Global Variables +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Function definitions +//------------------------------------------------------------------------------ + +void prdf_unInitialize(void) +{ + PRDF_ENTER( "prdf_unInitialize()" ); + // FIXME + PRDF_EXIT( "prdf_unInitialize()" ); +} + +//------------------------------------------------------------------------------ +errlHndl_t PrdInitialize() +{ + PRDF_ENTER( "PrdInitialize()" ); + + // FIXME + + PRDF_EXIT( "PrdInitialize()" ); + + return NULL; +} + + + + +// ---------------------------------------------------------------------------- +errlHndl_t PrdMain(ATTENTION_VALUE_TYPE i_attentionType, const AttnList & i_attnList) +{ + PRDF_ENTER( "PrdMain() Global attnType=%04X", i_attentionType ); + using namespace TARGETING; + + // FIXME + + // FIXME: will need to figure out a better way to trace Target Handles/EntityPath here + // This is temporary for initial debugging purose and will be removed or change + // to debug traces only + for(uint32_t i=0; i<i_attnList.size(); ++i) + { + TargetHandle_t l_target = i_attnList[i].targetHndl; + EntityPath l_path = l_target->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); //this will binary trace the entity path + + PRDF_INF( "PrdMain() attnType: %X, target: %X (%p) %X/%X", i_attnList[i].attnType, l_target->getAttr<ATTR_HUID>(), l_target, l_target->getAttr<ATTR_CLASS>(), l_target->getAttr<ATTR_TYPE>()); + + } + + + + + + PRDF_EXIT( "PrdMain()" ); + + return NULL; +} + + +//------------------------------------------------------------------------------ +errlHndl_t PrdStartScrub(const TARGETING::TargetHandle_t i_pTarget) +{ + PRDF_ENTER( "PrdStartScrub()" ); + // FIXME + PRDF_EXIT( "PrdStartScrub()" ); + + return NULL; +} + +//------------------------------------------------------------------------------ +int32_t prdfRestoreDramRepairs(const TARGETING::TargetHandle_t i_pTarget) +{ + PRDF_ENTER( "prdfRestoreDramRepairs()" ); + // FIXME + PRDF_EXIT( "prdfRestoreDramRepairs()" ); + + return SUCCESS; +} + +//------------------------------------------------------------------------------ +void PrdIplCleanup() +{ + PRDF_ENTER( "PrdIplCleanup()" ); + // FIXME + PRDF_EXIT( "PrdIplCleanup()" ); + + return; +} + + + +#ifndef __HOSTBOOT_MODULE + +//------------------------------------------------------------------------------ +errlHndl_t prdfFailoverComplete(void) +{ + PRDF_ENTER( "prdfFailoverComplete()" ); + + // FIXME + + PRDF_EXIT( "prdfFailoverComplete()" ); + + return NULL; +} + +#endif + + +} // End namespace PRDF diff --git a/src/usr/diag/prdf/prdf_types.h b/src/usr/diag/prdf/prdf_types.h new file mode 100755 index 000000000..feff1a6c0 --- /dev/null +++ b/src/usr/diag/prdf/prdf_types.h @@ -0,0 +1,40 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/prdf_types.h $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + + +#ifndef PRDF_TYPES_H +#define PRDF_TYPES_H + +#include <stdint.h> + +#define BIT_LIST_CLASS prdfBitKey +#define BIT_STRING_CLASS prdfBitString +#define BIT_STRING_ADDRESS_CLASS prdfBitStringOffset +#define BIT_STRING_BUFFER_CLASS prdfBitStringBuffer +#define ResolutionMap prdfResolutionMap +#define FILTER_PRIORITY_CLASS prdfFilterPriority +#define FILTER_CLASS prdfFilter + + + +#endif /* prdf_types_h */ diff --git a/src/usr/diag/prdf/test/makefile b/src/usr/diag/prdf/test/makefile new file mode 100644 index 000000000..9c25808e3 --- /dev/null +++ b/src/usr/diag/prdf/test/makefile @@ -0,0 +1,37 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/test/makefile $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2012 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or other- +# wise divested of its trade secrets, irrespective of what has +# been deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END + + +ROOTPATH = ../../../../.. + +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/diag/prdf +EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/prdf +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/errl +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/targeting + +MODULE = testprdf + +TESTS = *.H + +include ${ROOTPATH}/config.mk diff --git a/src/usr/diag/prdf/test/prdfTest.H b/src/usr/diag/prdf/test/prdfTest.H new file mode 100644 index 000000000..9ae5b5a46 --- /dev/null +++ b/src/usr/diag/prdf/test/prdfTest.H @@ -0,0 +1,137 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/prdf/test/prdfTest.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2012 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END + +#ifndef __TEST_PRDFTEST_H +#define __TEST_PRDFTEST_H + +/** + * @file prdfTest.H + * + * @brief prdf unit test + */ + +#include <cxxtest/TestSuite.H> +#include <prdfTrace.H> +#include <prdf_proto.H> +#include <errl/errlentry.H> +#include <errl/errlmanager.H> + + +class prdfTest: public CxxTest::TestSuite +{ + public: + + void testTrace(void) + { + TS_TRACE(ENTER_MRK __FUNCTION__); + + PRDF_ENTER( "%s", __FUNCTION__ ); + + const char * l_testStr = "running testTrace"; + uint64_t l_testHex = 0xDEADBEEF; + uint64_t l_testDec = 99; + PRDF_INF( "testTrace() %s - testHex=0x%08X, testDec=%d", l_testStr, l_testHex, l_testDec ); + + uint64_t l_chip = 0xFFFFFFFF; + uint64_t l_sig = 0x12345678; + PRDF_SIG( "%08X %08X", l_chip, l_sig); + + PRDF_ERR( "testTrace() Please ignore this error trace 0x%08X", l_testHex ); + + PRDF_EXIT( "%s", __FUNCTION__ ); + + PRDF_DENTER( "testTrace()" ); + + PRDF_DINF( "testTrace() running testTrace" ); + + PRDF_DEXIT( "testTrace()" ); + + TS_TRACE(EXIT_MRK __FUNCTION__); + } + + void testPrdInitialize(void) + { + using namespace PRDF; + TS_TRACE(ENTER_MRK __FUNCTION__); + PRDF_ENTER( "testPrdInitialize()" ); + + errlHndl_t l_pErr = NULL; + l_pErr = PrdInitialize(); + + if (l_pErr) + { + PRDF_ERR( "testPrdInitialize(): PrdInitialize returned error" ); + TS_FAIL("testPrdInitialize(): PrdInitialize returned error"); + errlCommit(l_pErr,PRDF_COMP_ID); + } + else + { + PRDF_INF( "testPrdInitialize(): PrdInitialize completed with no error" ); + TS_TRACE(INFO_MRK "testPrdInitialize(): PrdInitialize completed with no error"); + } + + PRDF_EXIT( "testPrdInitialize()" ); + TS_TRACE(EXIT_MRK __FUNCTION__); + } + + void testPrdMain(void) + { + using namespace PRDF; + TS_TRACE(ENTER_MRK __FUNCTION__); + PRDF_ENTER( "testPrdMain()" ); + + errlHndl_t l_pErr = NULL; + //l_pErr = PrdMain(); + + if (l_pErr) + { + PRDF_ERR( "testPrdMain(): PrdMain returned error" ); + TS_FAIL("testPrdMain(): PrdMain returned error"); + errlCommit(l_pErr,PRDF_COMP_ID); + } + else + { + PRDF_INF( "testPrdMain(): PrdMain completed with no error" ); + TS_TRACE(INFO_MRK "testPrdMain(): PrdMain completed with no error"); + } + + PRDF_EXIT( "testPrdMain()" ); + TS_TRACE(EXIT_MRK __FUNCTION__); + } + + void testPrdIplCleanup(void) + { + using namespace PRDF; + TS_TRACE(ENTER_MRK __FUNCTION__); + PRDF_ENTER( "testPrdIplCleanup()" ); + + PrdIplCleanup(); + + PRDF_EXIT( "testPrdIplCleanup()" ); + TS_TRACE(EXIT_MRK __FUNCTION__); + } + +}; + +#endif + diff --git a/src/usr/initservice/extinitsvc/extinitsvctasks.H b/src/usr/initservice/extinitsvc/extinitsvctasks.H index 6a5cf8afe..697672d6d 100644 --- a/src/usr/initservice/extinitsvc/extinitsvctasks.H +++ b/src/usr/initservice/extinitsvc/extinitsvctasks.H @@ -255,6 +255,18 @@ const TaskInfo g_exttaskinfolist[] = { } }, + /** + * @brief PRDF code library + */ + { + "libprdf.so" , // taskname + NULL, // no pointer to fn + { + INIT_TASK, // task type + EXT_IMAGE, // Extended Module + } + }, + // end TODO. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |