diff options
Diffstat (limited to 'src/usr/diag/prdf/framework/config')
29 files changed, 4525 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/framework/config/iipConfigurator.C b/src/usr/diag/prdf/framework/config/iipConfigurator.C new file mode 100755 index 000000000..63f50da79 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipConfigurator.C @@ -0,0 +1,68 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipConfigurator.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: +// +// End Module Description ********************************************** +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- +#define iipConfigurator_C + +#include <iipConfigurator.h> + +#undef iipConfigurator_C +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- +Configurator::~Configurator() +{ +} +/*---------------------------------------------------------------------------*/ +/* Change Log */ +/*---------------------------------------------------------------------------*/ +/* Description / [Reason] Date USRID */ +// #undef syntax error, non inlined destructor /d24747.5 03/01/96 dgilbert +/* */ diff --git a/src/usr/diag/prdf/framework/config/iipConfigurator.h b/src/usr/diag/prdf/framework/config/iipConfigurator.h new file mode 100755 index 000000000..cf231a62e --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipConfigurator.h @@ -0,0 +1,206 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipConfigurator.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef Configurator_h +#define Configurator_h + +// Class Specification ************************************************/ +// +// Name: Configurator +// Parent class: None. +// +// Summary: Instantiates a chip object for each hardware chip that +// is marked as functional in the syspit. Instantiates all +// the PRD Domains and assigns chip objects to them. Creates +// the system and transfers chip and domain lists to it. +// +//## Class: Configurator; Abstract +//## Category: PRDCommon +//## Subsystem: PRDCommon +//## Concurrency: Sequential +//## Persistence: Transient +//## Cardinality: 1 +//## Uses iipspit {1 -> 1} +//## Creates instances of: Domain {1 -> n} +//## Creates instances of: CHIP_CLASS {1 -> n} +// +// Notes: There is only one type of configurator per PRD bind which is +// determined at compile time by the definition of getConfiguratorPtr() +// +// Usage Example: +// Configurator * c = getConfiguratorPtr(); // CreateConfigurator +// System *system = c->build(); +// if(!rc) +// { +// Configurator::chipList cl = c->getChipList(); +// Configurator::domainList d = c->getDomainList(); +// } +// . +// . +// delete c; +// BIG NOTE: +// (Delete will NOT destroy the chip or domain instances created by +// the build function - only the vectors of pointers to the instances) +// +// End Class Specification ********************************************/ +//---------------------------------------------------------------------- +// Reference the virtual function tables and inline function +// defintions in another translation unit. +//---------------------------------------------------------------------- + +// Includes +#if (!defined(_CPU_H) && !defined(CPU_H)) +//#include <cpu.h> +#endif + +#include <prdfMain.H> + +#include <vector> +/*--------------------------------------------------------------------*/ +/* Forward References */ +/*--------------------------------------------------------------------*/ +class CHIP_CLASS; +class Domain; +class System; + +class Configurator +{ +public: + + typedef std::vector<CHIP_CLASS *> chipList; + typedef std::vector<Domain *> domainList; + + static Configurator * getConfiguratorPtr(); + // Function Specification ************************************* + // + // Purpose: returns a ptr to an instance of the Configurator + // Notes: There is one and only one type of configurator for each + // hardware platform - the correct one is determined at + // compile time by the definition of this function. + // new is used to create the object and can be + // deleted when it is no longer needed. + // + // End Function Specification ********************************* + + //## Destructor (generated) + virtual ~Configurator(); + + virtual System * build()=0; + // Function Specification ******************************************** + // + // Purpose: Builds chipList and domainList and system + // Parameters: None + // Returns: Ptr to system | NULL + // Requirements: Global ptr to syspit object has been initialized + // Promises: All chip objects and domain objects for system intantiated + // Exceptions: None + // Concurrency: Sequential + // Notes: + // Instantiate a chip object for each hardware chip that is + // marked as functional in the syspit. + // Instantiates the domains in the system and assign chips. + // This function should only be called once. + // If any fail conditions are encoutered then an SRC is written to + // the SOT using SRCFILL. If NULL is returned then chiplist and + // domainlist may not be complete. + // + // End Function Specification ****************************************** + +protected: + + chipList & getChipList() { return(sysChipLst); } + // Function Specification ******************************************** + // + // Purpose: Get reference to a vector of pointers to chips + // Parameters: None + // Returns: Reference to chipList + // Requirements: Build must have been called prior to this + // Promises: chipList contains all chip objects for the system + // Exceptions: None + // Concurrency: Sequential + // + // End Function Specification ****************************************** + + domainList & getDomainList() { return(sysDmnLst); } + // Function Specification ******************************************** + // + // Purpose: Get reference to a vector of pointers to domains + // Parameters: None + // Returns: Reference to domainList + // Requirements: Build must have been called prior to this + // Promises: domainList contains all domain objects for the system + // the appropriate chips have been assigned to each domain + // Exceptions: None + // Concurrency: Sequential + // + // End Function Specification ****************************************** + +protected: + Configurator(int max_chips = 50, int max_domains = 4) + { + sysChipLst.reserve(max_chips); + sysDmnLst.reserve(max_domains); + } + // Function Specification ******************************************** + // + // Purpose: Constructor + // Parameters: Maximum number of chips and domains expected in the system + // Specifying maximums causes memory to be managed more efficiently + // Returns: Nothing + // Requirements: None + // Promises: Instance of this class created + // Exceptions: None + // Concurrency: Sequential + // + // + // End Function Specification ****************************************** + +//## Equality Operations (generated) +// int operator==(const Configurator &right) const; +// int operator!=(const Configurator &right) const; + + + chipList sysChipLst; // List of chips in the system + domainList sysDmnLst; // List of domains in the system + +private: + + Configurator(const Configurator &right); + const Configurator & operator=(const Configurator &right); + + // Function Specification ******************************************** + // + // Purpose: Copy constructor / Assignment operator + // Parameters: Reference to instance of Configurator + // Returns: Nothing + // Requirements: These operations are not allowed + // Promises: Prevents copies / Assignments from being made + // Exceptions: None + // Concurrency: n/a + // Notes: No definition should exist + // + // End Function Specification **************************************** + +}; + +#endif diff --git a/src/usr/diag/prdf/framework/config/iipDomain.C b/src/usr/diag/prdf/framework/config/iipDomain.C new file mode 100755 index 000000000..01cc4d97e --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipDomain.C @@ -0,0 +1,84 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipDomain.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: This module provides the implementation for the PRD +// Domain class. +// +// End Module Description ********************************************** + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- +#define iipDomain_C + +#include <iipDomain.h> + +#undef iipDomain_C + +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- + +Domain::Domain(DOMAIN_ID domain_id) : +dom_id(domain_id) +{ +} + +Domain::~Domain(void) +{ +} + +int32_t Domain::Initialize (void) +{ + // Default = do nothing + return(SUCCESS); +} + + +// @jl02 Add this for Unit CS. This is a virtual function so it doesn't need and code here. +void Domain::Remove(TARGETING::TargetHandle_t i_ptargetChip) +{ +}; +// @jl02 a End. diff --git a/src/usr/diag/prdf/framework/config/iipDomain.h b/src/usr/diag/prdf/framework/config/iipDomain.h new file mode 100755 index 000000000..bf1d9ed64 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipDomain.h @@ -0,0 +1,126 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipDomain.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef iipDomain_h +#define iipDomain_h + + +#include <iipconst.h> // Include file for DOMAIN_ID's +#include <iipchip.h> // @jl02 +#ifndef IIPSDBUG_H +#include <iipsdbug.h> // Include file for ATTENTION_TYPE +#endif + +// Forward References +struct STEP_CODE_DATA_STRUCT; + +/*! + Domain class provides error analysis of a specific domain of a hardware system + + Usage Examples: + @code + // during PrdInitialize() + Domain * domain = new DerivedDomain(id,...); + int32_t rc=domain->Initialize(); // Perform domain dependent hardware init + + // During PRD Analyze: called from System_Class + if (domain->Query()) // Query for domain at attention + { + // Analyze the attention + int32_t rc=domain->Analyze(service_data,System_attention_type); + } + + DOMAIN_ID id = domain->GetId(); - Get the current domains id. + @endcode + */ +class Domain +{ +public: + + /** + Contructor + @param domain_id Id of this domain. See iipconst.h + */ + Domain(DOMAIN_ID domain_id); + + /** + Destructor + @note Default does nothing - must be virtual for derived classes + */ + virtual ~Domain(void); + + /** + Initialize domain specific hardware as needed + @return MOPS error code or @c prd_return_code_t + */ + virtual int32_t Initialize(void); + + /** + Remove domain specific hardware as needed + @return MOPS error code or @c prd_return_code_t + */ + virtual void Remove(TARGETING::TargetHandle_t); + + /** + Query - if any sub components have attention matching attentionType + @param attentionType see iipsdbug.h for values + @return true|false + @pre this->Initialize() must be called + */ + virtual bool Query(ATTENTION_TYPE attentionType) = 0; + + /** + Analzye this domain + @param attentionType to analyze + @return Mops return code | @c prd_return_code_t + @return serviceData + @pre this->Query() == true + @post serviceData valid + */ + virtual int32_t Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType) = 0; + + /** + Access the ID of this domain + @return @c DOMAIN_ID See iipconst.h + */ + DOMAIN_ID GetId(void) const { return(dom_id); } + +protected: + + /** + Prioritize the components of this domain for Analysis + @param ATTENTION_TYPE [MACHINE_CHECK, RECOVERABLE, SPECIAL] + @post Domain prepared for Analysis + @note Default is do nothing + */ + virtual void Order(ATTENTION_TYPE attentionType) = 0; + +private: + + DOMAIN_ID dom_id; + +}; + + +#endif diff --git a/src/usr/diag/prdf/framework/config/iipDomainContainer.C b/src/usr/diag/prdf/framework/config/iipDomainContainer.C new file mode 100755 index 000000000..e952ce00d --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipDomainContainer.C @@ -0,0 +1,165 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipDomainContainer.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: This module provides the implementation for the PRD +// DomainContainer class. +// +// End Module Description ********************************************** + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- + +#include <iipServiceDataCollector.h> +#include <prdfErrorSignature.H> +#include <iipDomainContainer.h> + +#include <prdfRuleChip.H> +#include <prdfPluginDef.H> +#include <prdfPlatServices.H> +#include <algorithm> + +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- + +// @jl02 a Start +// This is used with the CHIP_CLASS vectors to remove one that matches a chipID +// Predicate function for comparing chip IDs. This is required by remove_if from STL. +// TODO:FIXME: Add compiler directives or some method to make sure the type handling here +// is generic enough or correct enough to handle future use of this functionality. +class prdfCompareChipIds: public std::unary_function<void*&, bool> +{ + public: + //Constructor allows a value to be passed in to compare against. + inline prdfCompareChipIds(TARGETING::TargetHandle_t cid) : __cid(cid) {}; + //This operator is the one I'd like to call straight. But, because of the void ptr type + // I cannot call it directly. C++ won't allow it because of "strong typing" rules. + inline bool operator() (CHIP_CLASS& i) + { + return (__cid == i.GetChipHandle()); + }; + //Really fancy caste for the benefit of the compiler. + inline bool operator() (void*& i) + { + //Anonymous Union for calling void ptr a CHIP_CLASS. + union {CHIP_CLASS* c; void* v;} cptr; + //assign value passed in to it's void ptr type. + cptr.v = i; + //pass CHIP_CLASS type to inline overloaded operator above. + return this->operator()(*cptr.c); + }; + private: + //Private storage for value passed in. + TARGETING::TargetHandle_t __cid; +}; +// @jl02 a Stop + +template<class T> +inline +DomainContainer<T>::DomainContainer(DOMAIN_ID domainId, unsigned int size) : +Domain(domainId), +chips() // dg04 - remove size from arg list +{ + chips.reserve(size); // dg04 +} + +template<class T> +inline +bool DomainContainer<T>::Query(ATTENTION_TYPE attentionType) // DG03 +{ + bool rc = false; + + SYSTEM_DEBUG_CLASS sysdebug; + unsigned int size = GetSize(); + for(unsigned int i = 0;(i < size) && (rc == false);i++) + { + TARGETING::TargetHandle_t l_pchipHandle = LookUp(i)->GetChipHandle(); + if(sysdebug.IsAttentionActive(l_pchipHandle) == true) + { + if(sysdebug.GetAttentionType(l_pchipHandle) == attentionType) rc = true; + } + } + + return(rc); +} + +template<class T> +inline +int32_t DomainContainer<T>::Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType) +{ + serviceData.service_data->GetErrorSignature()->clear(); + Order(attentionType); // DG01 DG02 + return(LookUp(0)->Analyze(serviceData, attentionType)); +} + +template<class T> +inline +void DomainContainer<T>::Swap(unsigned int index1, unsigned int index2) +{ + void * ptr = chips[index1]; + chips[index1] = chips[index2]; + chips[index2] = ptr; +} + +template<class T> // pw01 - Added function. +inline +void DomainContainer<T>::MoveToFront(unsigned int index) +{ + for (unsigned int i = index; i > 0; i--) + { + Swap(i, i-1); + } +} + +template<class T> +inline +void DomainContainer<T>::Remove(TARGETING::TargetHandle_t i_pChipHandle) +{ + // erase and remove_if functions are from the STL and require begin end and predicate functions to work. + // This will iterate thru the vectors and remove any vectors with chip ID that matches the i_chip. + chips.erase(std::remove_if(chips.begin(), chips.end(), prdfCompareChipIds(i_pChipHandle)), chips.end()); +} diff --git a/src/usr/diag/prdf/framework/config/iipDomainContainer.h b/src/usr/diag/prdf/framework/config/iipDomainContainer.h new file mode 100755 index 000000000..0b24b2810 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipDomainContainer.h @@ -0,0 +1,266 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipDomainContainer.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef iipDomainContainer_h +#define iipDomainContainer_h + +#ifndef iipDomain_h +#include <iipDomain.h> +#endif + +#include <vector> + +// Forward References +struct STEP_CODE_DATA_STRUCT; + +/** + Template class that Define a domain that contain other objects - typically + chips. + @par + Contained objects must have interface like CHIP_CLASS see iipchip.h + @note Parent class: Domain + @par Usage Examples: + @code + + // Create a Domain derived class holding chips of a specific type + class MyChip: public CHIP_CLASS {....}; + + class MyDomain : public DomainContainer<MyChip *> + { + MyDomain(DOMAIN_ID domainId); + + // Need to implement pure virtual functions + virtual SINT32 Order(void); // put chip to analyze at top of list + }; + + void foo(MyChip * chipPtr) + { + MyDomain myDomain(ID, 10); // Need to hold about 10 chips + + myDomain.AddChip(chipPtr); // Add chip to list of chips + // .... + + if(myDomain.LookUp(0) == chipPtr) // lookup first chip + { + // LookUp successfully returned pointer to the chip + } + } + + void f(Domain & myDomain, + STEP_CODE_DATA_STRUCT & sevice_data, + ATTENTION_TYPE system_attention_type) + { + if(myDomain->Query()) // if has attention + { + myDomain->Analyze(service_data, system_attention_type); + } + } + @endcode +*/ +template <class T> +class DomainContainer : public Domain +{ +public: + + /** + Constructor + <ul> + <br><b>Parameter: </b> domainId: Identifies the Domain (See iipconst.h) + <br><b>Parameter: </b> size: Estimate of max number of chips in domain + <br><b>Returns: </b> None. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> Object created + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + DomainContainer(DOMAIN_ID domainId, unsigned int size = 5); + + // Function Specification ******************************************** + // + // Purpose: Copy + // Parameters: c: Reference to instance to copy + // Returns: No value returned. + // Requirements: None. + // Promises: All data members will be copied (Deep copy). + // Exceptions: None. + // Concurrency: N/A. + // Notes: This constructor is not declared. This compiler generated + // default definition is sufficient. + // + // End Function Specification **************************************** + // DomainContainer(const DomainContainer<T> & c); + + // Function Specification ******************************************** + // + // Purpose: Destruction + // Parameters: None. + // Returns: No value returned + // Requirements: None. + // Promises: None. + // Exceptions: None. + // Concurrency: Reentrant + // Notes: This destructor is not declared. This compiler generated + // default definition is sufficient. + // + // End Function Specification **************************************** + // virtual ~DomainContainer(void); + + // Function Specification ******************************************** + // + // Purpose: Assigment + // Parameters: c: Reference to instance to assign from + // Returns: Reference to this instance + // Requirements: None. + // Promises: All data members are assigned to + // Exceptions: None. + // Concurrency: N/A. + // Notes: This assingment operator is not declared. The compiler + // generated default definition is sufficient. + // + // End Function Specification **************************************** + // DomainContainer<T> & operator=(const DomainContainer<T> & c); + + /** + Add a chip to this domain + <ul> + <br><b>Parameters: </b> Pointer to a chip instance + <br><b>Returns: </b> None. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> GetSize()++ + <br><b>Exceptions: </b> None. + </ul><br> + */ + void AddChip(T * chipPtr); + + /** + Query domain for attention + <ul> + <br><b>Parameters: </b> attentionType + <br><b>Returns: </b> true if 1 or more chips within the domain have + the attention type specified otherwise false + <br><b>Requirements:</b> GetSize() > 0, Initialize() + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + </ul><br> + */ + virtual bool Query(ATTENTION_TYPE attentionType); + + + /** + Determin which chip to Analyze and call it's Analyze() function + <ul> + <br><b>Parameter: </b> serviceData (See iipServiceDataCollector.h) + <br><b>Parameter: </b> attentionType [MACHINE_CHECK|RECOVERED|SPECIAL] + <br><b>Returns: </b> return code (0 == SUCCESS) + <br><b>Requirements:</b> Query() == true, Initialize() + <br><b>Promises: </b> serviceData complete + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> This implementation calls Order() to determin + which chip to analyze and calls that chips + Analyze() function. + </ul><br> + */ + virtual int32_t Analyze(STEP_CODE_DATA_STRUCT & serviceData,ATTENTION_TYPE attentionType); + + /** + Returns a pointer to the chip at the specified index + <ul> + <br><b>Parameters: </b> chipIndex + <br><b>Returns: </b> pointer to a Chip of type T | NULL + <br><b>Requirements:</b> AddChip(), 0 <= chipIndex < GetSize() + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> NULL is return if chipIndex is out of range + </ul><br> + */ + const T * LookUp(unsigned int chipIndex) const; + T * LookUp(unsigned int chipIndex); + + /** + Return the number of chips in the domain + <ul> + <br><b>Parameters: </b> None. + <br><b>Returns: </b> number of chips in the domain + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + </ul><br> + */ + uint32_t GetSize(void) const; + +protected: + + + /** + Swaps the position of two chips in the chip list + <ul> + <br><b>Parameters: </b> chip indexes of chips to swap + <br><b>Returns: </b> None. + <br><b>Requirements:</b> indexes < GetSize(), & >= 0 + <br><b>Promises: </b> chiplist order modified + <br><b>Exceptions: </b> None. + </ul><br> + */ + void Swap(unsigned int index1, unsigned int index2); + + /** + * Moves the specified chip to the front of the list but preserves the + * rest of the order. + */ + void MoveToFront(unsigned int index); // pw01 + +// @jl02 a Start + /** + Removes a chip from the list inside of each Domain that contains it. + It will leave the list at the system level for later deletion. + <ul> + <br><b>Parameters: </b> chip identifier of chip to remove + <br><b>Returns: </b> None. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + </ul><br> + */ + void Remove(TARGETING::TargetHandle_t i_chip); + +private: + + // void * is used to reduce template code bloat + // the chip type T is restored whenever a reference to a chip + // is requested + typedef std::vector<void *> ChipContainerType; + + ChipContainerType chips; + + +}; + +#include "iipDomainContainer.inl" + +//#ifdef RS6000 -- changed for V4R1 Bali - 2/27/96 JFP +#ifndef __GNUC__ +#include "iipDomainContainer.C" +#endif + +#endif diff --git a/src/usr/diag/prdf/framework/config/iipDomainContainer.inl b/src/usr/diag/prdf/framework/config/iipDomainContainer.inl new file mode 100755 index 000000000..6a57ac26e --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipDomainContainer.inl @@ -0,0 +1,57 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipDomainContainer.inl $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef iipDomainContainer_inl +#define iipDomainContainer_inl + + +template<class T> +inline +void DomainContainer<T>::AddChip(T * chipPtr) +{ + chips.push_back((T *) chipPtr); +} + +template<class T> +inline +const T * DomainContainer<T>::LookUp(unsigned int i_chipIndex) const +{ + return((T *) ((i_chipIndex < chips.size()) ? chips[i_chipIndex] : NULL)); +} + +template<class T> +inline +T * DomainContainer<T>::LookUp(unsigned int i_chipIndex) +{ + return((T *) ((i_chipIndex < chips.size()) ? chips[i_chipIndex] : NULL)); +} + +template<class T> +inline +uint32_t DomainContainer<T>::GetSize(void) const +{ + return(chips.size()); +} + +#endif + diff --git a/src/usr/diag/prdf/framework/config/iipSystem.C b/src/usr/diag/prdf/framework/config/iipSystem.C new file mode 100755 index 000000000..0405347b4 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipSystem.C @@ -0,0 +1,338 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipSystem.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: This module provides the implementation for the PRD +// System class. +// +// End Module Description ********************************************** + +/*--------------------------------------------------------------------*/ +/* Emit the virtual function tables and inline function defintions in + this translation unit. */ +/*--------------------------------------------------------------------*/ +#ifdef __GNUC__ +#endif + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- + +#include <prdfMain.H> +#include <iipSystem.h> +#include <iipResolution.h> +#include <iipsdbug.h> +#include <iipchip.h> +#include <iipDomain.h> +#include <iipServiceDataCollector.h> +#include <iipResolutionFactory.h> +#include <iipglobl.h> +#include <prdfPlatServices.H> + +#ifndef __HOSTBOOT_MODULE + #include <prdfMfgThresholdMgr.H> +#endif + +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- + +System::System( Resolution & noSystemAttentions ) : + chips(), + prioritizedDomains(), + noAttnResolution(noSystemAttentions) +{} + +System::~System(void) +{ + for(ChipMapType::iterator chipIterator = chips.begin(); + chipIterator != chips.end();chipIterator++) + { + delete (*chipIterator); + } + + // change to delete prioritiezed Domains instead of domains dg04 + for(DomainContainerType::iterator domainIterator = prioritizedDomains.begin(); + domainIterator != prioritizedDomains.end();domainIterator++) + { + delete (*domainIterator); + } + // clear the Resolution factory + ResolutionFactory::Access().Reset(); + +#ifndef __HOSTBOOT_MODULE + // FIXME: need to implement PrdfMfgThresholdMgr in Hostboot + // clear the MfgThresholdMgr + PrdfMfgThresholdMgr::getInstance()->reset(); +#endif + + // clear the threshold policies + ThresholdResolution::reset(); +} + +CHIP_CLASS * System::GetChip(TARGETING::TargetHandle_t i_pchipHandle ) +{ + CHIP_CLASS * chipPtr = NULL; + + // chips.LookUp(chipPtr, chipId); + for(uint32_t i = 0; i < chips.size(); ++i) + { + if(chips[i]->GetChipHandle() == i_pchipHandle) + { + chipPtr = chips[i]; + break; + } + } + + return(chipPtr); +} + +Domain * System::GetDomain(DOMAIN_ID domainId) +{ + Domain * domainPtr = NULL; + + // domains.LookUp(domainPtr, domainId); + for(uint32_t i = 0; i < prioritizedDomains.size(); ++i) + { + if(prioritizedDomains[i]->GetId() == domainId) + { + domainPtr = prioritizedDomains[i]; + break; + } + } + + return(domainPtr); +} + +void System::AddChips(ChipContainerIterator begin, + ChipContainerIterator end) +{ + using namespace PRDF; + + size_t l_size = 0; + if(begin < end) l_size = end-begin; + else l_size = begin-end; + chips.reserve(chips.size()+l_size); + while(begin != end) + { + chips.push_back(*begin); + begin++; + } +} + +void System::AddDomains(DomainContainerIterator begin, + DomainContainerIterator end) +{ + size_t l_size = 0; + if(begin < end) l_size = end-begin; + else l_size = begin-end; + prioritizedDomains.reserve(prioritizedDomains.size()+l_size); + // The Configurator owns determining the priority of the domains. + while(begin != end) + { + prioritizedDomains.push_back(*begin); // dg01 - add: Keep order given + begin++; + } +} + +void System::RemoveStoppedChips(TARGETING::TargetHandle_t i_pchipHandle) +{ + for(DomainContainerType::iterator domainIterator = prioritizedDomains.begin(); + domainIterator != prioritizedDomains.end(); domainIterator++) + { + (*domainIterator)->Remove(i_pchipHandle); + } +} + +// -------------------------------------------------------------------- + +void System::RemoveNonFunctionalChips() +{ + using namespace PRDF; + + ChipMapType l_chips; + + for(ChipMapType::iterator chipIterator = chips.begin(); + chipIterator != chips.end(); + chipIterator++) + { + if(!PlatServices::isFunctional((*chipIterator)->GetChipHandle())) + { + l_chips.push_back(*chipIterator); + } + } + + // The reason for l_chips is because we can't remove elements from a vector + // as we are iterating on it. Otherwise, it will foul up the iterators. + // Now, this is not the most efficient way to remove the chips, because this + // implementation will remove (put at the end of the vector) the chip then + // erase it and repeat for each element. Instead, it should remove all chips + // then erase all removed chips. However, for the scope of this code, the + // efficiency increase is nominal so it can be left for future improvements. + for(ChipMapType::iterator chipIterator = l_chips.begin(); + chipIterator != l_chips.end(); + chipIterator++) + { + RemoveStoppedChips((*chipIterator)->GetChipHandle()); + } +} + +// -------------------------------------------------------------------- + +void System::Initialize(void) +{ + uint32_t rc = SUCCESS; + //SYSTEM_DEBUG_CLASS sysdebug; dg08d + + for(ChipMapType::iterator chipIterator = chips.begin(); + (chipIterator != chips.end()) && (rc == SUCCESS);chipIterator++) + { + rc = (*chipIterator)->Initialize(); + // if rc then an error log was (will be) committed + if(rc != SUCCESS) + { + PRDF_ERR( "System::Initialize of chips failed. rc = %x", rc ); + } + } + + // change domains to priortizedDomains dg04 + for(DomainContainerType::iterator domainIterator = prioritizedDomains.begin(); + (domainIterator != prioritizedDomains.end()) && (rc == SUCCESS); + domainIterator++) + { + rc = (*domainIterator)->Initialize(); + + if(rc != SUCCESS) + { + PRDF_ERR( "System::Initialize of chips failed. rc = %x", rc ); + } + } +} + +// ------------------------------------------------------------------- + +int System::Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType) +{ + using namespace PRDF; + + SYSTEM_DEBUG_CLASS sysdebug; + Domain * domainAtAttentionPtr = NULL; + ServiceDataCollector * l_saved_sdc = NULL; + + int rc = (prioritizedDomains.empty() ? NO_DOMAINS_IN_SYSTEM : SUCCESS); + int l_saved_rc = 0; + + if(rc == SUCCESS) + { + // IF machine check then check for recoverable errors first + // otherwise just check for the given type of attention + ATTENTION_TYPE startAttention = attentionType; + if((attentionType == MACHINE_CHECK) || (attentionType == UNIT_CS)) + startAttention = RECOVERABLE; + ATTENTION_TYPE atnType = startAttention; + for(atnType = startAttention; + domainAtAttentionPtr == NULL && atnType >= attentionType ; + --atnType) + { + for(DomainContainerType::iterator domainIterator = prioritizedDomains.begin(); + domainIterator != prioritizedDomains.end() && domainAtAttentionPtr == NULL; + domainIterator++) + { + domainAtAttentionPtr = ((*domainIterator)->Query(atnType)) ? (*domainIterator) : NULL; + if(domainAtAttentionPtr != NULL) + { + serviceData.service_data->SetCauseAttentionType(atnType); + rc = domainAtAttentionPtr->Analyze(serviceData, atnType); + if((rc == PRD_SCAN_COMM_REGISTER_ZERO) || + (rc == PRD_POWER_FAULT)) + { + // save sdc, and continue + if(l_saved_sdc == NULL) + { + l_saved_sdc = new ServiceDataCollector( + *serviceData.service_data); + l_saved_rc = rc; + } + // TODO clear serviceData ? + domainAtAttentionPtr = NULL; + + if(rc == PRD_POWER_FAULT) + { + PRDF_ERR( "System::Analyze() Power Fault detected!" ); + break; + } + } + } + } + } + + // if ptr is NULL && we don't have a saved SDC than we have noAttns + // if ptr is NULL && we have a saved SDC then we have an attn with no-bits-on + // otherwise we are done - aready did the analysis + if(domainAtAttentionPtr == NULL) + { + if(l_saved_sdc == NULL) + { + rc = noAttnResolution.Resolve(serviceData); + } + else + { + *serviceData.service_data = *l_saved_sdc; + sysdebug.CalloutThoseAtAttention(serviceData); + rc = l_saved_rc; + } + } + //else + //{ + // // mk442956 a Add atnType to CauseAttentionType in sdc + // serviceData.service_data->SetCauseAttentionType(atnType+1); + // rc = domainAtAttentionPtr->Analyze(serviceData, atnType+1); // jp01 + //} + if(l_saved_sdc != NULL) delete l_saved_sdc; //dg05a + + } + + return(rc); +} diff --git a/src/usr/diag/prdf/framework/config/iipSystem.h b/src/usr/diag/prdf/framework/config/iipSystem.h new file mode 100755 index 000000000..c4607d750 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipSystem.h @@ -0,0 +1,312 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipSystem.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef iipSystem_h +#define iipSystem_h + +// Class Specification ************************************************* +// +// Class name: System +// Parent class: None. +// +// Summary: This class provides access to the domains and chips of the +// actual hardware system. The System is initially set up with +// one or more calls to the Add...() functions in which Domains +// and Chips are added to the system. The System assumes the +// ownership of the pointers to the chips and domains that are +// added to the system and will delete the associated chip and +// domain objects when the destructor of the System is called. +// +// The Initialize() function calls the Initialize() funciton +// for each Chip and Domain in the System. The function is +// also virtual so that it can be overidden in a derived class +// for a specific system initialization behaviour. +// +// The Analyze() function determins which Domain Analzye() function +// to call. The prioritization for Domain Analysis +// is based on the value of the Domain ID. The lower Domain +// ID has higher priority. When Analyze() is called, the Domains +// are queried for attention status starting with the highest +// priority Domain and moving to the lowest. +// The first Domain that returns true from Query() will have its +// Analyze() function called. +// +// Cardinality: N +// +// Performance/Implementation: +// Space Complexity: Linear based on the number of domains and chips +// configured in the hardware system. +// Time Complexity: All member functions constant unless otherwise +// stated. +// +// Usage Examples: +// +// extern CHIP_CLASS * chips[CHIP_COUNT]; +// extern Domain * domains[DOMAIN_COUNT]; +// extern ServiceDataCollector sdc; +// +// void foo(void) +// { +// System system; +// +// system.Add(chips, chips + CHIP_COUNT); +// system.Add(domains, domains + DOMAIN_COUNT); +// +// CHIP_CLASS * system.GetChip(CHIP_ID); +// Domain * system.GetDomain(DOMAIN_ID); +// +// system.Initialize(); +// +// system.Analyze(sdc); +// } +// +// End Class Specification ********************************************* + +#include <vector> + +#ifndef IIPCONST_H +#include <iipconst.h> //TARGETING::TargetHandle_t, DOMAIN_ID_TYPE +#endif + +#include <iipsdbug.h> // Include file for ATTENTION_TYPE + +// Forward Declarations +class CHIP_CLASS; +class Domain; +class Resolution; +struct STEP_CODE_DATA_STRUCT; + +class System + { + private: + + typedef std::vector<CHIP_CLASS *>::iterator ChipContainerIterator; + typedef std::vector<Domain *>::iterator DomainContainerIterator; + + public: + + System(Resolution & noSystemAttentions); + // Function Specification ******************************************** + // + // Purpose: Initialization + // Parameters: A resolution to resolve the serviceData if no + // attentions are found in the configured system + // Returns: No value returned. + // Requirements: None. + // Promises: All data members are initialized. + // Exceptions: None. + // Concurrency: Reentrant + // + // End Function Specification ////////////////////////////////////// + + // System(const System & c); + // Function Specification ******************************************** + // + // Purpose: Copy + // Parameters: c: Reference to instance to copy + // Returns: No value returned. + // Requirements: None. + // Promises: All data members will be copied (Deep copy). + // Exceptions: None. + // Concurrency: N/A. + // Notes: This constructor is not declared. This compiler generated + // default definition is sufficient. + // + // End Function Specification **************************************** + + virtual ~System(void); + // Function Specification ******************************************** + // + // Purpose: Destruction + // Parameters: None. + // Returns: No value returned + // Requirements: None. + // Promises: None. + // Exceptions: None. + // Concurrency: Reentrant + // Notes: This destructor deletes each Chip and Domain instance in + // the respective containers. + // + // End Function Specification **************************************** + + // System & operator=(const System & c); + // Function Specification ******************************************** + // + // Purpose: Assigment + // Parameters: Handle to the chip + // Returns: Reference to this instance + // Requirements: None. + // Promises: All data members are assigned to + // Exceptions: None. + // Concurrency: N/A. + // Notes: This assingment operator is not declared. The compiler + // generated default definition is sufficient. + // + // End Function Specification **************************************** + + CHIP_CLASS * GetChip(TARGETING::TargetHandle_t i_pchipHandle); + // Function Specification ******************************************** + // + // Purpose: Get Chip + // Parameters: chipId: Specifies chip to get + // Returns: Pointer to CHIP_CLASS + // Requirements: None. + // Promises: Return a pointer to the requested chip if it exists + // Exceptions: None. + // Concurrency: Reentrant. + // Notes: If the specified chip is not in the System, then NULL is + // returned. + // + // End Function Specification **************************************** + + Domain * GetDomain(DOMAIN_ID domainId); + // Function Specification ******************************************** + // + // Purpose: Get Domain + // Parameters: domainId: Specifies domain to get + // Returns: Pointer to Domain. + // Requirements: None. + // Promises: Return a pointer to the requested domain if it exists + // Exceptions: None. + // Concurrency: Reentrant. + // Notes: If the specified domain is not in the System, then NULL is + // returned. + // + // End Function Specification **************************************** + + void AddChips(ChipContainerIterator begin, + ChipContainerIterator end); + // Function Specification ******************************************** + // + // Purpose: Adds a Chips to the system + // Parameters: begin: Iterator to first Chip to add + // end: Iterator to end Chip to add + // Returns: No value returned. + // Requirements: None. + // Promises: Pointer to chip stored in system, Pointer ownership assumed + // Exceptions: None. + // Concurrency: Nonreentrant. + // + // End Function Specification **************************************** + + void AddDomains(DomainContainerIterator begin, + DomainContainerIterator end); + // Function Specification ******************************************** + // + // Purpose: Adds Domains to the system + // Parameters: Handle of chip that check stopped + // Returns: No value returned. + // Requirements: None. + // Promises: Pointer Domain stored in system, Pointer ownership assumed + // Exceptions: None. + // Concurrency: Nonreentrant. + // + // End Function Specification **************************************** + + void RemoveStoppedChips(TARGETING::TargetHandle_t i_pChipHandle); //@jl02 Unit Check Stop code added + + // Function Specification ******************************************** + // + // Purpose: Removes a chip from a Domain that this chip is in if we no longer + // want to have the chip within prds view. + // Parameters: chip: Chip ID to be changed. + // Returns: No value returned. + // Requirements: None. + // Promises: None. + // Exceptions: None. + // Concurrency: Nonreentrant. + // + // End Function Specification **************************************** + + void RemoveNonFunctionalChips(); //@jl04 a Add code to remove non functional + // Function Specification ******************************************** + // + // Purpose: Removes chips from a Domain if we no longer + // want to have the chips that are nonfunctional in HOM. + // Parameters: None. + // Returns: No value returned. + // Requirements: None. + // Promises: None. + // Exceptions: None. + // Concurrency: Nonreentrant. + // + // End Function Specification **************************************** + + + virtual void Initialize(); + // Function Specification ******************************************** + // + // Purpose: Initializes all chip and domains + // Parameters: refCode: Reference code to use if error + // stepCode: Step code to use if error + // Returns: No value returned. + // Requirements: None. + // Promises: Initialize function on all chip and domains called unless + // an error occurrs in one of the Initialize functions. + // Exceptions: None. + // Concurrency: Reentrant. + // Notes: The Initialize() function for each Chip and Domain is + // called. If an error code is returned from a Chip or Domain + // Initialize call, then SrcFill is called with the specified + // reference code, step code, and return code. No further calls + // are made when an error occurs. + // + // End Function Specification **************************************** + + virtual int Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType); + // Function Specification ******************************************** + // + // Purpose: Analyze domains for an error + // Parameters: serviceData: Reference to pass back error data in + // attentionType: Indicates attention type + // Returns: Error value + // Requirements: None. + // Promises: ServiceData completed unless error encountered + // Exceptions: None. + // Concurrency: Reentrant. + // Notes: Each Domain is queried using the prioritization sequence. + // The first Domain that returns true from Domain Query() + // will have its Analyze() function called. If + // there are no Domains, then the error code + // NO_DOMAINS_IN_SYSTEM(0xDD20) is returned. If there are no + // Domains at attention, then the error code + // NO_DOMAINS_AT_ATTENTION(0xDD21) is returned. + // + // End Function Specification **************************************** + + private: + + typedef std::vector<CHIP_CLASS *> ChipMapType; + + typedef std::vector<Domain *> DomainContainerType; + + ChipMapType chips; + + DomainContainerType prioritizedDomains; + + Resolution & noAttnResolution; + }; + + +#endif diff --git a/src/usr/diag/prdf/framework/config/iipchip.C b/src/usr/diag/prdf/framework/config/iipchip.C new file mode 100755 index 000000000..6d1ff4718 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipchip.C @@ -0,0 +1,146 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipchip.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1993,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#define IIPCHIP_CPP + +/* Module Description *************************************************/ +/* */ +/* Name: iipchip.cpp */ +/* */ +/* Description: This module contains the implementation for the + Processor Runtime Diagnostics Chip class. */ +/* */ +/* End Module Description *********************************************/ + +/* Change Log *********************************************************/ +/* */ +/* Flag Reason Vers Date Coder Description */ +/* ---- -------- ---- -------- ----- ------------------------------- */ +/* V2ST 07/30/93 JST Initial Creation */ +/* V2ST 08/20/93 JST Added Tables and Analyze() + Converted to ABC */ +/* V300 11/02/93 JST Using Error Register, + ATTENTION_TYPE */ +/* V300 11/02/93 JST Created CHIP_IDENTITY */ +/* V300 01/04/94 JST Analyze() returns Step Code Data + via parameter reference */ +/* V300 01/11/94 JST Removed CHIP_IDENTITY */ +/* V300 01/20/94 JST Removed Analyze() */ +/* V300 05/04/94 JST Added Initialize() */ +/* D24585.5 V300 06/07/94 JST Adding CapruteErrorData() */ +/* V400 07/28/94 JST Removing CapruteErrorData() */ +/* */ +/* End Change Log *****************************************************/ + +/*--------------------------------------------------------------------*/ +/* Emit the virtual function tables and inline function defintions in + this translation unit. */ +/*--------------------------------------------------------------------*/ + +#include <iipchip.h> +#include <prdfPlatServices.H> + +/*--------------------------------------------------------------------*/ +/* Forward References */ +/*--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------*/ +/* User Types */ +/*--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------*/ +/* Constants */ +/*--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------*/ +/* Macros */ +/*--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------*/ +/* Internal Function Prototypes */ +/*--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------*/ +/* Global Variables */ +/*--------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------*/ +/* Static Variables */ +/*--------------------------------------------------------------------*/ + +// Function Specification ////////////////////////////////////////// +// +// Title: ~CHIP_CLASS (Virtual destructor) +// +// Purpose: This destructor does nothing. This declaration is +// provided to enable derived class destuctores to be +// called properly. +// +// Side-effects: None. +// +// Dependencies: None. +// +// End Function Specification ////////////////////////////////////// + +CHIP_CLASS::~CHIP_CLASS +( + void + /*!i No parameters */ + ) +/*!o No value returned */ +{ +} + +// Function Specification ////////////////////////////////////////// +// +// Title: Initialize (Virtual) +// +// Purpose: This function handles the PRD initialization of the +// corresponding hardware chip and any associated data. +// +// This default implementation does nothing and returns +// SUCCESS(0). +// +// Side-effects: Scan comm registers may be written. +// Internal data may be modified. +// +// Dependencies: None. +// +// End Function Specification ////////////////////////////////////// + +int32_t CHIP_CLASS::Initialize +( + void + /*!i No parameters */ + ) +/*!o Error Return code */ +{ + return(SUCCESS); +} + +PRDF::HUID CHIP_CLASS::GetId() const +{ + return(PRDF::PlatServices::getHuid(iv_pchipHandle)); +} + +#undef IIPCHIP_CPP diff --git a/src/usr/diag/prdf/framework/config/iipchip.h b/src/usr/diag/prdf/framework/config/iipchip.h new file mode 100755 index 000000000..193ed9a30 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/iipchip.h @@ -0,0 +1,242 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/iipchip.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1993,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef IIPCHIP_H +#define IIPCHIP_H + +/** + @brief + This module contains the Processor Runtime Diagnostics Chip class declaration. + @file iipchip.h +*/ + + +#if !defined(PRDF_TYPES_H) +#include <prdf_types.h> +#endif + +#if !defined(IIPSDBUG_H) + #include <iipsdbug.h> // for ATTENTION_TYPE +#endif + +#if !defined(PRDF_MAIN_H) + #include <prdfMain.H> +#endif + +#include <iipconst.h> + +/*--------------------------------------------------------------------*/ +/* Forward References */ +/*--------------------------------------------------------------------*/ + +class STEP_CODE_DATA_STRUCT; +class CaptureData; + +/** + CHIP_CLASS - model of hardware chip and functions needed by PRD + + Abstract base class + +@Notes + This Chip specifies a common interface for hardware chips. + Associated with every hardware chip is an index to a data + location in the SP SYS Debug global data area. This index + is specified during instantiation and is maintained + internally. The accessor function GetErrorEntryIndex() + returns this value. Each chip also has a logical ID for + indentifying specific instances. The accessor function + GetId() that this value. +@par + The pure virtual Analyze() function provides a standard + interface for analyzing Chip errors. The basic + algorithm must be defined for each derived class. +@par + The pure virtual MaskError() function provides a standard + interface for masking a Chip error. The basic + mechanism for maksing is defined in each derived class. +@par + Two pure virtual functions are used to provide Chip + specific data for external Manual Ops SCR interfaces. + Chip select parameters are passed to these functions. + Derived classes define the function GetChipSelectValues() + to return an array of these values as needed. The derived + classes must then also define the function + GetChipSelectCount() to return the number of values in + this array. +@par + The virtual Initialize() function provides a standard + interface for initializing the state of the hardware Chip. + This may also involve changing internal data members. A + default implementation will be provided that does + nothing. */ + +class CHIP_CLASS +{ + public: + + /** + Destructor + <ul> + <br><b>Parameters: </b> None + <br><b>Requirements:</b> None. + <br><b>Promises: </b> ojbect destroyed - any resourses deallocated + </ul><br> + */ + virtual ~CHIP_CLASS(); + + /** + Access the target handle for this chip + <ul> + <br><b>Parameters: </b> none + <br><b>Returns: </b> Handle for this chip + <br><b>Requirements:</b> None + <br><b>Promises: </b> None + <br><b>Notes: </b> Not to be used previous to Regatta + </ul><br> + */ + TARGETING::TargetHandle_t GetChipHandle() const + { + return iv_pchipHandle; + } + + /** + Initialize hardware associated with this chip object + <ul> + <br><b>Parameters: </b> parms + <br><b>Returns: </b> return code (usually Mops return code) + <br><b>Requirements:</b> System.build() complete + <br><b>Promises: </b> Hardware state may be modified + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> Default implementation is to do nothing + </ul><br> + */ + virtual int32_t Initialize(); + + /** + * @brief Analyze the error being reported by this chip + * @param data Service Data Collector + * @param attention_type [MACHINE_CHECK | RECOVERED | SPECIAL] + * @return return code (see iipconst.h for PRD return codes) otherwise it's + * a MOPs return code + * @pre Initiialize(). The hardware chip this object represents drove + * attention. + * @post ServiceData complete. Hardware state may be modified. + */ + virtual int32_t Analyze( STEP_CODE_DATA_STRUCT & data, + ATTENTION_TYPE attention_type ) = 0; + + /** + Mask the reporting of an error by the hardware associated with this chip + <ul> + <br><b>Parameters: </b> maskId + <br><b>Returns: </b> return code (usually from MOPs) + <br><b>Requirements:</b> Initialize() + <br><b>Promises: </b> Hardware state modified + </ul><br> + */ + virtual int32_t MaskError( uint32_t error_mask_id ) = 0; + + /** + Capture the contents of certain registers withing the hardware + <ul> + <br><b>Parameters: </b> cd:Capture data object (to store the capture data) + <br><b>Returns: </b> return code (usually from MOPs) + <br><b>Requirements:</b> Initialize() + <br><b>Promises: </b> None. + <br><b>Notes: </b> default is to do nothing + </ul><br> + */ + virtual int32_t CaptureErrorData(CaptureData & cd) + { + return 0; + } + + /** + Returns the HUID of the chip + <ul> + <br><b>Parameters: </b> Nil + <br><b>Returns: </b> HUID of the chip + <br><b>Requirements:</b> chip Handle + <br><b>Promises: </b> None. + <br><b>Notes: </b> default is to do nothing + </ul><br> + */ + PRDF::HUID GetId() const; + + protected: + + /** + Constructor + <ul> + <br><b>Parameters: </b> i_pChipHandle: Handle for this chip + <br><b>Returns: </b> N/A + <br><b>Requirements:</b> Id must be unique + <br><b>Promises: </b> object instanciated + <br><b>Exceptions: </b> None. + </ul><br> + */ + CHIP_CLASS( TARGETING::TargetHandle_t i_pChipHandle ) : + iv_pchipHandle(i_pChipHandle) + {} + + // Function Specification ////////////////////////////////////////// + // + // Title: CHIP_CLASS (Copy constructor) + // + // Purpose: This constructor does nothing. The compiler generated + // function is sufficient. It does not need to be called + // by derived class assingment operators. + // + // Side-effects: This instance is initialized. + // + // Dependencies: None. + // + // End Function Specification ////////////////////////////////////// + + // Function Specification ////////////////////////////////////////// + // + // Title: operator= (assignment operator) + // + // Purpose: This assignment operator does nothing. This defintion + // is provided for an explicit call from a derived class + // assignment operator. It does not need to be called by + // a derived class assignment operator. + // + // Side-effects: None. + // + // Dependencies: None. + // + // End Function Specification ////////////////////////////////////// + + CHIP_CLASS & operator=(const CHIP_CLASS & chip) + { + return(*this); + } + + private: + + TARGETING::TargetHandle_t iv_pchipHandle; + +}; + +#endif diff --git a/src/usr/diag/prdf/framework/config/prdfExDomain.H b/src/usr/diag/prdf/framework/config/prdfExDomain.H new file mode 100644 index 000000000..f284a1654 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfExDomain.H @@ -0,0 +1,55 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfExDomain.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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __PRDFEXDOMAIN_H +#define __PRDFEXDOMAIN_H + +#include <prdfRuleChipDomain.H> + +class PrdfExDomain : public PrdfRuleChipDomain +{ + public: + + /** + * @brief Constructor + * @param i_did The domain ID + * @param i_size The projected size of the domain + */ + PrdfExDomain( DOMAIN_ID i_did, uint32_t i_size = EX_DOMAIN_SIZE ) : + PrdfRuleChipDomain( i_did, i_size ) + {} + + /** + * @brief Query for an attention of a specific type in this domain + * @param i_attnType [MACHINE_CHECK | RECOVERABLE | SPECIAL] + * @return false + * @note This function will always return false. That way PRD will look + * for the attention via the processor chip. + */ + virtual bool Query( ATTENTION_TYPE i_attnType ) + { return false; } + +}; + +#endif /* __PRDFEXDOMAIN_H */ + diff --git a/src/usr/diag/prdf/framework/config/prdfExtensibleChip.H b/src/usr/diag/prdf/framework/config/prdfExtensibleChip.H new file mode 100755 index 000000000..9bd4989c3 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfExtensibleChip.H @@ -0,0 +1,68 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfExtensibleChip.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2004,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __PRDFEXTENSIBLECHIP_H +#define __PRDFEXTENSIBLECHIP_H + +#include <iipscr.h> +#include <iipchip.h> + +#include <prdfPluginDef.H> + +class PrdfDataBundle; + +class PrdfExtensibleChip : public CHIP_CLASS +{ + public: + PrdfExtensibleChip( TARGETING::TargetHandle_t i_target ) : + CHIP_CLASS(i_target) + {}; + + virtual PrdfExtensibleChipFunction * getExtensibleFunction( + const char * i_func, + bool i_expectNull = false ) = 0; + + virtual SCAN_COMM_REGISTER_CLASS * getRegister( + const char * i_reg, + bool i_expectNull = false ) = 0; + + virtual PrdfDataBundle *& getDataBundle() = 0; + + /** + * Add Capture data to the Capture Data object + * @param Capture data object (I/O) + * @param Capture group + */ + virtual int32_t CaptureErrorData( CaptureData &, int i_group = 1 ) = 0; + + virtual uint32_t getSignatureOffset() const = 0; +}; + +class PrdfDataBundle +{ + public: + virtual ~PrdfDataBundle() {}; +}; + +#endif + diff --git a/src/usr/diag/prdf/framework/config/prdfExtensibleDomain.C b/src/usr/diag/prdf/framework/config/prdfExtensibleDomain.C new file mode 100755 index 000000000..a02cfe818 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfExtensibleDomain.C @@ -0,0 +1,75 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfExtensibleDomain.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2009,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#include <string.h> + +#include <prdfExtensibleDomain.H> +#include <prdfPluginMap.H> +#include <prdf_service_codes.H> +#include <errlentry.H> +#include <prdfPfa5Data.h> +#include <iipglobl.h> + +PrdfExtensibleDomainFunction * + PrdfExtensibleDomain::getExtensibleFunction(const char * i_func, + bool i_expectNull) +{ + PrdfExtensibleFunctionType * plugin = + prdfGetPluginGlobalMap().getPlugins(iv_domainName)[i_func]; + if (NULL == plugin) + { + static PrdfPlugin<PrdfExtensibleDomain> l_nullPlugin(NULL); + plugin = &l_nullPlugin; + + if (!i_expectNull) + { + errlHndl_t l_errl = NULL; + PRDF_CREATE_ERRL(l_errl, + ERRL_SEV_UNRECOVERABLE, + ERRL_ETYPE_NOT_APPLICABLE, + SRCI_ERR_INFO, + SRCI_NO_ATTR, + PRDF_EXTENSIBLEDOMAIN, + LIC_REFCODE, + PRDF_CODE_FAIL, + __LINE__, + 0, 0, 0); + PRDF_ADD_FFDC(l_errl, + iv_domainName, + strlen(iv_domainName), + prdfErrlVer1, + prdfErrlString); + + PRDF_ADD_FFDC(l_errl, + i_func, + strlen(i_func), + prdfErrlVer1, + prdfErrlString); + + PRDF_COMMIT_ERRL(l_errl, ERRL_ACTION_REPORT); + delete l_errl; + } + } + + return (PrdfExtensibleDomainFunction *) plugin; +} diff --git a/src/usr/diag/prdf/framework/config/prdfExtensibleDomain.H b/src/usr/diag/prdf/framework/config/prdfExtensibleDomain.H new file mode 100755 index 000000000..cd8a7f829 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfExtensibleDomain.H @@ -0,0 +1,57 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfExtensibleDomain.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2009,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __PRDFEXTENSIBLEDOMAIN_H +#define __PRDFEXTENSIBLEDOMAIN_H + +#include <prdfPluginDef.H> +#include <prdfExtensibleChip.H> + +class PrdfExtensibleDomain +{ + public: + PrdfExtensibleDomain(const char * i_domainName) : + iv_domainName(i_domainName), iv_dataBundle(NULL) {}; + + virtual ~PrdfExtensibleDomain() + { + if (NULL != iv_dataBundle) + { + delete iv_dataBundle; + iv_dataBundle = NULL; + } + }; + + virtual PrdfExtensibleDomainFunction * + getExtensibleFunction(const char * i_func, + bool i_expectNull = false); + + virtual PrdfDataBundle *& getDataBundle() { return iv_dataBundle; }; + + private: + const char * iv_domainName; + PrdfDataBundle * iv_dataBundle; + +}; + +#endif //__PRDFEXTENSIBLEDOMAIN_H diff --git a/src/usr/diag/prdf/framework/config/prdfFabricDomain.C b/src/usr/diag/prdf/framework/config/prdfFabricDomain.C new file mode 100755 index 000000000..1998da4c8 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfFabricDomain.C @@ -0,0 +1,523 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfFabricDomain.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2002,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: +// +// End Module Description ********************************************** + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- +#define prdfFabricDomain_C + +#include <iipglobl.h> +#include <iipstep.h> +#include <iipsdbug.h> +#include <iipErrorRegister.h> +#include <iipServiceDataCollector.h> +#include <prdfFabricDomain.H> +#include <UtilHash.H> +#include <prdfPluginDef.H> + +#include <prdfPlatServices.H> + +#include <algorithm> + +#undef prdfFabricDomain_C +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- +int32_t FabricDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType) +{ + using namespace PRDF; + + int32_t l_rc; + l_rc = DomainContainer<PrdfRuleChip>::Analyze(serviceData, attentionType); + + + if( l_rc == PRD_POWER_FAULT ) + { + PRDF_ERR( "PrdfFabricDomain::Analyze::Power Fault detected!" ); + } + else + { + // Capture Global FIRs on xstp and recovered errors for domain. + if ((attentionType == MACHINE_CHECK) || (attentionType == RECOVERABLE)) + { + for (uint32_t i = 1; i < GetSize(); ++i) // start at 1 to skip analyzed. + { + LookUp(i)->CaptureErrorData( + serviceData.service_data->GetCaptureData(), + Util::hashString("GlobalFIRs")); + + if (attentionType == MACHINE_CHECK) + { + LookUp(i)->CaptureErrorData( + serviceData.service_data->GetCaptureData(), + Util::hashString("AllFIRs")); + } + } + } + } + + return l_rc; +} + +void FabricDomain::Order(ATTENTION_TYPE attentionType) +{ + using namespace PRDF; + using PrdfPluginDef::bindParm; + + if (attentionType == MACHINE_CHECK) + { + SortForXstop(); + + } + else if (attentionType == RECOVERABLE) + { + SortForRecov(); + } + else // Recovered or Special + { + SYSTEM_DEBUG_CLASS sysdbug; + for (int32_t i = (GetSize() - 1); i >= 0; --i) //pw03 + { + PrdfRuleChip * l_fabChip = LookUp(i); + TARGETING::TargetHandle_t l_pchipHandle = l_fabChip->GetChipHandle(); + if ((sysdbug.IsAttentionActive(l_pchipHandle)) && + (sysdbug.GetAttentionType(l_pchipHandle ) == attentionType)) + { + MoveToFront(i); //pw03 + break; + } + } + } +} + +// Determine the proper sorting for a checkstop based on: +// 1. Find only a single chip with an internal checkstop +// 2. Graph reduction algorithm +// 3. WOF/TOD counters +void FabricDomain::SortForXstop() +{ + using namespace PrdfPluginDef; + using namespace TARGETING; + + uint32_t l_internalOnlyCount = 0; + int l_chip = 0; + + uint64_t l_externalDrivers[GetSize()]; + uint64_t l_wofValues[GetSize()]; + bool l_internalCS[GetSize()]; + + union { uint64_t * u; CPU_WORD * c; } ptr; // zs01 + + // Get internal setting and external driver list for each chip. + for(uint32_t i = 0; i < GetSize(); ++i) + { + l_externalDrivers[i] = 0; + l_wofValues[i] = 0; + + PrdfRuleChip * l_fabChip = LookUp(i); + + ptr.u = &l_externalDrivers[i]; // zs01 + prdfBitString l_externalChips(GetSize(), ptr.c); // zs01 + TargetHandleList l_tmpList; + + // Call "GetCheckstopInfo" plugin. + PrdfExtensibleChipFunction * l_extFunc + = l_fabChip->getExtensibleFunction("GetCheckstopInfo"); + + (*l_extFunc)(l_fabChip, + bindParm<bool &, TargetHandleList &, uint64_t &> + (l_internalCS[i], + l_tmpList, + l_wofValues[i] + ) + ); + + + // Update bit buffer. + for (TargetHandleList::iterator j = l_tmpList.begin(); + j != l_tmpList.end(); ++j) + { + for (uint32_t k = 0; k < GetSize(); k++) + if ((*j) == LookUp(k)->GetChipHandle()) + l_externalChips.Set(k); + }; + + // Check if is internal. + if (l_internalCS[i]) + { + l_internalOnlyCount++; + l_chip = i; + } + } + + // Check if we are done... only one with an internal error. + if (1 == l_internalOnlyCount) + { + MoveToFront(l_chip); //pw03 + return; + } + else if (0 == l_internalOnlyCount) + { + // TODO : add trace here... continue with analysis to determine + // which chip origined though. + } + + // --- Do graph reduction --- + // Currently does not do cycle elimination. + + // Get initial list (all chips). + BIT_STRING_BUFFER_CLASS l_current(GetSize()); + l_current.Pattern(0,GetSize(),0xFFFFFFFF, 32); // turn on all bits. + + // Do reduction. + // When done, l_prev will have the minimal list. + BIT_STRING_BUFFER_CLASS l_prev(GetSize()); + l_prev.Clear(); + + while ((!(l_current == l_prev)) && (!l_current.IsZero())) + { + l_prev = l_current; + l_current.Clear(); + + for (uint32_t i = 0; i < GetSize(); i++) + { + if (l_prev.IsSet(i)) // skip if this chip isn't in the pool. + for (uint32_t j = 0; j < GetSize(); j++) + { + ptr.u = &l_externalDrivers[i]; // zs01 + if ( prdfBitString(GetSize(), ptr.c).IsSet(j) ) // zs01 + l_current.Set(j); + } + } + } + + // Hopefully, we got just one chip left... + if (1 == l_prev.GetSetCount()) + { + // Now find it. + for (uint32_t i = 0; i < GetSize(); i++) + if ((l_prev.IsSet(i)) && + (l_internalCS[i] || (0 == l_internalOnlyCount))) + { + MoveToFront(i); //pw03 + return; + } + } + + // --- Do WOF compare --- + uint32_t l_minWof = 0; + for (uint32_t i = 0; i < GetSize(); i++) + { + // Search for minimum WOF value. + if (l_wofValues[i] < l_wofValues[l_minWof]) + // Only choose chips with internal checkstop, + // unless no internals. + if ((l_internalCS[i] || (0 == l_internalOnlyCount))) + l_minWof = i; + } + MoveToFront(l_minWof); //pw03 + return; + +}; + +namespace __prdfFabricDomain // pw03 --- +{ + // This function is used for the std::max_element function in SortForRecov + // to ensure that elements towards the end of the list are favored (and + // therefore preventing starvation of chips at the end of the domain list) + inline bool lessThanOperator(uint32_t & l, uint32_t & r) + { + if (l == r) + { + return ((void *)&l) < ((void *)&r); + } + return l < r; + } +}; // --- pw03 + +void FabricDomain::SortForRecov() +{ + using namespace PRDF; + using namespace PrdfPluginDef; + + SYSTEM_DEBUG_CLASS sysdbug; + uint32_t l_sev[GetSize()]; + std::fill(&l_sev[0], &l_sev[GetSize()], 0); + + // Loop through all chips. + for (uint32_t i = 0; i < GetSize(); ++i) + { + PrdfRuleChip * l_fabChip = LookUp(i); + TARGETING::TargetHandle_t l_pchipHandle = l_fabChip->GetChipHandle(); + if (sysdbug.IsAttentionActive(l_pchipHandle)) // If at attention, check. + { + + if (RECOVERABLE == sysdbug.GetAttentionType( l_pchipHandle)) + { + // Recovered, set sev 1. + l_sev[i] = 1; + } + else if (CHECK_STOP == sysdbug.GetAttentionType(l_pchipHandle)) + { + // Check for recovered error at checkstop. + PrdfExtensibleChipFunction * l_extFunc + = l_fabChip->getExtensibleFunction("CheckForRecovered"); + + bool l_hasRer = false; + + (*l_extFunc)(l_fabChip, bindParm<bool &>(l_hasRer)); + + if (l_hasRer) + { + // Has a recovered error, sev 1. + l_sev[i] = 1; + } + } + + // Find real severity level. + if (0 != l_sev[i]) + { + PrdfExtensibleChipFunction * l_extFunc + = l_fabChip->getExtensibleFunction( + "CheckForRecoveredSev"); + + uint32_t l_cSev = 1; + (*l_extFunc)(l_fabChip, bindParm<uint32_t &>(l_cSev)); + + l_sev[i] = l_cSev; + } + } + } + + // Find item with highest severity. + MoveToFront(std::distance(&l_sev[0], + std::max_element(&l_sev[0], + &l_sev[GetSize()], + __prdfFabricDomain::lessThanOperator)) + ); //pw03 +} + + +//Analyze a subset of chips in a Domain... +//This is a mini analysis of some of the chips in the Fabric Domain. +int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips) +{ + using namespace TARGETING ; + PRDF_DENTER( "FabricDomain::AnalyzeTheseChips" ); + int32_t l_rc = ~SUCCESS; + + PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips:: Domain ID = 0x%X", GetId() ); + + if(i_chips.size() != 0) + { + + for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + { + PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Before--chip=0x%X", + PRDF::PlatServices::getHuid(*i)); + } + + OrderTheseChips(attentionType, i_chips); + + for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + { + PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::After--chip=0x%X", + PRDF::PlatServices::getHuid(*i) ); + } + //After the Order function is called the first chip should contain the chip to look at. + //Look here for the correct LookUp function. I don't think this is working. + PrdfRuleChip * l_fabChip = FindChipInTheseChips(i_chips[0], i_chips); + PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Analyzing this one: 0x%X", + l_fabChip->GetId() ); + if(NULL != l_fabChip) + { + l_rc = l_fabChip->Analyze(serviceData, attentionType); + } + else + { + PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::l_fabChip is NULL" ); + l_rc = ~SUCCESS; + } + } + else + { + PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::i_chips = %d", + i_chips.size() ); + } + + //Get P7 chip Global FIR data for FFDC + for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + { + PrdfRuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); + l_fabChip->CaptureErrorData( + serviceData.service_data->GetCaptureData(), + Util::hashString("GlobalFIRs")); + } + + + PRDF_DEXIT( "FabricDomain::AnalyzeTheseChips" ); + return l_rc; +} + + +int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips) +{ + using namespace PrdfPluginDef; + using namespace TARGETING; + PRDF_DENTER( "FabricDomain::OrderTheseChips" ); + + uint32_t l_internalOnlyCount = 0; + uint64_t l_externalDrivers[i_chips.size()]; + uint64_t l_wofValues[i_chips.size()]; + bool l_internalCS[i_chips.size()]; + + union { uint64_t * u; CPU_WORD * c; } ptr; + + uint32_t l_chip = 0; + uint32_t l_chipToFront = 0; + // Get internal setting and external driver list for each chip. + for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + { + + PrdfRuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); + + ptr.u = &l_externalDrivers[l_chip]; + prdfBitString l_externalChips(i_chips.size(), ptr.c); + TargetHandleList l_tmpList; + + if(l_fabChip != NULL) + { + // Call "GetCheckstopInfo" plugin. + PrdfExtensibleChipFunction * l_extFunc + = l_fabChip->getExtensibleFunction("GetCheckstopInfo"); + + (*l_extFunc)(l_fabChip, + bindParm<bool &, TargetHandleList &, uint64_t &> + (l_internalCS[l_chip], + l_tmpList, + l_wofValues[l_chip] + ) + ); + } + else + { + l_internalCS[l_chip] = false; + PRDF_DTRAC( "FabricDomain::OrderTheseChips: l_fabChip is NULL" ); + } + + //If we are just checking for internal errors then there is no need for + //a list of what chips sent checkstops where. + // Update bit buffer. + for (TargetHandleList::iterator j = l_tmpList.begin(); + j != l_tmpList.end(); + ++j) + { + for (uint32_t k = 0; k < i_chips.size(); k++) + if ((*j) == LookUp(k)->GetChipHandle()) + l_externalChips.Set(k); + }; + + // Check if is internal. + if (l_internalCS[l_chip]) + { + l_internalOnlyCount++; + l_chipToFront = l_chip; + } + l_chip++; //Move to next chip in the list. + } + + // Check if we are done... only one with an internal error. + if (1 == l_internalOnlyCount) + { + MoveToFrontInTheseChips(l_chipToFront, i_chips); + return(SUCCESS); + } + + PRDF_DEXIT( "FabricDomain::OrderTheseChips" ); + return(SUCCESS); +} + +//This function is to ensure the order of the chip in the list is the correct chip. +//Because there is no garaunteed order within the domain container this is necessary. +PrdfRuleChip * FabricDomain::FindChipInTheseChips(TARGETING::TargetHandle_t i_pchipHandle, TARGETING::TargetHandleList & i_chips) +{ + using namespace TARGETING; + + PRDF_DENTER( "FabricDomain::FindChipNumber" ); + PrdfRuleChip * l_fabChip = NULL; + TargetHandle_t l_tmpfabHandle= NULL; + // Loop through all chips. + for (TargetHandleList::iterator iter = i_chips.begin(); iter != i_chips.end(); ++iter) + { + for (uint32_t i = 0; i < GetSize(); ++i) + { + l_fabChip = LookUp(i); + l_tmpfabHandle = l_fabChip->GetChipHandle(); + if( (l_tmpfabHandle == (*iter)) && (l_tmpfabHandle == i_pchipHandle) ) return(l_fabChip); + } + } + + PRDF_DEXIT( "FabricDomain::FindChipNumber" ); + return(NULL); +} + +//Swaps chip at location 0 with a chip at location i_chipToFront +void FabricDomain::MoveToFrontInTheseChips(uint32_t i_chipToFront, TARGETING::TargetHandleList & i_chips) +{ + using namespace TARGETING; + + for (TargetHandleList::iterator i = i_chips.begin()+i_chipToFront; i != i_chips.begin(); i--) + { + std::swap((*i), (*(i-1))); + } +} diff --git a/src/usr/diag/prdf/framework/config/prdfFabricDomain.H b/src/usr/diag/prdf/framework/config/prdfFabricDomain.H new file mode 100755 index 000000000..2d2af704c --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfFabricDomain.H @@ -0,0 +1,163 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfFabricDomain.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2002,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef prdfFabricDomain_H +#define prdfFabricDomain_H + +//-------------------------------------------------------------------- +// Includes +//-------------------------------------------------------------------- +#if !defined(iipCallResolutionTemplate_h) + #include <iipCallResolutionTemplate.h> +#endif + +#include <prdfRuleChipDomain.H> +#include <prdfPlatServices.H> + +//-------------------------------------------------------------------- +// Forward References +//-------------------------------------------------------------------- +/** + @file prdfFabricDomain.H + @brief Fabric Domain, contains Fabric Chips + @author Mike Kobler +*/ +class FabricDomain : public PrdfRuleChipDomain +{ + public: + + /** + * @brief Constructor + * @param i_did The domain ID + * @param i_size The projected size of the domain + */ + FabricDomain( DOMAIN_ID i_did, uint32_t i_size = PROC_DOMAIN_SIZE ) : + PrdfRuleChipDomain( i_did, i_size ) + {} + + /* + Destructor + <ul> + <br><b>Parameters: </b> None. + <br><b>Returns: </b> No value returned + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> Compiler default sufficient + </ul><br> + */ + //~FabricDomain(); + + /* + Determin which chip to Analyze and call it's Analyze() function + <ul> + <br><b>Parameter: </b> serviceData (See iipServiceDataCollector.h) + <br><b>Parameter: </b> attentionType [MACHINE_CHECK|RECOVERED|SPECIAL] + <br><b>Returns: </b> return code (0 == SUCCESS) + <br><b>Requirements:</b> Query() == true, Initialize() + <br><b>Promises: </b> serviceData complete + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> This implementation calls Order() to determin + which chip to analyze and calls that chips + Analyze() function. + </ul><br> + */ + virtual int32_t Analyze( STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType ); + + /** + * @brief Determine which chip to Analyze in a list of chips in this domain. + * @note This main only analyze one chip in the domain. Not the whole domain. + * @param serviceData Service data collector. + * @param attentionType Attention of the chip. + * @param i_chips List of chips in the domain to analyze. + * @return SUCCESS + */ + virtual int32_t AnalyzeTheseChips( STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips ); + /** + * @brief Order chips in a list of chips in this domain. + * @note + * @param attentionType Attention of the chip. + * @param i_chips List of chips in the domain to analyze. + * @return SUCCESS + */ + virtual int32_t OrderTheseChips( ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips ); + + /** + * @brief Finds the pointer to the appropriate chip to do analysis or other. + * @note Just a function to help keep order in a subset of the domain. + * @param i_chipId Handle of the chip to find. + * @param i_chips List of chips in the domain to analyze. + * @return SUCCESS + */ + virtual PrdfRuleChip * FindChipInTheseChips( TARGETING::TargetHandle_t i_chipId, + TARGETING::TargetHandleList & i_chips ); + + /** + * @brief Moves the chip in question to the front of the list of chips. + * @note This gives analysis some good chance of finding the correct chip first. + * @param i_chipToFront The chip that should be in the front of the list. + * @param i_chips List of chips in the domain to analyze. + * @return SUCCESS + */ + virtual void MoveToFrontInTheseChips( uint32_t i_chipToFront, + TARGETING::TargetHandleList & i_chips ); + +protected: + + /** + Determin which chip to Analyze and call it's Analyze() function + <ul> + <br><b>Parameter: </b> attentionType [MACHINE_CHECK|RECOVERED|SPECIAL] + <br><b>Returns: </b> return code (0 == SUCCESS) + <br><b>Requirements:</b> Query() == true, Initialize() + <br><b>Promises: </b> chip at attention at top of list + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + virtual void Order(ATTENTION_TYPE attentionType); + + /** + Determine which chip to Analyze on checkstop and put at front of list. + <ul> + <br><b>Parameters: </b> None. + <br><b>Returns: </b> None. + <br><b>Requirements:</b> Query() == true, Initialize() + <br><b>Promises: </b> chip at attention at top of list + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + virtual void SortForXstop(); + virtual void SortForRecov(); + +private: // functions +private: // Data + +}; + +#endif /* prdfFabricDomain_H */ diff --git a/src/usr/diag/prdf/framework/config/prdfMbaDomain.H b/src/usr/diag/prdf/framework/config/prdfMbaDomain.H new file mode 100644 index 000000000..aff411447 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfMbaDomain.H @@ -0,0 +1,55 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfMbaDomain.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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __PRDFMBADOMAIN_H +#define __PRDFMBADOMAIN_H + +#include <prdfRuleChipDomain.H> + +class PrdfMbaDomain : public PrdfRuleChipDomain +{ + public: + + /** + * @brief Constructor + * @param i_did The domain ID + * @param i_size The projected size of the domain + */ + PrdfMbaDomain( DOMAIN_ID i_did, uint32_t i_size = MBA_DOMAIN_SIZE ) : + PrdfRuleChipDomain( i_did, i_size ) + {} + + /** + * @brief Query for an attention of a specific type in this domain + * @param i_attnType [MACHINE_CHECK | RECOVERABLE | SPECIAL] + * @return false + * @note This function will always return false. That way PRD will look + * for the attention via the memory buffer chip. + */ + virtual bool Query( ATTENTION_TYPE i_attnType ) + { return false; } + +}; + +#endif /* __PRDFMBADOMAIN_H */ + diff --git a/src/usr/diag/prdf/framework/config/prdfMcsDomain.H b/src/usr/diag/prdf/framework/config/prdfMcsDomain.H new file mode 100644 index 000000000..a5a4ea21d --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfMcsDomain.H @@ -0,0 +1,55 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfMcsDomain.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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __PRDFMCSDOMAIN_H +#define __PRDFMCSDOMAIN_H + +#include <prdfRuleChipDomain.H> + +class PrdfMcsDomain : public PrdfRuleChipDomain +{ + public: + + /** + * @brief Constructor + * @param i_did The domain ID + * @param i_size The projected size of the domain + */ + PrdfMcsDomain( DOMAIN_ID i_did, uint32_t i_size = MCS_DOMAIN_SIZE ) : + PrdfRuleChipDomain( i_did, i_size ) + {} + + /** + * @brief Query for an attention of a specific type in this domain + * @param i_attnType [MACHINE_CHECK | RECOVERABLE | SPECIAL] + * @return false + * @note This function will always return false. That way PRD will look + * for the attention via the processor chip. + */ + virtual bool Query( ATTENTION_TYPE i_attnType ) + { return false; } + +}; + +#endif /* __PRDFMCSDOMAIN_H */ + diff --git a/src/usr/diag/prdf/framework/config/prdfMembufDomain.H b/src/usr/diag/prdf/framework/config/prdfMembufDomain.H new file mode 100644 index 000000000..9890cc9b9 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfMembufDomain.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfMembufDomain.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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __PRDFMEMBUFDOMAIN_H +#define __PRDFMEMBUFDOMAIN_H + +#include <prdfRuleChipDomain.H> + +class PrdfMembufDomain : public PrdfRuleChipDomain +{ + public: + + /** + * @brief Constructor + * @param i_did The domain ID + * @param i_size The projected size of the domain + */ + PrdfMembufDomain( DOMAIN_ID i_did, uint32_t i_size = MEMBUF_DOMAIN_SIZE ) : + PrdfRuleChipDomain( i_did, i_size ) + {} + +}; + +#endif /* __PRDFMEMBUFDOMAIN_H */ + diff --git a/src/usr/diag/prdf/framework/config/prdfParentDomain.C b/src/usr/diag/prdf/framework/config/prdfParentDomain.C new file mode 100755 index 000000000..4c265a387 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfParentDomain.C @@ -0,0 +1,106 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfParentDomain.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: This module provides the implementation for the PRD +// DomainContainer class. +// +// End Module Description ********************************************** + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- + +#include <iipglobl.h> +#include <iipDomain.h> +#include <prdfPllDomain.H> + +#include <prdfParentDomain.H> +#include <prdfExtensibleDomain.H> +#include <prdfPluginDef.H> + +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- + + +//Constructor +template<class T> +ParentDomain<T>::ParentDomain() +{ + //TODO::Do I need to have this here to clear out the vector? + VectorOfDomainPointerType iv_childrenDomains(); +} + + +//This code is primarily for the configurator. +template<class T> +int32_t ParentDomain<T>::AddChild(TARGETING::TargetHandle_t i_pchipHandle, T * i_childDomain) +{ + int32_t l_rc = SUCCESS; + + ChipToDomainPointerPairType l_chipDomPtrPair + = ChipToDomainPointerPairType(i_pchipHandle, i_childDomain); + iv_childrenDomains.push_back(l_chipDomPtrPair); + return(l_rc); +} + +//Just getting an iterator to go through the vector of chip/domain pairs. +template<class T> +typename ParentDomain<T>::iterator ParentDomain<T>::getBeginIterator() +{ + return(iv_childrenDomains.begin()); +} + +template<class T> +typename ParentDomain<T>::iterator ParentDomain<T>::getEndIterator() +{ + return(iv_childrenDomains.end()); +} + + +//This instance of ParentDomain has to remain after the definition +// of the Templated class function or it won't link correctly. +template class ParentDomain<PrdfExtensibleDomain>; + diff --git a/src/usr/diag/prdf/framework/config/prdfParentDomain.H b/src/usr/diag/prdf/framework/config/prdfParentDomain.H new file mode 100755 index 000000000..7ca9b3ff4 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfParentDomain.H @@ -0,0 +1,129 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfParentDomain.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 1996,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef prdfParentDomain_H +#define prdfParentDomain_H + +#include <prdfRuleChip.H> +#include <vector> + +/** + Template class that Define a domain Parent that contain other domains as children. + @par + @note Parent class: Domain + @par Usage Examples: + @code + @endcode +*/ +template <typename T> +class ParentDomain +{ +public: + + //The information stored for chaining Domains is two things. a Chip of origin. + // Also, a pointer the the child domain. The child domain is the next domain in + // a potential chain or string of domains. The chip is the original chip that started it. + + typedef std::pair< TARGETING::TargetHandle_t, T * > ChipToDomainPointerPairType; + typedef std::vector< ChipToDomainPointerPairType > VectorOfDomainPointerType; + // Need to add typename here to tell the compiler that vector< ... >::iterator is a type. + // Otherwise because of the T template parm it doesn't know it's a type yet. + typedef typename std::vector< ChipToDomainPointerPairType >::iterator iterator; + + /** + Constructor + <ul> + <br><b>Parameter: </b> domainId: Identifies the Domain (See iipconst.h) + <br><b>Parameter: </b> size: Estimate of max number of chips in domain + <br><b>Returns: </b> None. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> Object created + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + ParentDomain(); + + /** + Add Children to this chip in this domain. + <ul> + <br><b>Parameter: </b> domainId: Identifies the Domain (See iipconst.h) + <br><b>Parameter: </b> chip: Parent to add children to. + <br><b>Parameter: </b> chipList: List of children to add to this Parent. + <br><b>Returns: </b> SUCCESS or FAILURE. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> Object created + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + int32_t AddChild(TARGETING::TargetHandle_t i_pchipHandle, T * i_childDomain); + + /** + Returns a begin iterator to a list of children domains. + <ul> + <br><b>Parameter: </b> None. + <br><b>Returns: </b> begin iterator. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + iterator getBeginIterator(); + + /** + Returns a end iterator to a list of children domains. + <ul> + <br><b>Parameter: </b> None. + <br><b>Returns: </b> end iterator. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + iterator getEndIterator(); + + /** + Prints out the ids of the parent chip and children domains. + <ul> + <br><b>Parameter: </b> None + <br><b>Returns: </b> begin iterator. + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + <br><b>Notes: </b> + </ul><br> + */ + void printChildrenIds(); + +protected: + +private: + + VectorOfDomainPointerType iv_childrenDomains; + +}; + +#endif diff --git a/src/usr/diag/prdf/framework/config/prdfPllDomain.C b/src/usr/diag/prdf/framework/config/prdfPllDomain.C new file mode 100755 index 000000000..464442d7e --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfPllDomain.C @@ -0,0 +1,284 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfPllDomain.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2003,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfPllDomain.C + * @brief Definition of PllDomain class + */ + +#include <CcAutoDeletePointer.h> +#include <iipscr.h> +#include <iipsdbug.h> +#include <iipServiceDataCollector.h> +#include <prdfErrorSignature.H> +#include <prdfPllDomain.H> +#include <iipResolution.h> +#include <prdfPlatServices.H> +#include <prdfPluginDef.H> +#include <iipglobl.h> +#include <iipSystem.h> + +namespace PRDF +{ + +//------------------------------------------------------------------------------ + +int32_t PllDomain::Initialize(void) +{ + + int32_t rc = SUCCESS; + if(PlatServices::isMasterFSP()) + { +//@jl01 D-START +//Deleting the call of the ClearPll error. +//These errors used to have to be cleared before you tried to use the chips. +//However, the inits from other comps are better are cleaning up the PLL errors. +// for (unsigned int i = 0; i < GetSize() && rc == SUCCESS; ++i) +// { +// PrdfExtensibleChip * l_chip = LookUp(i); +// PrdfExtensibleFunction * l_clearPll = l_chip->getExtensibleFunction("ClearPll"); + // Call ClearPll on this chip (see prdfPluginDef.H for bindParm defn) +// (*l_clearPll)(l_chip,PrdfPluginDef::bindParm<void *>(NULL)); +//@jl01 D-END + +// Don't unmask 04/20/2006 Review +// PrdfExtensibleFunction * l_unmask = l_chip->getExtensibleFunction("UnmaskPll"); +// (*l_unmask)(l_chip,PrdfPluginDef::bindParm<void *>(NULL)); +// } + } + return(rc); +} + +//------------------------------------------------------------------------------ + +bool PllDomain::Query(ATTENTION_TYPE attentionType) +{ + bool atAttn = false; + // System always checks for RE's first, even if there is an XSTOP + // So we only need to check for PLL errors on RECOVERABLE type + if(attentionType == RECOVERABLE) + { + // check sysdbug for attention first + SYSTEM_DEBUG_CLASS sysdbug; + for(unsigned int index = 0; (index < GetSize()) && (atAttn == false); + ++index) + { + if(sysdbug.IsAttentionActive(LookUp(index)->GetChipHandle())) + { + PrdfExtensibleChip * l_chip = LookUp(index); + PrdfExtensibleChipFunction * l_query = + l_chip->getExtensibleFunction("QueryPll"); + int32_t rc = (*l_query)(l_chip,PrdfPluginDef::bindParm<bool &>(atAttn)); + // if rc then scom read failed - Error log has already been generated + if( PRD_POWER_FAULT == rc ) + { + PRDF_ERR( "prdfPllDomain::Query() Power Fault detected!" ); + break; + } + else if(SUCCESS != rc) + { + PRDF_ERR( "prdfPllDomain::Query() SCOM fail. RC=%x", rc ); + } + } + } + } + + return(atAttn); +} + +//------------------------------------------------------------------------------ + +int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType) +{ + typedef PrdfExtensibleChip * ChipPtr; + CcAutoDeletePointerVector<ChipPtr> chip(new ChipPtr[GetSize()]); + int count = 0; + int32_t rc = SUCCESS; + + // Due to clock issues some chips may be moved to non-functional during + // analysis. In this case, these chips will need to be removed from their + // domains. + typedef std::vector<PrdfExtensibleChip *> NonFuncChips; + NonFuncChips nfchips; + + // Count # of chips that had PLL error + for(unsigned int index = 0; index < GetSize(); ++index) + { + PrdfExtensibleChip * l_chip = LookUp(index); + PrdfExtensibleChipFunction * l_query = l_chip->getExtensibleFunction("QueryPll"); + bool atAttn; + rc = (*l_query)(l_chip,PrdfPluginDef::bindParm<bool &>(atAttn)); + if(atAttn == true) + { + chip()[count] = LookUp(index); + ++count; + l_chip->CaptureErrorData(serviceData.service_data->GetCaptureData()); + } + else if ( !PlatServices::isFunctional(l_chip->GetChipHandle()) ) + { + // The chip is now non-functional. + nfchips.push_back( l_chip ); + } + } + + // Remove all non-functional chips. + for ( NonFuncChips::iterator i = nfchips.begin(); i != nfchips.end(); i++ ) + { + systemPtr->RemoveStoppedChips( (*i)->GetChipHandle() ); + } + + // always suspect the clock source + closeClockSource.Resolve(serviceData); // dg06c + if(&closeClockSource != &farClockSource) + { + farClockSource.Resolve(serviceData); // dg06c + } + + // If only one detected the error, add it to the callout list. + if ( 1 == count ) + { + const uint32_t tmpCount = serviceData.service_data->GetMruList().size(); + + // Call this chip's CalloutPll plugin if it exists. + PrdfExtensibleChipFunction * l_callout = + chip()[0]->getExtensibleFunction( "CalloutPll", true ); + if ( NULL != l_callout ) + { + (*l_callout)( chip()[0], + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT &>(serviceData) ); + } + + if ( tmpCount == serviceData.service_data->GetMruList().size() ) + { + // No additional callouts were made so add this chip to the list. + serviceData.service_data->SetCallout( chip()[0]->GetChipHandle()); + } + } + + iv_threshold.Resolve(serviceData); + // Test for threshold + if(serviceData.service_data->IsAtThreshold()) + { + // Mask in all chips in domain + PrdfExtensibleDomainFunction * l_mask = getExtensibleFunction("MaskPll"); + (*l_mask)(this, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); + } + // Set Signature + serviceData.service_data->GetErrorSignature()->setChipId(chip()[0]->GetId()); + serviceData.service_data->GetErrorSignature()->setRegId(PRDF_PLL_ERROR); + + // Set dump flag dg09a + serviceData.service_data->SetDump(iv_dumpContent,chip()[0]->GetChipHandle()); + + // Clear PLLs from this domain. + PrdfExtensibleDomainFunction * l_clear = getExtensibleFunction("ClearPll"); + (*l_clear)(this, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); + + // Run any PLL Post Analysis functions from this domain. + for(int i = 0; i < count; i++) + { + PrdfExtensibleChip * l_chip = chip()[i]; + // Send any special messages indicating there was a PLL error. + PrdfExtensibleChipFunction * l_pllPostAnalysis = + l_chip->getExtensibleFunction("PllPostAnalysis", true); + (*l_pllPostAnalysis)(l_chip, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); + } + + return rc; +} + +//------------------------------------------------------------------------------ + +void PllDomain::Order(ATTENTION_TYPE attentionType) +{ + // Order is not important for PLL errors +} + +//------------------------------------------------------------------------------ + +int32_t PllDomain::ClearPll( PllDomain * i_domain, + STEP_CODE_DATA_STRUCT i_sc ) +{ + // Clear children chips. + for ( uint32_t i = 0; i < i_domain->GetSize(); i++ ) + { + PrdfExtensibleChip * l_chip = i_domain->LookUp(i); + PrdfExtensibleChipFunction * l_clear = + l_chip->getExtensibleFunction("ClearPll"); + (*l_clear)( l_chip, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + } + + // Clear children domains. + // This looks like a recursive call. It calls other domains of Clear. + ParentDomain<PrdfExtensibleDomain>::iterator i; + for (i = i_domain->getBeginIterator(); i != i_domain->getEndIterator(); i++) + { + // Clear PLLs from this domain. + PrdfExtensibleDomainFunction * l_clear = + (i->second)->getExtensibleFunction("ClearPll"); + (*l_clear)( i->second, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + } + + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( PllDomain, ClearPll ); + +//------------------------------------------------------------------------------ + +int32_t PllDomain::MaskPll( PllDomain * i_domain, + STEP_CODE_DATA_STRUCT i_sc ) +{ + // Mask children chips. + for ( uint32_t i = 0; i < i_domain->GetSize(); i++ ) + { + PrdfExtensibleChip * l_chip = i_domain->LookUp(i); + PrdfExtensibleChipFunction * l_mask = + l_chip->getExtensibleFunction("MaskPll"); + (*l_mask)( l_chip, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + } + + // Mask children domains. + // This looks like a recursive call. It calls other domains of Mask. + ParentDomain<PrdfExtensibleDomain>::iterator i; + for (i = i_domain->getBeginIterator(); i != i_domain->getEndIterator(); i++) + { + PrdfExtensibleDomainFunction * l_mask = + (i->second)->getExtensibleFunction("MaskPll"); + (*l_mask)( i->second, + PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + } + + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( PllDomain, MaskPll ); + +//------------------------------------------------------------------------------ + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/framework/config/prdfPllDomain.H b/src/usr/diag/prdf/framework/config/prdfPllDomain.H new file mode 100755 index 000000000..ee5fa1b05 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfPllDomain.H @@ -0,0 +1,224 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfPllDomain.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2006,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef prdfPllDomain_H +#define prdfPllDomain_H + +#include <iipDomain.h> +#include <prdfRuleChipDomain.H> +#include <prdfParentDomain.H> + +#ifndef iipResolutionFactory_h +#include <iipResolutionFactory.h> +#endif + +#include <prdfThresholdResolutions.H> +#include <hdctContent.H> // for hwTableContent + +#include <prdfExtensibleDomain.H> + +namespace PRDF +{ + +//------------------------------------------------------------------------------ + +class PllDomain : public PrdfRuleChipDomain, public PrdfExtensibleDomain, + public ParentDomain<PrdfExtensibleDomain> +{ + public: + + /** @fn PllDomain + * @brief Constructor + * @param DOMAIN_ID - the domain ID + * @param Resolution to callout the correct clock source + * @param Dump content + */ + PllDomain( DOMAIN_ID domain_id, Resolution & clockSource, + hwTableContent i_hwdc ); + + /** @fn PllDomain + * @brief Constructor + * @param DOMAIN_ID - the domain ID + * @param Resolution to callout the correct repower clock logic + * @param Resolution to callout the correct clock source + * @param Dump content + */ + PllDomain( DOMAIN_ID domain_id, Resolution & clockRpwr, + Resolution & clockSource, hwTableContent i_hwdc ); + + /** @fn PllDomain + * @brief Constructor + * @param DOMAIN_ID - the domain ID + * @param Resolution to callout the correct clock source + * @param Dump content + * @param ThresholdResolution::ThresholdPolicy + */ + PllDomain( DOMAIN_ID domain_id, Resolution & clockSource, + hwTableContent i_hwdc, + const ThresholdResolution::ThresholdPolicy& i_mfgThresh); + + /** @fn PllDomain + * @brief Constructor + * @param DOMAIN_ID - the domain ID + * @param Resolution to callout the correct repower clock logic + * @param Resolution to callout the correct clock source + * @param Dump content + * @param ThresholdResolution::ThresholdPolicy + */ + PllDomain( DOMAIN_ID domain_id, Resolution & clockRpwr, + Resolution & clockSource, hwTableContent i_hwdc, + const ThresholdResolution::ThresholdPolicy& i_mfgThresh); + /** + Perform any initialization required by the hardware + @returns error code + @post PLL errors cleared in hardware. + */ + virtual int32_t Initialize(void); + + /** + Query if anything in this domain is at the attention type specified + @param Attention type to query for. (@see iipsdbug.h) + @returns [true|false] + @pre Initialize() + @post NONE + */ + virtual bool Query(ATTENTION_TYPE attentionType); + + /** + Analyze errors within the domain + @param service data collector + @param attentiont type (@see iipsdbug.h) + @returns service data collector - completed + @return return code + @pre Initialize(); Query() == true + @post domain element order may be modified. + */ + virtual int32_t Analyze(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType); + + /** + * @brief Domain level plugin function used to clear PLL attentions in a + * domain and its subdomains. + * @param i_domain The target PLL domain. + * @param i_sc The step code data struct. + * @return SUCCESS + */ + static int32_t ClearPll( PllDomain * i_domain, + STEP_CODE_DATA_STRUCT i_sc ); + + /** + * @brief Domain level plugin function used to mask PLL attentions in a + * domain and its subdomains. + * @param i_domain The target PLL domain. + * @param i_sc The step code data struct. + * @return SUCCESS + */ + static int32_t MaskPll( PllDomain * i_domain, + STEP_CODE_DATA_STRUCT i_sc ); + +protected: + + /** + Order the domain - with detecting element at the top + @param Attention type (@see iipsdbug.h) + @post domain elemenet order may be altered + @note this is called by Analyze() + */ + virtual void Order(ATTENTION_TYPE attentionType); + +private: // functions +private: // Data + + enum {CONTAINER_SIZE = 8, PRDF_PLL_ERROR = 0xed}; //dg03 + + Resolution & closeClockSource; + Resolution & farClockSource; + +// int threshold; dg05d + Resolution & iv_threshold; // dg05a dg06c + hwTableContent iv_dumpContent; //dg08a + +}; + +//------------------------------------------------------------------------------ + +inline +PllDomain::PllDomain( DOMAIN_ID domain_id, Resolution & clockSource, + hwTableContent i_hwdc ) : + PrdfRuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), + PrdfExtensibleDomain("PllDomain"), + closeClockSource(clockSource), + farClockSource(clockSource), // dg06c + iv_threshold( ResolutionFactory::Access().GetThresholdResolution( 1, + ThresholdResolution::cv_pllDefault, + ThresholdResolution::cv_mnfgDefault ) ), + iv_dumpContent(i_hwdc) // dg08a +{ } + +inline +PllDomain::PllDomain( DOMAIN_ID domain_id, Resolution & clockRpwr, + Resolution & clockSource, hwTableContent i_hwdc ) : + PrdfRuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), + PrdfExtensibleDomain("PllDomain"), + closeClockSource(clockRpwr), + farClockSource(clockSource), + iv_threshold( ResolutionFactory::Access().GetThresholdResolution( 1, + ThresholdResolution::cv_pllDefault, + ThresholdResolution::cv_mnfgDefault )), + iv_dumpContent(i_hwdc) //dg08a +{} + +inline +PllDomain::PllDomain( DOMAIN_ID domain_id, Resolution & clockSource, + hwTableContent i_hwdc, + const ThresholdResolution::ThresholdPolicy& i_mfgThresh) : + PrdfRuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), + PrdfExtensibleDomain("PllDomain"), + closeClockSource(clockSource), + farClockSource(clockSource), // dg06c + iv_threshold( ResolutionFactory::Access().GetThresholdResolution( 1, + ThresholdResolution::cv_pllDefault, + i_mfgThresh ) ), + iv_dumpContent(i_hwdc) // dg08a +{ } + +inline +PllDomain::PllDomain( DOMAIN_ID domain_id, Resolution & clockRpwr, + Resolution & clockSource, hwTableContent i_hwdc, + const ThresholdResolution::ThresholdPolicy& i_mfgThresh) : + PrdfRuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), + PrdfExtensibleDomain("PllDomain"), + closeClockSource(clockRpwr), + farClockSource(clockSource), + iv_threshold( ResolutionFactory::Access().GetThresholdResolution( 1, + ThresholdResolution::cv_pllDefault, + i_mfgThresh ) ), + iv_dumpContent(i_hwdc) //dg08a +{} + +//------------------------------------------------------------------------------ + +} // end namespace PRDF + +#endif /* prdfPllDomain_H */ + diff --git a/src/usr/diag/prdf/framework/config/prdfRuleChipDomain.C b/src/usr/diag/prdf/framework/config/prdfRuleChipDomain.C new file mode 100755 index 000000000..177a0182e --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfRuleChipDomain.C @@ -0,0 +1,193 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfRuleChipDomain.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2008,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#include <prdfRuleChipDomain.H> + +//#include <iipstep.h> +//#include <iipsdbug.h> +//#include <iipErrorRegister.h> +//#include <iipServiceDataCollector.h> +//#include <iipCallResolutionTemplate.h> + +//------------------------------------------------------------------------------ + +bool PrdfRuleChipDomain::Query( ATTENTION_TYPE i_attnType ) +{ + using namespace PRDF; + + bool o_rc = false; + + using PrdfPluginDef::bindParm; + SYSTEM_DEBUG_CLASS sysdbug; + + for ( uint32_t i = 0; i < GetSize(); i++ ) + { + PrdfRuleChip * chip = LookUp(i); + TARGETING::TargetHandle_t l_pchipHandle = LookUp(i)->GetChipHandle(); + + if ( sysdbug.IsAttentionActive(l_pchipHandle) ) + { + // First check if this chip is reporting the correct attention type. + if ( sysdbug.GetAttentionType(l_pchipHandle) == i_attnType ) + { + // If the attention type is a checkstop, check if the chip is + // reporting based on an externally signaled error condition. If + // so, ignore this chip (the chip reporting the checkstop will + // be found later). + + // If the attention type is RECOVERABLE and if the SN chip has an + // attached MC with a checkstop, ignore this Rec attn. + //mp01 c Start + const char * funcName; + + switch(i_attnType) + { + case CHECK_STOP: + case UNIT_CS: + funcName = "IgnoreCheckstopAttn"; + break; + case RECOVERABLE: + funcName = "IgnoreRecoveredAttn"; + break; + case SPECIAL: + funcName = "IgnoreSpecialAttn"; + break; + default: + continue; + } + + PrdfExtensibleChipFunction * ef + = chip->getExtensibleFunction( funcName, true ); + + bool ignore = false; + (*ef)( chip, bindParm<bool &, const ATTENTION_TYPE> + (ignore, i_attnType) ); + + if ( ignore ) + continue; + + o_rc = true; + break; + //mp01 c Stop + + } + + // If the attention type is recoverable and this chip is reporting a + // checkstop, check for recovereable errors on this chip. + if ( (i_attnType == RECOVERABLE) && + ( (sysdbug.GetAttentionType(l_pchipHandle) == CHECK_STOP) || + (sysdbug.GetAttentionType(l_pchipHandle) == UNIT_CS) ) ) + { + PrdfExtensibleChipFunction * ef + = chip->getExtensibleFunction("CheckForRecovered"); + (*ef)(chip, bindParm<bool &>(o_rc)); + + if ( o_rc ) break; + } + } + } + + return o_rc; +} + +//------------------------------------------------------------------------------ + +void PrdfRuleChipDomain::Order( ATTENTION_TYPE i_attnType ) +{ + using namespace PRDF; + + using PrdfPluginDef::bindParm; + SYSTEM_DEBUG_CLASS sysdbug; + const char * funcName; //mp01 a + + + for ( int32_t i = (GetSize() - 1); i >= 0; i-- ) + { + PrdfRuleChip * chip = LookUp(i); + TARGETING::TargetHandle_t l_pchipHandle = LookUp(i)->GetChipHandle(); + + if ( sysdbug.IsAttentionActive(l_pchipHandle) ) + { + // Move the first chip with this attention type to the front of the + // list. + if ( sysdbug.GetAttentionType(l_pchipHandle) == i_attnType ) + { + // If the attention type is a checkstop, check if the chip is + // reporting based on an externally signaled error condition. If + // so, ignore this chip (the chip reporting the checkstop will + // be found later). + + // If the attention type is RECOVERABLE and if the SN chip has an + // attached MC with a checkstop, ignore this Rec attn. + //mp01 c Start + switch(i_attnType) + { + case CHECK_STOP: + case UNIT_CS: + funcName = "IgnoreCheckstopAttn"; + break; + case RECOVERABLE: + funcName = "IgnoreRecoveredAttn"; + break; + case SPECIAL: + funcName = "IgnoreSpecialAttn"; + break; + default: + continue; + } + + PrdfExtensibleChipFunction * ef + = chip->getExtensibleFunction( funcName, true ); + + bool ignore = false; + (*ef)( chip, bindParm<bool &, const ATTENTION_TYPE> + (ignore, i_attnType) ); + + if ( ignore ) + continue; + + MoveToFront(i); + break; + //mp01 c Stop + } + + // If the attention type is recoverable and this chip is reporting a + // checkstop, check for recovereable errors on this chip. + if ( (i_attnType == RECOVERABLE) && + ( (sysdbug.GetAttentionType(l_pchipHandle) == CHECK_STOP) || + (sysdbug.GetAttentionType(l_pchipHandle) == UNIT_CS) ) ) + { + PrdfExtensibleChipFunction * ef + = chip->getExtensibleFunction("CheckForRecovered"); + bool hasRer = false; + (*ef)(chip, bindParm<bool &>(hasRer)); + + if ( hasRer ) + { + MoveToFront(i); + break; + } + } + } + } +} diff --git a/src/usr/diag/prdf/framework/config/prdfRuleChipDomain.H b/src/usr/diag/prdf/framework/config/prdfRuleChipDomain.H new file mode 100755 index 000000000..af9cd7fa4 --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfRuleChipDomain.H @@ -0,0 +1,77 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfRuleChipDomain.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2008,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef PRDFRULECHIPDOMAIN_H +#define PRDFRULECHIPDOMAIN_H + +#include <iipDomainContainer.h> +#include <prdfRuleChip.H> + +class PrdfRuleChipDomain : public DomainContainer<PrdfRuleChip> +{ + public: + + enum DefaultDomainSize + { + // At minimum, should allocate for a fully configured single P8 murano + // system. + + PROC_DOMAIN_SIZE = 1, + EX_DOMAIN_SIZE = PROC_DOMAIN_SIZE * 6, + MCS_DOMAIN_SIZE = PROC_DOMAIN_SIZE * 4, + + MEMBUF_DOMAIN_SIZE = MCS_DOMAIN_SIZE, + MBA_DOMAIN_SIZE = MEMBUF_DOMAIN_SIZE * 2, + + TOTAL_CHIPS = PROC_DOMAIN_SIZE + EX_DOMAIN_SIZE + MCS_DOMAIN_SIZE + + MEMBUF_DOMAIN_SIZE + MBA_DOMAIN_SIZE, + + TOTAL_DOMAINS = 5, + }; + + /** @fn PrdfRuleChipDomain + * @brief Constructor + * @param DOMAIN_ID - the domain ID + * @param uint32_t - the projected size of the domain + */ + PrdfRuleChipDomain( DOMAIN_ID i_did, uint32_t i_size ) : + DomainContainer<PrdfRuleChip>( i_did, i_size ) + {} + + /** @fn Query + * @brief Query for an attention of a specific type in this domain + * @param ATTENTION_TYPE [MACHINE_CHECK | RECOVERABLE | SPECIAL] + * @return TRUE if a chip in the domain is at attention. + */ + virtual bool Query( ATTENTION_TYPE i_attnType); + + protected: + + /** @fn Order + * @brief Prioritizes the components of this domain for Analysis + * @param ATTENTION_TYPE [MACHINE_CHECK | RECOVERABLE | SPECIAL] + */ + virtual void Order( ATTENTION_TYPE i_attnType); +}; + +#endif /* PRDFRULECHIPDOMAIN_H */ diff --git a/src/usr/diag/prdf/framework/config/prdfSystemSpecific.H b/src/usr/diag/prdf/framework/config/prdfSystemSpecific.H new file mode 100755 index 000000000..f9d9d0e1c --- /dev/null +++ b/src/usr/diag/prdf/framework/config/prdfSystemSpecific.H @@ -0,0 +1,54 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/prdfSystemSpecific.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2008,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfSystemSpecific.H + * @brief Redirection namespace for code specific for product families. + * + * The purpose of this namespace is to add an indirection between prdf_main + * and the various family implementations. This allows us to create a family + * specific library to reduce flash requirements when we have to support + * multiple families with the same code level. (P6 and P7 for example). + * + * There is a P6 implementation for eCLipz, P7 implementation for Apollo and + * P8 implementation for pegasus + * These are in the appropriate rule/<family> directory in P6/P7. + * For p8 these are defines in plat/<family> directory. + * + * For shipping code, only one implementation is in the shipped library. The + * eCLipz instance goes in the libprdfh_p6.so, etc. + * + */ + +#ifndef __PRDFSYSTEMSPECIFIC_H +#define __PRDFSYSTEMSPECIFIC_H + +#include <iipConfigurator.h> +#include <iipstep.h> + +namespace PrdfSystemSpecific +{ + Configurator * getConfiguratorPtr(); + void postAnalysisWorkarounds(STEP_CODE_DATA_STRUCT & i_sdc); +}; + +#endif diff --git a/src/usr/diag/prdf/framework/config/xspprdAccessPllChip.C b/src/usr/diag/prdf/framework/config/xspprdAccessPllChip.C new file mode 100755 index 000000000..26b94d65f --- /dev/null +++ b/src/usr/diag/prdf/framework/config/xspprdAccessPllChip.C @@ -0,0 +1,206 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/xspprdAccessPllChip.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2000,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +// Module Description ************************************************** +// +// Description: +// +// End Module Description ********************************************** + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- +#define xspprdAccessPllChip_C + +#include <xspprdAccessPllChip.h> + +#if !defined(IIPSCR_H) +#include <iipscr.h> +#endif + +#if !defined(PRDFSCANFACILITY_H) +#include <prdfScanFacility.H> +#endif + +#include <iipServiceDataCollector.h> + +#undef xspprdAccessPllChip_C +//---------------------------------------------------------------------- +// User Types +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Constants +//---------------------------------------------------------------------- +const uint32_t PLL_LOCK = 0x00800003; // Pll status address +const uint32_t PLL_MASK = 0x0080000C; // Pll Mask/Block reg address +const uint32_t PLL_ID = 0xeed; +// Pll status bit definitions +const uint32_t PLL0 = 8; +const uint32_t PLL1 = 9; +const uint32_t PLL2 = 10; +const uint32_t PLL3 = 11; +const uint32_t PLLBLK0 = 8; +const uint32_t PLLBLK1 = 9; +const uint32_t PLLBLK2 = 10; +const uint32_t PLLBLK3 = 11; + +//---------------------------------------------------------------------- +// Macros +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Internal Function Prototypes +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Global Variables +//---------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// Member Function Specifications +//--------------------------------------------------------------------- + +// -------------------------------------------------------------------- + +bool AccessPllChip::QueryPll(void) +{ + bool hasPll = false; + SCAN_COMM_REGISTER_CLASS & pll_lock_reg = + ScanFacility::Access().GetScanCommRegister(GetChipHandle(),PLL_LOCK,64); + SCAN_COMM_REGISTER_CLASS & pll_mask_reg = + ScanFacility::Access().GetScanCommRegister(GetChipHandle(),PLL_MASK,64); + + + // Read pll_lock register + int32_t rc = pll_lock_reg.Read(); + pll_mask_reg.Read(); + + if (rc == SUCCESS) { + const BIT_STRING_CLASS * lock = pll_lock_reg.GetBitString(); + const BIT_STRING_CLASS * mask = pll_mask_reg.GetBitString(); + + if ( (lock != NULL) && (mask != NULL) ) { + CPU_WORD senseBits = lock->GetField(PLL0, 4); + CPU_WORD blockBits = mask->GetField(PLLBLK0, 4); + if (senseBits & (~blockBits)) hasPll = true; + } + } + + return hasPll; +} + +// -------------------------------------------------------------------- + +int32_t AccessPllChip::ClearPll(void) +{ + int32_t rc = SUCCESS; + SCAN_COMM_REGISTER_CLASS & pll_lock_reg = + ScanFacility::Access().GetScanCommRegister(GetChipHandle(),PLL_LOCK,64); +// SCAN_COMM_REGISTER_CLASS & pll_mask_reg = +// ScanFacility::Access().GetScanCommRegister(GetId(),PLL_MASK,64); + + pll_lock_reg.Read(); + + // Need to also clear out status bits + pll_lock_reg.ClearBit(PLL0); + pll_lock_reg.ClearBit(PLL1); + pll_lock_reg.ClearBit(PLL2); + pll_lock_reg.ClearBit(PLL3); + + rc = pll_lock_reg.Write(); + + return rc; +} + +// -------------------------------------------------------------------- + +int32_t AccessPllChip::MaskPll(STEP_CODE_DATA_STRUCT & serviceData) +{ + int32_t rc = SUCCESS; +// SCAN_COMM_REGISTER_CLASS & pll_lock_reg = +// ScanFacility::Access().GetScanCommRegister(GetId(),PLL_LOCK,64); + SCAN_COMM_REGISTER_CLASS & pll_mask_reg = + ScanFacility::Access().GetScanCommRegister(GetChipHandle(),PLL_MASK,64); + + + //Read pll status reg mask to get current state + pll_mask_reg.Read(); + + // Set mask bits for pll + pll_mask_reg.SetBit(PLLBLK0); + pll_mask_reg.SetBit(PLLBLK1); + pll_mask_reg.SetBit(PLLBLK2); + pll_mask_reg.SetBit(PLLBLK3); + + // Write back to hardware + rc = pll_mask_reg.Write(); + + return rc; +} + +// -------------------------------------------------------------------- + +int32_t AccessPllChip::UnMaskPll(void) +{ + int32_t rc = SUCCESS; +// SCAN_COMM_REGISTER_CLASS & pll_lock_reg = +// ScanFacility::Access().GetScanCommRegister(GetId(),PLL_LOCK,64); + SCAN_COMM_REGISTER_CLASS & pll_mask_reg = + ScanFacility::Access().GetScanCommRegister(GetChipHandle(),PLL_MASK,64); + + //Read pll status reg mask to get current state + pll_mask_reg.Read(); + + // Set mask bits for pll + pll_mask_reg.ClearBit(PLLBLK0); + pll_mask_reg.ClearBit(PLLBLK1); + pll_mask_reg.ClearBit(PLLBLK2); + pll_mask_reg.ClearBit(PLLBLK3); + + // Write back to hardware + rc = pll_mask_reg.Write(); + + return rc; +} +// -------------------------------------------------------------------- + +void AccessPllChip::CapturePll(STEP_CODE_DATA_STRUCT & serviceData) +{ + SCAN_COMM_REGISTER_CLASS & pll_lock_reg = + ScanFacility::Access().GetScanCommRegister(GetChipHandle(),PLL_LOCK,64); + (serviceData.service_data->GetCaptureData()).Add(GetChipHandle(), PLL_ID ,pll_lock_reg); +} + +// -------------------------------------------------------------------- +// -------------------------------------------------------------------- + + +// Change Log ********************************************************* +// +// Flag Reason Vers Date Coder Description +// ---- --------- ---- -------- -------- ------------------------------ +// v5r2 04/14/00 mkobler Initial Creation +// 512857 fips240 07/29/05 dgilbert add AccessPllChip +// +// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/framework/config/xspprdAccessPllChip.h b/src/usr/diag/prdf/framework/config/xspprdAccessPllChip.h new file mode 100755 index 000000000..1c771330f --- /dev/null +++ b/src/usr/diag/prdf/framework/config/xspprdAccessPllChip.h @@ -0,0 +1,146 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/config/xspprdAccessPllChip.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2000,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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef xspprdAccessPllChip_h +#define xspprdAccessPllChip_h + +// Class Description ************************************************* +// +// Name: xspprdAccessPllChip +// Base class: PllChip +// +// Description: Provide PLL support for chips that have Access jtag interface +// Usage: +// +// End Class Description ********************************************* + +//-------------------------------------------------------------------- +// Includes +//-------------------------------------------------------------------- + +#if !defined(IIPCHIP_H) + #include <iipchip.h> +#endif + +//-------------------------------------------------------------------- +// Forward References +//-------------------------------------------------------------------- + +/** + * Provide PLL support for chips that have Access jtag interface + * + * @author Doug Gilbert + */ +class AccessPllChip : public CHIP_CLASS +{ + public: + + /** + * @brief Constructor + * @param i_target A chip target. + */ + explicit AccessPllChip( TARGETING::TargetHandle_t i_target ); + + /** + Query hardware to see if there is a PLL error reported by this chip + <ul> + <br><b>Parameters: </b> None. + <br><b>Returns: </b> [true | false] + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + </ul><br> + */ + virtual bool QueryPll(); + + /** + Clear the pll check bit(s) in the hardware + <ul> + <br><b>Parameters: </b> None. + <br><b>Returns: </b> return code + <br><b>Requirements:</b> None. + <br><b>Promises: </b> None. + <br><b>Exceptions: </b> None. + </ul><br> + */ + virtual int32_t ClearPll(); + + /** + Disable the reporting of PLL errors in the hardware + <ul> + <br><b>Parameters: </b> serviceData + <br><b>Returns: </b> return code + <br><b>Requirements:</b> none. + <br><b>Promises: </b> serviceData may be modified + <br><b>Exceptions: </b> None. + </ul><br> + */ + virtual int32_t MaskPll(STEP_CODE_DATA_STRUCT & serviceData); + + /** + Enable the reporting of PLL errors in the hardware + <ul> + <br><b>Parameters: </b> None. + <br><b>Returns: </b> return code + <br><b>Requirements:</b> none. + <br><b>Promises: </b> none. + <br><b>Exceptions: </b> None. + </ul><br> + */ + virtual int32_t UnMaskPll(); + + /** + * Add the PLL status register to the service Capturedata + * @param Service Data collector + * @pre none + * @post service data collectors' capture data has the content of the PLL + * status reg + */ + void CapturePll(STEP_CODE_DATA_STRUCT & serviceData); + + private: // functions + + /** + Copy constructor - Forbidden + <ul> + <br><b>Notes: </b> No definitions should exist + </ul><br> + */ + AccessPllChip(const AccessPllChip &); + /** + Assignment operator - Forbidden + <ul> + <br><b>Notes: </b> No definitions should exist + </ul><br> + */ + AccessPllChip & operator=(const AccessPllChip &); + + private: // Data + +}; + +inline AccessPllChip::AccessPllChip( TARGETING::TargetHandle_t i_target ) : + CHIP_CLASS(i_target) +{} + +#endif /* xspprdAccessPllChip_h */ |