diff options
Diffstat (limited to 'src/include/usr/hwpf/fapi')
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapi.H | 65 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiAttributeService.H | 160 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiChipEcFeature.H | 72 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H | 95 | ||||
| -rwxr-xr-x | src/include/usr/hwpf/fapi/fapiErrorInfo.H | 631 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiHwAccess.H | 504 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiHwpExecutor.H | 56 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiMBvpdAccess.H | 191 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiMvpdAccess.H | 221 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiPlatHwAccess.H | 370 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCode.H | 633 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H | 179 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCodes.H | 108 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiSystemConfig.H | 121 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiTarget.H | 326 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiUtil.H | 293 |
16 files changed, 0 insertions, 4025 deletions
diff --git a/src/include/usr/hwpf/fapi/fapi.H b/src/include/usr/hwpf/fapi/fapi.H deleted file mode 100644 index c9cde57a5..000000000 --- a/src/include/usr/hwpf/fapi/fapi.H +++ /dev/null @@ -1,65 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapi.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapi.H,v 1.9 2013/10/15 13:13:28 dcrowell Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapi.H,v $ - -/** - * @file fapi.H - * - * @brief Includes all the header files necessary for the FAPI interface. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. - * mjjones 06/07/2011 Added new includes. - * mjjones 08/08/2011 Updated Executor include - * mjjones 09/23/2011 Added fapiHwpErrorInfo.H - * mjjones 11/10/2011 Use ecmdDataBufferBase - * mjjones 04/16/2012 Added fapiChipEcFeature.H - * mjjones 11/14/2012 Added fapiSetSbeError.H - */ - -#ifndef FAPI_H_ -#define FAPI_H_ - -#include <fapiTarget.H> -#include <fapiReturnCode.H> -#include <fapiUtil.H> -#include <fapiHwAccess.H> -#include <fapiSystemConfig.H> -#include <fapiPlatTrace.H> -#include <fapiHwpExecutor.H> -#include <fapiAttributeService.H> -#include <fapiChipEcFeature.H> -#include <fapiHwpReturnCodes.H> // Generated file -#include <fapiHwpErrorInfo.H> // Generated file -#include <fapiAttributeIds.H> // Generated file -#include <fapiSetSbeError.H> // Generated file -#include <ecmdDataBufferBase.H> -#include <fapiMvpdAccess.H> -#include <fapiMBvpdAccess.H> - -#endif // FAPI_H_ diff --git a/src/include/usr/hwpf/fapi/fapiAttributeService.H b/src/include/usr/hwpf/fapi/fapiAttributeService.H deleted file mode 100644 index 4fa86cf5d..000000000 --- a/src/include/usr/hwpf/fapi/fapiAttributeService.H +++ /dev/null @@ -1,160 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiAttributeService.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiAttributeService.H,v 1.12 2013/10/15 13:11:08 dcrowell Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiAttributeService.H,v $ - -/** - * @file fapiAttributeService.H - * - * @brief Defines the FAPI_ATTR_GET and FAPI_ATTR_SET macros that a user calls - * to get/set attributes and a check function that the macros use to - * verify correct usage - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 06/06/2011 Created. - * mjjones 06/22/2011 Major updates - * mjjones 09/06/2011 Remove support for strings - * mjjones 09/22/2011 Fixed example - * mjjones 10/13/2011 Added fapiGetInitFileAttr - * camvanng 10/20/2011 Changed i_pTarget to "const" - * ptr - * mjjones 04/10/2012 Support for privileged atts - * mjjones 06/07/2012 Add attr override support - * mjjones 03/13/2013 Move attr override code to plat - */ - -#ifndef FAPIATTRIBUTESERVICE_H_ -#define FAPIATTRIBUTESERVICE_H_ -#include <stdint.h> -#include <fapiAttributeIds.H> -#include <fapiPlatAttributeService.H> - -/** - * @brief Macros called by user to get/set attributes - * - * Code must have a pointer to a Target and an attribute ID (from XML file): - * fapi::ReturnCode l_rc; - * fapi::Target * l_pTarget = ????; - * - * To get a copy of an integer attribute and set the attribute - * uint64_t l_val = 0; - * l_rc = FAPI_ATTR_GET(<ID>, l_pTarget, l_val); - * l_rc = FAPI_ATTR_SET(<ID>, l_pTarget, l_val); - * - * To get a copy of an integer array attribute and set the attribute - * uint32_t l_pVal[4] = {0}; - * l_rc = FAPI_ATTR_GET(<ID>, l_pTarget, l_pVal); - * l_rc = FAPI_ATTR_SET(<ID>, l_pTarget, l_pVal); - * - * A priveleged attribute is one that a HWP should not generally access, - * examples include ATTR_NAME and ATTR_EC, where usage can lead to a non - * data-driven design. A privileged attribute can be accessed with - * FAPI_ATTR_GET_PRIVILEGED and FAPI_ATTR_SET_PRIVILEGED - * - * The non-PRIVILEGED macros first call a template function (compiler will - * optimize out) that will cause a compile failure if the attribute is - * privileged, they then call a PRIVILEGED macro to get/set the attribute - * - * The PRIVILEGED macros call a template function (compiler will optimize out) - * that will cause a compile failure if the ID is not valid or VAL is not the - * correct type. - */ -#define FAPI_ATTR_GET(ID, PTARGET, VAL) \ - (fapi::fapiFailIfPrivileged<fapi::ID##_Privileged>(), \ - fapi::fapiCheckIdType<fapi::ID##_Type>(fapi::ID, VAL), \ - ID##_GETMACRO(ID, PTARGET, VAL)) - -#define FAPI_ATTR_SET(ID, PTARGET, VAL) \ - (fapi::fapiFailIfPrivileged<fapi::ID##_Privileged>(), \ - fapi::fapiCheckIdType<fapi::ID##_Type>(fapi::ID, VAL), \ - ID##_SETMACRO(ID, PTARGET, VAL)) - -#define FAPI_ATTR_GET_PRIVILEGED(ID, PTARGET, VAL) \ - (fapi::fapiCheckIdType<fapi::ID##_Type>(fapi::ID, VAL), \ - ID##_GETMACRO(ID, PTARGET, VAL)) - -#define FAPI_ATTR_SET_PRIVILEGED(ID, PTARGET, VAL) \ - (fapi::fapiCheckIdType<fapi::ID##_Type>(fapi::ID, VAL), \ - ID##_SETMACRO(ID, PTARGET, VAL)) - -namespace fapi -{ - -/** - * @brief Get an InitFile attribute - * - * This function gets a copy of an attribute. In the case of an array attribute, - * The value in the specified index is retrieved. This should be used by the - * InitFile HWP only, that HWP processes a binary InitFile and therefore needs - * to read a variable ID of a variable data type. Standard HWPs should use the - * FAPI_ATTR_GET macro which automatically checks the type for correct usage. - * - * If there are ever attributes with more than 4 dimensions then this function - * will need to be updated. - * - * @param[in] i_id AttributeID - * @param[in] i_pTarget Pointer to fapi::Target (can be NULL for system) - * @param[out] o_val Reference to uint64_t where attribute value is set - * @param[in] i_arrayIndex1 If array attribute then index1 - * @param[in] i_arrayIndex2 If at least 2D array attribute then index2 - * @param[in] i_arrayIndex3 If at least 3D array attribute then index3 - * @param[in] i_arrayIndex4 If at least 4D array attribute then index4 - * - * @return ReturnCode. Zero if success - */ -ReturnCode fapiGetInitFileAttr(const AttributeId i_id, - const Target * i_pTarget, - uint64_t & o_val, - const uint32_t i_arrayIndex1 = 0, - const uint32_t i_arrayIndex2 = 0, - const uint32_t i_arrayIndex3 = 0, - const uint32_t i_arrayIndex4 = 0); - -/** - * @brief Check the ID and TYPE - * - * This is called by FAPI code to check at compile time that a FAPI attribute - * access is using the correct data type and a valid AttributeId - */ -template<typename T> inline void fapiCheckIdType(AttributeId, T &) {} - -/** - * @brief Fail if attribute privileged - * - * This is called by FAPI code to check at compile time that a standard FAPI - * attribute access (FAPI_ATTR_GET) is not accessing a privileged attribute - */ -class ErrorAccessingPrivilegedAttribute; -template<const bool PRIVILEGED> void fapiFailIfPrivileged() -{ - ErrorAccessingPrivilegedAttribute(); -} -template <> inline void fapiFailIfPrivileged<false>() {} - -} - -#endif // FAPIATTRIBUTESERVICE_H_ diff --git a/src/include/usr/hwpf/fapi/fapiChipEcFeature.H b/src/include/usr/hwpf/fapi/fapiChipEcFeature.H deleted file mode 100644 index 71cfc7386..000000000 --- a/src/include/usr/hwpf/fapi/fapiChipEcFeature.H +++ /dev/null @@ -1,72 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiChipEcFeature.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiChipEcFeature.H,v 1.4 2013/10/15 13:13:23 dcrowell Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiChipEcFeature.H,v $ - -/** - * @file fapiChipEcFeature.H - * - * @brief Defines the fapiQueryChipEcFeature function that allows HWPs to - * query if a particular chip has a feature determined by its EC level. - * Chip EC features are specified in attribute XML files and the - * fapiQueryChipEcFeature function implementation is auto-generated. - * HWPs should not call this function directly, but should access the - * corresponding HWPF attribute using FAPI_ATTR_GET - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 03/26/2012 Created. - */ - -#ifndef FAPICHIPECFEATURE_H_ -#define FAPICHIPECFEATURE_H_ - -#include <stdint.h> -#include <fapiAttributeIds.H> -#include <fapiReturnCode.H> - -namespace fapi -{ - -class Target; - -/** - * @brief Queries if a Chip has a particular feature - * - * This should only be called by FAPI during the processing of a FAPI_ATTR_GET - * for a Chip EC Feature attribute - * - * @param[in] i_id Attribute ID of the Chip EC Feature - * @param[in] i_pTarget Pointer to chip target - * @param[out] o_hasFeature Set to 1 if chip has feature else 0 - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiQueryChipEcFeature(fapi::AttributeId i_id, - const fapi::Target * i_pTarget, - uint8_t & o_hasFeature); -} - -#endif diff --git a/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H b/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H deleted file mode 100644 index bb1be98a5..000000000 --- a/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H +++ /dev/null @@ -1,95 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiCollectRegFfdc.H,v 1.4 2013/10/31 19:48:22 dedahle Exp $ -/** - * @file fapiCollectRegFfdc.H - * - * @brief Defines the fapiCollectRegFfdc function that collects chip or - * chiplet register FFDC data. This is called automatically by - * FAPI_SET_HWP_ERROR (when a HWP creates an error) and - * FAPI_ADD_INFO_TO_HWP_ERROR (when an FFDC HWP adds error information - * to an existing error) if the error XML contains a - * <collectRegisterFfdc> element. This function should not be called - * directly by any user code. The function implementation is - * automatically generated from FAPI Error XML files. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 09/19/2012 Created. - * dedahle 09/30/2013 Add i_child parameter for - * chiplet register FFDC - * dedahle 10/15/13 Added i_presChild and - * i_childOffsetMult - * parameters for register FFDC - * collection based on present - * child chiplets - */ - -#ifndef FAPICOLLECTREGFFDC_H_ -#define FAPICOLLECTREGFFDC_H_ - -#include <fapiHwpErrorInfo.H> -#include <fapiTarget.H> -namespace fapi -{ - -class Target; -class ReturnCode; - -/** - * @brief Collects Register FFDC from a chip or chiplet - * - * This should only be called by FAPI during FAPI_SET_HWP_ERROR or - * FAPI_ADD_INFO_TO_HWP_ERROR - * - * @param[in] i_target Reference to Target to collect FFDC from - * @param[in] i_ffdcId FFDC Identifier - * @param[out] o_rc Reference to ReturnCode that FFDC is added to - * @param[in] i_child Specifies type of i_target's chiplet to collect - * FFDC from. If this parameter is TARGET_TYPE_NONE - * (default value), then register FFDC is collected - * from i_target, else, register FFDC is collected - * from all functional child chiplets i_target of - * the specified type - * @param[in] i_presChild When specified, register FFDC will be collected - * from i_target's registers based on present chiplets - * of this type. - * @param[in] i_childOffsetMult Specifies the chiplet position offset multiplier. - * This is used in calculating the scom register - * addresses when collecting register FFDC based on - * present child chiplets. - */ -void fapiCollectRegFfdc(const fapi::Target & i_target, - const fapi::HwpFfdcId i_ffdcId, - fapi::ReturnCode & o_rc, - const fapi::TargetType i_child = - fapi::TARGET_TYPE_NONE, - const fapi::TargetType i_presChild = - fapi::TARGET_TYPE_NONE, - const uint32_t i_childOffsetMult = 0); -} - -#endif diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H deleted file mode 100755 index c92484372..000000000 --- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H +++ /dev/null @@ -1,631 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiErrorInfo.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiErrorInfo.H,v 1.18 2015/03/19 15:46:14 pragupta Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiErrorInfo.H,v $ - -/** - * @file fapiErrorInfo.H - * - * @brief Defines the Error Information structures and classes - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 08/09/2011 Created. - * mjjones 08/24/2011 Added ErrorInfoGard. - * mjjones 09/22/2011 Major updates - * mjjones 03/16/2012 Add FfdcType. Remove copy - * ctor and assignment operator - * mjjones 08/14/2012 Merge Callout/Deconfig/Gard - * structures into one - * mjjones 09/19/2012 Replace FFDC type with ID - * mjjones 03/22/2013 Support Procedure Callouts - * mjjones 05/20/2013 Support Bus Callouts - * mjjones 06/24/2013 Support Children CDGs - * mjjones 08/26/2013 Support HW Callouts - * rjknight 09/19/2013 Allow callout/deconfigure - * /gard of DIMM(s) related - * to MBA - * whs 03/11/2014 Add FW traces to error logs - * sangeet2 01/16/2015 Modify ErrorInfoHwCallout - */ - -#ifndef FAPIERRORINFO_H_ -#define FAPIERRORINFO_H_ - -#include <stdint.h> -#include <vector> -#include <fapiTarget.H> - -namespace fapi -{ - -// The type that will hold the position of clock -typedef int8_t targetPos_t; - -// Used incase a valid clock position is not specified -const targetPos_t INVALID_CLOCK_POS = (-1); - -/** - * @enum HwCallout - * - * This enumeration defines the possible Hardware Callouts that are not - * represented by fapi::Targets - * - * Note that platform code may depend on the enum values starting at 0 and - * incrementing in order to efficiently convert to a platform callout value - * so do not reorder without consulting all platforms - */ -namespace HwCallouts -{ -enum HwCallout -{ - // Where indicated, a HW Callout in FAPI Error XML must include a reference - // target that is used to identify the HW. e.g. for TOD_CLOCK, the proc chip - // that the clock is attached to must be specified - TOD_CLOCK = 0, // Include proc-chip ref (or child chiplet) - MEM_REF_CLOCK = 1, // Include membuf-chip ref (or child chiplet) - PROC_REF_CLOCK = 2, // Include proc-chip ref (or child chiplet) - PCI_REF_CLOCK = 3, // Include proc-chip ref (or child chiplet) - FLASH_CONTROLLER_PART = 4, - PNOR_PART = 5, - SBE_SEEPROM_PART = 6, - VPD_PART = 7, - LPC_SLAVE_PART = 8, - GPIO_EXPANDER_PART = 9, - SPIVID_SLAVE_PART = 10, -}; -} - -/** - * @enum ProcedureCallout - * - * This enumeration defines the possible Procedure Callouts - * These instruct the customer/customer-engineer what to do - * - * Note that platform code may depend on the enum values starting at 0 and - * incrementing in order to efficiently convert to a platform callout value - * so do not reorder without consulting all platforms - */ -namespace ProcedureCallouts -{ -enum ProcedureCallout -{ - CODE = 0, // Code problem - LVL_SUPPORT = 1, // Call next level of support - MEMORY_PLUGGING_ERROR = 2, // DIMM Plugging error - BUS_CALLOUT = 3, // Bus Called Out -}; -} - -/** - * @enum CalloutPriority - * - * This enumeration defines the possible Procedure and Target callout priorities - * - * Note that platform code may depend on the enum values starting at 0 and - * incrementing in order to efficiently convert to a platform priority value - * so do not reorder without consulting all platforms - */ -namespace CalloutPriorities -{ -enum CalloutPriority -{ - LOW = 0, - MEDIUM = 1, - HIGH = 2, -}; -} - -/** - * @enum Enumeration of firmware traces - * - * This enumeration defines the possible firmware traces to collect - */ -namespace CollectTraces -{ -const uint32_t TRACE_SIZE = 256; // limit collected trace size -enum CollectTrace -{ - FSI = 1, - SCOM = 2, - SCAN = 3, - MBOX = 4, -}; -} - -/** - * @class ErrorInfoFfdc - * - * This class contains a copy of some FFDC data - */ -class ErrorInfoFfdc -{ -public: - /** - * @brief Constructor - * - * @param[in] i_ffdcId FFDC Identifier (used to decode FFDC) - * @param[in] i_pFfdc Pointer to the FFDC to copy - * @param[in] i_size Size of the FFDC to copy - */ - ErrorInfoFfdc(const uint32_t i_ffdcId, - const void * i_pFfdc, - const uint32_t i_size); - - /** - * @brief Destructor - */ - ~ErrorInfoFfdc(); - - /** - * @brief Get a pointer to the FfdcData - * - * @param[out] o_size Reference to uint32_t that is filled in with the FFDC - * size - * - * @return void *. Pointer to the FFDC - */ - const void * getData(uint32_t & o_size) const; - - /** - * @brief Get the FFDC Identifier - * - * @return uint32_t The FFDC Identifier - */ - uint32_t getFfdcId() {return iv_ffdcId;} - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - -private: - - // FFDC Identifier - uint32_t iv_ffdcId; - - // Pointer to the FFDC - uint8_t * iv_pFfdc; - - // Size of the FFDC - uint32_t iv_size; - - // Disabled - ErrorInfoFfdc(const ErrorInfoFfdc &); - ErrorInfoFfdc & operator=(const ErrorInfoFfdc &); -}; - -/** - * @struct ErrorInfoHwCallout - * - * This struct contains hardware to callout - */ -struct ErrorInfoHwCallout -{ - /** - * @brief Constructor. - * - * @param[in] i_hw Hardware to callout - * @param[in] i_calloutPriority Priority of callout - * @param[in] i_refTarget Reference to reference target - * @param[in] i_position Incase of a clock callout; - * the position of the clock to be called out - */ - ErrorInfoHwCallout( - const HwCallouts::HwCallout i_hw, - const CalloutPriorities::CalloutPriority i_calloutPriority, - const Target & i_refTarget, - const targetPos_t i_position = INVALID_CLOCK_POS); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // The hw to callout - HwCallouts::HwCallout iv_hw; - - // The callout priority - CalloutPriorities::CalloutPriority iv_calloutPriority; - - // The reference target (needed for some HW callouts to identify what to - // callout). The target handle is NULL if there is no reference target. - Target iv_refTarget; - - // Incase of a clock callout; the position of the clock to be called out - targetPos_t iv_position; -}; - -/** - * @struct ErrorInfoProcedureCallout - * - * This struct contains a procedure to callout - */ -struct ErrorInfoProcedureCallout -{ - /** - * @brief Constructor. - * - * @param[in] i_procedure Procedure to callout - * @param[in] i_calloutPriority Priority of callout - */ - ErrorInfoProcedureCallout( - const ProcedureCallouts::ProcedureCallout i_procedure, - const CalloutPriorities::CalloutPriority i_calloutPriority); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // The procedure to callout - ProcedureCallouts::ProcedureCallout iv_procedure; - - // The callout priority - CalloutPriorities::CalloutPriority iv_calloutPriority; -}; - -/** - * @struct ErrorInfoBusCallout - * - * This struct contains a bus to callout - */ -struct ErrorInfoBusCallout -{ - /** - * @brief Constructor. - * - * @param[in] i_target1 Reference to target on one end of the bus - * @param[in] i_target2 Reference to target on other end of the bus - * @param[in] i_calloutPriority Priority of callout - */ - ErrorInfoBusCallout( - const Target & i_target1, - const Target & i_target2, - const CalloutPriorities::CalloutPriority i_calloutPriority); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // The targets on each end of the bus to callout - Target iv_target1; - Target iv_target2; - - // The callout priority - CalloutPriorities::CalloutPriority iv_calloutPriority; -}; - -/** - * @struct ErrorInfoCDG - * - * This struct contains a target to callout/deconfigure/GARD - */ -struct ErrorInfoCDG -{ - /** - * @brief Constructor. - * - * @param[in] i_target Reference to the target to c/d/g - * @param[in] i_callout True if Target should be called out - * @param[in] i_deconfigure True if Target should be deconfigured - * @param[in] i_gard True if Target should be GARDed - * @param[in] i_priority The priority of any callout - */ - ErrorInfoCDG(const Target & i_target, - const bool i_callout, - const bool i_deconfigure, - const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // The target to callout/deconfigure/GARD - Target iv_target; - - // Callout Information - bool iv_callout; - CalloutPriorities::CalloutPriority iv_calloutPriority; - - // Deconfigure Information - bool iv_deconfigure; - - // GARD Information - bool iv_gard; -}; - -/** - * @struct ErrorInfoChildrenCDG - * - * This struct contains children targets to callout/deconfigure/GARD - * - * Children by containment can be CDG (chiplets belonging to a parent chip) e.g. - * - PROC_CHIP -> EX_CHIPLET - * - MEMBUF_CHIP -> MBA_CHIPLET - * Children by affinity can be CDG. - * Any from PROC_CHIP->MCS_CHIPLET->MEMBUF_CHIP->MBA_CHIPLET->DIMM e.g. - * - PROC_CHIP->MEMBUF_CHIP - * - MEMBUF_CHIP->DIMM - * - MBA_CHIPLET->DIMM - * Port and Number criteria can be applied to the child target as - * detailed in the constructor - */ -struct ErrorInfoChildrenCDG -{ - /** - * @brief Constructor. - * - * @param[in] i_parent Reference to the parent target - * @oaram[in] i_childType Child target type to c/d/g - * @param[in] i_callout True if Target should be called out - * @param[in] i_deconfigure True if Target should be deconfigured - * @param[in] i_gard True if Target should be GARDed - * @param[in] i_priority The priority of any callout - * @param[in] i_childPort Child Port - * For DIMM children, the MBA port number - * @param[in] i_childNum Child Number - * For DIMM children, the dimm socket number - * For Chip children, the chip position - * For Chiplet children, the chiplet unit pos - */ - ErrorInfoChildrenCDG(const Target & i_parentChip, - const TargetType i_childType, - const bool i_callout, - const bool i_deconfigure, - const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority, - const uint8_t i_childPort, const uint8_t i_childNum); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // The parent chip - Target iv_parent; - - // The child target types to c/d/g - TargetType iv_childType; - - // Callout Information - bool iv_callout; - CalloutPriorities::CalloutPriority iv_calloutPriority; - - // Deconfigure Information - bool iv_deconfigure; - - // GARD Information - bool iv_gard; - - // Child Port - static const uint8_t ALL_CHILD_PORTS = 0xff; - uint8_t iv_childPort; - - // Child Number - static const uint8_t ALL_CHILD_NUMBERS = 0xff; - uint8_t iv_childNumber; -}; - -/** - * @struct ErrorInfoCollectTrace - * - * This struct contains trace ID to add to the error log - */ -struct ErrorInfoCollectTrace -{ - /** - * @brief Constructor. - * - * @param[in] i_trace - */ - ErrorInfoCollectTrace(CollectTraces::CollectTrace i_traceId); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // trace - CollectTraces::CollectTrace iv_eiTraceId; -}; - -/** - * @struct ErrorInfo - * - * This struct defines the error information associated with a fapi::ReturnCode - * Users are allowed to access the data directly - */ -struct ErrorInfo -{ - /** - * @brief Destructor. - */ - ~ErrorInfo(); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - - // Vector of FFDC Data - std::vector<ErrorInfoFfdc *> iv_ffdcs; - typedef std::vector<ErrorInfoFfdc *>::iterator ErrorInfoFfdcItr_t; - typedef std::vector<ErrorInfoFfdc *>::const_iterator ErrorInfoFfdcCItr_t; - - // Vector of Hardware to callout - std::vector<ErrorInfoHwCallout *> iv_hwCallouts; - typedef std::vector<ErrorInfoHwCallout *>::iterator - ErrorInfoHwCalloutItr_t; - typedef std::vector<ErrorInfoHwCallout *>::const_iterator - ErrorInfoHwCalloutCItr_t; - - // Vector of procedures to callout - std::vector<ErrorInfoProcedureCallout *> iv_procedureCallouts; - typedef std::vector<ErrorInfoProcedureCallout *>::iterator - ErrorInfoProcedureCalloutItr_t; - typedef std::vector<ErrorInfoProcedureCallout *>::const_iterator - ErrorInfoProcedureCalloutCItr_t; - - // Vector of buses to callout - std::vector<ErrorInfoBusCallout *> iv_busCallouts; - typedef std::vector<ErrorInfoBusCallout *>::iterator - ErrorInfoBusCalloutItr_t; - typedef std::vector<ErrorInfoBusCallout *>::const_iterator - ErrorInfoBusCalloutCItr_t; - - // Vector of targets to callout/deconfigure/GARD - std::vector<ErrorInfoCDG *> iv_CDGs; - typedef std::vector<ErrorInfoCDG *>::iterator ErrorInfoCDGItr_t; - typedef std::vector<ErrorInfoCDG *>::const_iterator ErrorInfoCDGCItr_t; - - // Vector of children targets to callout/deconfigure/GARD - std::vector<ErrorInfoChildrenCDG *> iv_childrenCDGs; - typedef std::vector<ErrorInfoChildrenCDG *>::iterator - ErrorInfoChildrenCDGItr_t; - typedef std::vector<ErrorInfoChildrenCDG *>::const_iterator - ErrorInfoChildrenCDGCItr_t; - - // Vector of traces to collect - std::vector<ErrorInfoCollectTrace *> iv_traces; - typedef std::vector<ErrorInfoCollectTrace *>::iterator - ErrorInfoCollectTraceItr_t; - typedef std::vector<ErrorInfoCollectTrace *>::const_iterator - ErrorInfoCollectTraceCItr_t; -}; - -} - -#endif // FAPIERRORINFO_H_ diff --git a/src/include/usr/hwpf/fapi/fapiHwAccess.H b/src/include/usr/hwpf/fapi/fapiHwAccess.H deleted file mode 100644 index 0950abd12..000000000 --- a/src/include/usr/hwpf/fapi/fapiHwAccess.H +++ /dev/null @@ -1,504 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiHwAccess.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiHwAccess.H,v 1.13 2014/01/20 22:37:49 mklight Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiHwAccess.H,v $ - -/** - * @file fapiHwAccess.H - * - * @brief Defines the hardware access functions that platform code must - * implement. It is a HWP requirement that these be "C" functions - * because it simplifies language bindings for non-C languages, - * such as perl - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. Copied from Hlava's code. - * mjjones 06/02/2011 Scom addresses should be uint64_t - * use ecmdDataBufferBase - * mjjones 06/30/2011 Updated comment - * mjjones 09/14/2011 Prepended fapi to functions - * mjjones 11/10/2011 Use ecmdDataBufferBase - * 836579 thi May 22,2012 Spy/Ring supports - * mjjones 07/12/2012 Add mode options to Ring funcs - * rjknight 09/20/2012 Update fapiSpy interfaces to - * F876964 jknight Apr, 02,2013 fapi get/setSpyImage - * F873646 srimeesa Mar 10,2013 64Bit SPYID and - * ClockDomain ID support - * F883863 atendolk 05/06/2013 Add MultiScom support - */ - -#ifndef FAPIHWACCESS_H_ -#define FAPIHWACCESS_H_ - -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -#include <fapiSpyIds.H> -#endif - -#include <stdint.h> -#include <ecmdDataBufferBase.H> -#include <fapiReturnCode.H> -#include <fapiTarget.H> - -#ifdef FAPI_SUPPORT_MULTI_SCOM -#include <fapiMultiScom.H> -#endif - - -namespace fapi -{ - /** - * @brief Enumeration of modify modes used in modify operations - */ - enum ChipOpModifyMode - { - CHIP_OP_MODIFY_MODE_OR = 1, - CHIP_OP_MODIFY_MODE_AND = 2, - CHIP_OP_MODIFY_MODE_XOR = 3, - }; - - /** - * @brief Enumeration of Ring operation modes - * - * This is a bitmap to allow the user to specify multiple modes - */ - enum RingMode - { - RING_MODE_SET_PULSE = 0x00000001, - RING_MODE_NO_HEADER_CHECK = 0x00000002, - // FUTURE_MODE = 0x00000004, - // FUTURE_MODE = 0x00000008, - }; -} - -extern "C" -{ - -typedef uint64_t spyId_t; -typedef uint64_t scanRingId_t; - -//------------------------------------------------------------------------------ -// HW Communication Functions -//------------------------------------------------------------------------------ - -/** - * @brief Reads a SCOM register from a Chip - * @param[in] i_target Target to operate on - * @param[in] i_address Scom address to read from - * @param[out] o_data ecmdDataBufferBase object that holds data read from - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiGetScom(const fapi::Target& i_target, - const uint64_t i_address, - ecmdDataBufferBase & o_data); - -/** - * @brief Writes a SCOM register on a Chip - * @param[in] i_target Target to operate on - * @param[in] i_address Scom address to write to - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiPutScom(const fapi::Target& i_target, - const uint64_t i_address, - ecmdDataBufferBase & i_data); - -/** - * @brief Writes a SCOM register under mask to a chip - * @param[in] i_target Target to operate on - * @param[in] i_address Scom address to write to - * @param[in] i_data ecmdDataBufferBase object that holds the data - * @param[in] i_mask ecmdDataBufferBase object that holds the mask (i_data to - * write) - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiPutScomUnderMask(const fapi::Target& i_target, - const uint64_t i_address, - ecmdDataBufferBase & i_data, - ecmdDataBufferBase & i_mask); - - -/** - * @brief Reads a CFAM register from a chip - * @param[in] i_target Target to operate on - * @param[in] i_address CFAM address to read from - * @param[out] o_data ecmdDataBufferBase object that holds data read from - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiGetCfamRegister(const fapi::Target& i_target, - const uint32_t i_address, - ecmdDataBufferBase & o_data); - -/** - * @brief Writes a CFAM register to a chip - * @param[in] i_target Target to operate on - * @param[in] i_address CFAM address to write to - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiPutCfamRegister(const fapi::Target& i_target, - const uint32_t i_address, - ecmdDataBufferBase & i_data); - -/** - * @brief Read-modify-write a CFAM register on a chip - * @param[in] i_target Target to operate on - * @param[in] i_address CFAM address to write to - * @param[in] i_data ecmdDataBufferBase object that holds the modifying data - * @param[in] i_modifyMode The modify mode (or/and/xor) - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiModifyCfamRegister(const fapi::Target& i_target, - const uint32_t i_address, - ecmdDataBufferBase & i_data, - const fapi::ChipOpModifyMode i_modifyMode); - -/** - * @brief Reads a ring from a target - * @param[in] i_target Target to operate on - * @param[in] i_address Ring address to read from - * @param[out] o_data ecmdDataBufferBase object that holds data read from - * address - * @param[in] i_ringMode Any number of mode options from fapi::RingMode ORed - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiGetRing(const fapi::Target& i_target, - const scanRingId_t i_address, - ecmdDataBufferBase & o_data, - const uint32_t i_ringMode = 0); - -/** - * @brief Writes a ring register on a target - * @param[in] i_target Target to operate on - * @param[in] i_address Ring address to write to - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @param[in] i_ringMode Any number of mode options from fapi::RingMode ORed - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiPutRing(const fapi::Target& i_target, - const scanRingId_t i_address, - ecmdDataBufferBase & i_data, - const uint32_t i_ringMode = 0); - - -/** - * @brief Modifies a ring register on a target - * @param[in] i_target Target to operate on - * @param[in] i_address Ring address to modify - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @param[in] i_modifyMode The modify mode (or/and/xor) - * @param[in] i_ringMode Any number of mode options from fapi::RingMode ORed - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode fapiModifyRing(const fapi::Target& i_target, - const scanRingId_t i_address, - ecmdDataBufferBase & i_data, - const fapi::ChipOpModifyMode i_modifyMode, - const uint32_t i_ringMode = 0); - -// -------------------------------------------------------------------------- -// NOTE: -// These spy access interfaces are only used in FSP and cronus -// HB does not allow spy access - -#if defined(FAPI_SUPPORT_SPY_AS_ENUM) || defined(FAPI_SUPPORT_SPY_AS_STRING) -/** - * @brief Reads a Spy from a target - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[out] o_data Storage for output data - * - * @return ReturnCode. Zero on success, else platform specified error - * - * @note: The string version is only supported for cronus. - * - * The fapi design to support both FSP and cronus use of get and - * put spy functions is dependant on the SPY names being expanded - * to resemble a valid C identifier. This design places some - * restrictions on the SPY names which can be used. - * - * 1. if the spy name contains a # procedure writers should replace it - * with an __P__ for example - - * - * ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS - * becomes - * ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS - * - * 2. if the spy name has a number following a "." it must have an - * underscore prepended to the number. - * - * EH.TPCHIP.2KX100_ARY_CLK_EDGES_DLY - * becomes - * EH.TPCHIP._2KX100_ARY_CLK_EDGES_DLY - * - * Example SPY name: - * The hardware procedure should call the function like: - * - * ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS - * - * fapi::ReturnCode rc = fapiGetSpy( targ, - * ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS, data ); - * - * NOTE: the ID is not in quotes the fapi code will handle adding the - * quotes for the cronus environment - * -*/ -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_ENUM - -#ifndef DOCUMENTATION -#define fapiGetSpy(TARGET, ID, DATA) _fapiGetSpy(TARGET, FAPI_SPY_NAMES::ID.value, DATA ) -#endif -fapi::ReturnCode _fapiGetSpy(const fapi::Target& i_target, - const spyId_t i_spyId, - ecmdDataBufferBase & o_data); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_STRING - -#ifndef DOCUMENTATION -#define fapiGetSpy(TARGET, ID, DATA) _fapiGetSpy(TARGET, #ID, DATA) -#endif -fapi::ReturnCode _fapiGetSpy(const fapi::Target& i_target, - const char * const i_spyId, - ecmdDataBufferBase & o_data); -#endif - -#if defined(FAPI_SUPPORT_SPY_AS_ENUM) || defined(FAPI_SUPPORT_SPY_AS_STRING) -/** - * @brief Writes a spy on a target - * @param[in] i_target Target to operate on - * @param[in] i_spyId The spy's id - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * - * @return ReturnCode. Zero on success, else platform specified error - * - * @note: The string version is only supported for cronus. - * - * The fapi design to support both FSP and cronus use of get and - * put spy functions is dependent on the SPY names being expanded - * to resemble a valid C identifier. This design places some - * restrictions on the SPY names which can be used. - * - * 1. if the spy name contains a # procedure writers should replace it - * with an __P__ for example - - * - * ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS - * becomes - * ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS - * - * 2. if the spy name has a number following a "." it must have an - * underscore prepended to the number. - * - * EH.TPCHIP.2KX100_ARY_CLK_EDGES_DLY - * becomes - * EH.TPCHIP._2KX100_ARY_CLK_EDGES_DLY - * - * Example SPY name: - * The hardware procedure should call the function like: - * - * ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS - * - * fapi::ReturnCode rc = fapiPutSpy( targ, - * ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS, data ); - * - * NOTE: the ID is not in quotes the fapi code will handle adding the - * quotes for the cronus environment - * -*/ -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -#ifndef DOCUMENTATION -#define fapiPutSpy(TARGET, ID, DATA) _fapiPutSpy(TARGET, FAPI_SPY_NAMES::ID.value, DATA) -#endif -fapi::ReturnCode _fapiPutSpy(const fapi::Target& i_target, - const spyId_t i_spyId, - ecmdDataBufferBase & i_data); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_STRING -#ifndef DOCUMENTATION -#define fapiPutSpy(TARGET, ID, DATA) _fapiPutSpy(TARGET, #ID, DATA) -#endif -fapi::ReturnCode _fapiPutSpy(const fapi::Target& i_target, - const char* const i_spyId, - ecmdDataBufferBase & i_data); - -#endif - -#if defined(FAPI_SUPPORT_SPY_AS_ENUM) || defined(FAPI_SUPPORT_SPY_AS_STRING) -/** - * @brief Writes data into a ring image - * @param[in] i_target Target to operate on - * @param[in] i_spyId The spy's id - * @param[in] i_data ecmdDataBufferBase object that holds data to - * be written - * @param[out] o_imageData ecmdDataBufferBase object that holds data to - * write into - * @return ReturnCode. Zero on success, else platform specified error - * - * @note: The string version is only supported for cronus. - * - * The fapi design to support both FSP and cronus use of get and - * put spy functions is dependent on the SPY names being expanded - * to resemble a valid C identifier. This design places some - * restrictions on the SPY names which can be used. - * - * See fapiPutSpy for details on spy id specifics. - */ -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -#ifndef DOCUMENTATION -#define fapiPutSpyImage(TARGET, ID, DATA1, DATA2) _fapiPutSpyImage(TARGET, \ - FAPI_SPY_NAMES::ID.value, \ - DATA1, DATA2) -#endif -fapi::ReturnCode _fapiPutSpyImage(const fapi::Target& i_target, - const spyId_t i_spyId, - const ecmdDataBufferBase & i_data, - ecmdDataBufferBase & o_imageData); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_STRING -// fapiPutSpyImage function Cronus version -#ifndef DOCUMENTATION -#define fapiPutSpyImage(TARGET, ID, DATA1, DATA2) _fapiPutSpyImage(TARGET, #ID,\ - DATA1,DATA2) -#endif - -fapi::ReturnCode _fapiPutSpyImage(const fapi::Target& i_target, - const char* const i_spyId, - const ecmdDataBufferBase & i_data, - ecmdDataBufferBase & o_imageData); -#endif - -#if defined(FAPI_SUPPORT_SPY_AS_ENUM) || defined(FAPI_SUPPORT_SPY_AS_STRING) -/** - * @brief Reads data from a ring image - * @param[in] i_target Target to operate on - * @param[in] i_spyId The spy's id - * @param[out] o_data ecmdDataBufferBase object where data is - * returned - * @param[in] i_imageData ecmdDataBufferBase object that holds ring image - * to read data from - * @return ReturnCode. Zero on success, else platform specified error - * - * @note: The string version is only supported for cronus. - * - * The fapi design to support both FSP and cronus use of get and - * put spy functions is dependent on the SPY names being expanded - * to resemble a valid C identifier. This design places some - * restrictions on the SPY names which can be used. - * - * See fapiPutSpy for details on spy id specifics. - */ -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -#ifndef DOCUMENTATION -#define fapiGetSpyImage(TARGET, ID, DATA1, DATA2) _fapiGetSpyImage(TARGET, \ - FAPI_SPY_NAMES::ID.value, \ - DATA1, DATA2) -#endif -fapi::ReturnCode _fapiGetSpyImage(const fapi::Target& i_target, - const spyId_t i_spyId, - ecmdDataBufferBase & o_data, - const ecmdDataBufferBase & i_imageData); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_STRING -// fapiGetSpyImage function Cronus version -#ifndef DOCUMENTATION -#define fapiGetSpyImage(TARGET, ID, DATA1, DATA2) _fapiGetSpyImage(TARGET,\ - #ID, DATA1,DATA2) -#endif - -fapi::ReturnCode _fapiGetSpyImage(const fapi::Target& i_target, - const char* const i_spyId, - ecmdDataBufferBase & o_data, - const ecmdDataBufferBase & i_imageData); -#endif - -#ifdef FAPI_SUPPORT_MULTI_SCOM -/** - * @brief Performs a multiple SCOM operation - * - * @par Description: - * This interface performs multiple SCOM operations on a chip or chiplet, - * in the order specified by the input MultiScom object. See fapiMultiScom.H - * for details of how to populate the MultiScom object with SCOM operations - * - * @param[in] i_target Chip/Chiplet target to do MultiScom on - * @param[in,out] io_multiScomObj Reference to a MultiScom object, - * pre-populated with SingleScomInfo entries - * to perform multiple SCOMs on input target - * @return ReturnCode Zero on success, else platform specified - * error - * - * @note This is a synchronous interface and would return after all the SCOM - * operations are completed or on the first failed SCOM operation - * - * @note SCOMs will be performed in the order they were added to the input - * MultiScom object - * - * @note In case of errors, the platform code is responsible to collect and - * add all the required error info and FFDC into the error data for - * debugging - * - * @note If the SCOM operations added are specific to a processor chip, - * then the FSI Shift Engine configured in scatter-gather DMA mode - * extension would be used to execute the SCOM operations in a - * performance optimize mode. In this mode, the special - * SCOM_BULK_READ_MODE and SCOM_BULK_WRITE_MODE operations are - * supported that allow a large bulk of SCOM access (in multiple of 64 - * bits) for targets that support auto-increment. The - * SCOM_WRITE_UNDER_MASK operation is not supported in this mode - * - * @note If the SCOM operations added are specific to a memory buffer chip, - * then the regular SCOM engine is used to execute the SCOM operations. - * SCOM_WRITE_UNDER_MASK operation is supported in this mode, but the - * special SCOM_BULK_READ_MODE and SCOM_BULK_WRITE_MODE operations are - * not supported due to hardware limitations. - */ -fapi::ReturnCode fapiMultiScom ( - const fapi::Target& i_target, - fapi::MultiScom& io_multiScomObj); -#endif // FAPI_SUPPORT_MULTI_SCOM - - -} // extern "C" - -#endif // FAPIHWACCESS_H_ diff --git a/src/include/usr/hwpf/fapi/fapiHwpExecutor.H b/src/include/usr/hwpf/fapi/fapiHwpExecutor.H deleted file mode 100644 index c02aae5cb..000000000 --- a/src/include/usr/hwpf/fapi/fapiHwpExecutor.H +++ /dev/null @@ -1,56 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiHwpExecutor.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiHwpExecutor.H,v 1.5 2013/10/15 13:13:31 dcrowell Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiHwpExecutor.H,v $ - -/** - * @file fapiHwpExecutor.H - * - * @brief Defines the FAPI HWP Executor Macro. - * - * The FAPI HWP Executor macro is called when a PLAT invoker function or a HWP - * wants to execute a HWP. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 09/22/2011 Removed mandatory target - * parameter from FAPI_EXEC_HWP - */ -#ifndef FAPIHWPEXECUTOR_H_ -#define FAPIHWPEXECUTOR_H_ - -#include <fapiPlatHwpExecutor.H> - -/** - * @brief HWP Executor macro - * - * This macro calls a PLAT macro which will do any platform specific work to - * execute the HWP (e.g. dlopening a shared library) - */ -#define FAPI_EXEC_HWP(RC, FUNC, _args_...) \ - FAPI_PLAT_EXEC_HWP(RC, FUNC, ##_args_) - -#endif // FAPIHWPEXECUTOR_H_ diff --git a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H deleted file mode 100644 index 3f50ec389..000000000 --- a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H +++ /dev/null @@ -1,191 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiMBvpdAccess.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiMBvpdAccess.H,v 1.12 2015/09/29 15:59:29 dcrowell Exp $ -/** - * @file fapiMBvpdAccess.H - * - * @brief Defines the Memory Bus (Centaur) VPD functions that platform - * must implement - * - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * whs 01/24/2013 Added fapiGetMBvpdField - * whs 04/29/2013 Added VSPD record, keywords - */ - -#ifndef _FAPI_FAPIMBVPDACCESS_H_ -#define _FAPI_FAPIMBVPDACCESS_H_ - -#include <stdint.h> -#include <stddef.h> -#include <fapiReturnCode.H> -#include <fapiTarget.H> - -namespace fapi -{ - enum MBvpdRecord - { - MBVPD_RECORD_VEIR = 0x00, - MBVPD_RECORD_VER0 = 0x01, - MBVPD_RECORD_MER0 = 0x02, - MBVPD_RECORD_VSPD = 0x03, - MBVPD_RECORD_VINI = 0x04, - MBVPD_RECORD_OPFR = 0x05, - MBVPD_RECORD_VNDR = 0x06, - MBVPD_RECORD_SPDX = 0x07, - }; - - enum MBvpdKeyword - { - MBVPD_KEYWORD_PDI = 0x00, - MBVPD_KEYWORD_PF = 0x01, - MBVPD_KEYWORD_MT = 0x02, - MBVPD_KEYWORD_MR = 0x03, - MBVPD_KEYWORD_PDA = 0x04, - MBVPD_KEYWORD_EL = 0x05, - MBVPD_KEYWORD_LM = 0x06, - MBVPD_KEYWORD_MW = 0x07, - MBVPD_KEYWORD_MV = 0x08, - MBVPD_KEYWORD_AM = 0x09, - MBVPD_KEYWORD_VZ = 0x0a, - MBVPD_KEYWORD_PDD = 0x0b, - MBVPD_KEYWORD_MX = 0x0c, - MBVPD_KEYWORD_DW = 0x0d, - MBVPD_KEYWORD_PN = 0x0e, - MBVPD_KEYWORD_SN = 0x0f, - MBVPD_KEYWORD_DR = 0x10, - MBVPD_KEYWORD_CE = 0x11, - MBVPD_KEYWORD_FN = 0x12, - MBVPD_KEYWORD_CC = 0x13, - MBVPD_KEYWORD_HE = 0x14, - MBVPD_KEYWORD_CT = 0x15, - MBVPD_KEYWORD_HW = 0x16, - MBVPD_KEYWORD_VD = 0x17, - MBVPD_KEYWORD_VN = 0x18, - MBVPD_KEYWORD_VP = 0x19, - MBVPD_KEYWORD_SV = 0x1a, - MBVPD_KEYWORD_M0 = 0x1b, - MBVPD_KEYWORD_M1 = 0x1c, - MBVPD_KEYWORD_M2 = 0x1d, - MBVPD_KEYWORD_M3 = 0x1e, - MBVPD_KEYWORD_M4 = 0x1f, - MBVPD_KEYWORD_M5 = 0x20, - MBVPD_KEYWORD_M6 = 0x21, - MBVPD_KEYWORD_M7 = 0x22, - MBVPD_KEYWORD_M8 = 0x23, - MBVPD_KEYWORD_T1 = 0x24, - MBVPD_KEYWORD_T2 = 0x25, - MBVPD_KEYWORD_T4 = 0x26, - MBVPD_KEYWORD_T5 = 0x27, - MBVPD_KEYWORD_T6 = 0x28, - MBVPD_KEYWORD_T8 = 0x29, - MBVPD_KEYWORD_Q0 = 0x2a, - MBVPD_KEYWORD_Q1 = 0x2b, - MBVPD_KEYWORD_Q2 = 0x2c, - MBVPD_KEYWORD_Q3 = 0x2d, - MBVPD_KEYWORD_Q4 = 0x2e, - MBVPD_KEYWORD_Q5 = 0x2f, - MBVPD_KEYWORD_Q6 = 0x30, - MBVPD_KEYWORD_Q7 = 0x31, - MBVPD_KEYWORD_Q8 = 0x32, - MBVPD_KEYWORD_K0 = 0x33, - MBVPD_KEYWORD_K1 = 0x34, - MBVPD_KEYWORD_K2 = 0x35, - MBVPD_KEYWORD_K3 = 0x36, - MBVPD_KEYWORD_K4 = 0x37, - MBVPD_KEYWORD_K5 = 0x38, - MBVPD_KEYWORD_K6 = 0x39, - MBVPD_KEYWORD_K7 = 0x3a, - MBVPD_KEYWORD_K8 = 0x3b, - MBVPD_KEYWORD_MM = 0x3c, - MBVPD_KEYWORD_SS = 0x3d, - MBVPD_KEYWORD_ET = 0x3e, - MBVPD_KEYWORD_VM = 0x3f, - MBVPD_KEYWORD_PD1 = 0x40, //#1 - MBVPD_KEYWORD_PDZ = 0x41, //#Z - MBVPD_KEYWORD_PD4 = 0x42, //#4 - MBVPD_KEYWORD_PD5 = 0x43, //#5 - MBVPD_KEYWORD_PD6 = 0x44, //#6 - MBVPD_KEYWORD_PD8 = 0x45, //#8 - MBVPD_KEYWORD_PDY = 0x46, //#Y - }; - -} - -extern "C" -{ - -/** - * @brief Get Memory Buffer (Centaur) VPD field. - * - * A Memory Buffer VPD field is specified using a record and keyword enumerator - * - * Suggested way to call this routine is to call it once with a NULL buffer - * pointer to to retrieve the size of the record, then allocate the proper - * size of the buffer and call again. - * - * @param[in] i_record Record enumerator - * @param[in] i_keyword Keyword enumerator - * @param[in] i_memBufTarget Reference to memory buffer chip target for - * the record - * @param[in] i_pBuffer Pointer to buffer where record will be stored. If - * NULL then the size of record will be stored in - * io_fieldSize - * @param[io] io_fieldSize Size of i_pBuffer in bytes - * - * @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value. - */ -fapi::ReturnCode fapiGetMBvpdField(const fapi::MBvpdRecord i_record, - const fapi::MBvpdKeyword i_keyword, - const fapi::Target &i_memBufTarget, - uint8_t * const i_pBuffer, - uint32_t &io_fieldSize); - -/** - * @brief Set Memory Buffer (Centaur) VPD field. - * - * A Memory Buffer VPD field is specified using a record and keyword enumerator - * - * @param[in] i_record Record enumerator - * @param[in] i_keyword Keyword enumerator - * @param[in] i_memBufTarget Reference to memory buffer chip target for - * the record - * @param[in] i_pBuffer Pointer to buffer where data to set is stored - * @param[io] i_fieldSize Size of i_pBuffer in bytes - * - * @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value. - */ -fapi::ReturnCode fapiSetMBvpdField(const fapi::MBvpdRecord i_record, - const fapi::MBvpdKeyword i_keyword, - const fapi::Target &i_memBufTarget, - const uint8_t * const i_pBuffer, - const uint32_t i_fieldSize); -} - -#endif diff --git a/src/include/usr/hwpf/fapi/fapiMvpdAccess.H b/src/include/usr/hwpf/fapi/fapiMvpdAccess.H deleted file mode 100644 index 3d12666bc..000000000 --- a/src/include/usr/hwpf/fapi/fapiMvpdAccess.H +++ /dev/null @@ -1,221 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiMvpdAccess.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiMvpdAccess.H,v 1.10 2015/04/23 19:42:38 whs Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiMvpdAccess.H,v $ - -/** - * @file fapiMvpdAccess.H - * - * @brief Defines the Module VPD functions that platform must implement - * - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 10/09/2012 Added fapiGetMvpdField - */ - -#ifndef _FAPI_FAPIMVPDACCESS_H_ -#define _FAPI_FAPIMVPDACCESS_H_ - -#include <stdint.h> -#include <stddef.h> -#include <fapiReturnCode.H> -#include <fapiTarget.H> - -namespace fapi -{ - enum MvpdRecord - { - MVPD_RECORD_CRP0 = 0x00, - MVPD_RECORD_CP00 = 0x01, - MVPD_RECORD_VINI = 0x02, - MVPD_RECORD_LRP0 = 0x03, - MVPD_RECORD_LRP1 = 0x04, - MVPD_RECORD_LRP2 = 0x05, - MVPD_RECORD_LRP3 = 0x06, - MVPD_RECORD_LRP4 = 0x07, - MVPD_RECORD_LRP5 = 0x08, - MVPD_RECORD_LWP0 = 0x09, - MVPD_RECORD_LWP1 = 0x0a, - MVPD_RECORD_LWP2 = 0x0b, - MVPD_RECORD_LWP3 = 0x0c, - MVPD_RECORD_LWP4 = 0x0d, - MVPD_RECORD_LWP5 = 0x0e, - MVPD_RECORD_VRML = 0x0f, - MVPD_RECORD_VWML = 0x10, - MVPD_RECORD_VER0 = 0x11, - MVPD_RECORD_MER0 = 0x12, - MVPD_RECORD_VMSC = 0x13, - }; - - enum MvpdKeyword - { - MVPD_KEYWORD_VD = 0x00, - MVPD_KEYWORD_ED = 0x01, - MVPD_KEYWORD_TE = 0x02, - MVPD_KEYWORD_DD = 0x03, - MVPD_KEYWORD_DN = 0x04, - MVPD_KEYWORD_PG = 0x05, - MVPD_KEYWORD_PK = 0x06, - MVPD_KEYWORD_PDR = 0x07, - MVPD_KEYWORD_PDV = 0x08, - MVPD_KEYWORD_PDH = 0x09, - MVPD_KEYWORD_SB = 0x0a, - MVPD_KEYWORD_DR = 0x0b, - MVPD_KEYWORD_VZ = 0x0c, - MVPD_KEYWORD_CC = 0x0d, - MVPD_KEYWORD_CE = 0x0e, - MVPD_KEYWORD_FN = 0x0f, - MVPD_KEYWORD_PN = 0x10, - MVPD_KEYWORD_SN = 0x11, - MVPD_KEYWORD_PR = 0x12, - MVPD_KEYWORD_HE = 0x13, - MVPD_KEYWORD_CT = 0x14, - MVPD_KEYWORD_HW = 0x15, - MVPD_KEYWORD_PDM = 0x16, - MVPD_KEYWORD_IN = 0x17, - MVPD_KEYWORD_PDI = 0x18, - MVPD_KEYWORD_PDG = 0x19, - MVPD_KEYWORD_PB = 0x1a, - MVPD_KEYWORD_CH = 0x1b, - MVPD_KEYWORD_IQ = 0x1c, - MVPD_KEYWORD_PM = 0x1d, - MVPD_KEYWORD_PZ = 0x1e, - MVPD_KEYWORD_N20 = 0x1f, - MVPD_KEYWORD_N21 = 0x20, - MVPD_KEYWORD_N30 = 0x21, - MVPD_KEYWORD_N31 = 0x22, - }; - - typedef struct voltageBucketData - { - // bucket Id - uint8_t bucketId; - // Nominal - uint16_t nomFreq; - uint16_t VnestNomVltg; - uint16_t InestNomCurr; - uint16_t VcsNomVltg; - uint16_t IcsNomCurr; - // PowerSave - uint16_t PSFreq; - uint16_t VnestPSVltg; - uint16_t InestPSCurr; - uint16_t VcsPSVltg; - uint16_t IcsPSCurr; - // Turbo - uint16_t turboFreq; - uint16_t VnestTurboVltg; - uint16_t InestTurboCurr; - uint16_t VcsTurboVltg; - uint16_t IcsTurboCurr; - //Fvmin - uint16_t fvminFreq; - uint16_t VnestFvminVltg; - uint16_t InestFvminCurr; - uint16_t VcsFvminVltg; - uint16_t IcsFvminCurr; - //Lab - uint16_t labFreq; - uint16_t VnestLabVltg; - uint16_t InestLabCurr; - uint16_t VcsLabVltg; - uint16_t IcsLabCurr; - }voltageBucketData_t; - -} - -extern "C" -{ - -/** - * @brief Get Module VPD field. - * - * A Module VPD field is specified using a record and keyword enumerator - * - * Suggested way to call this routine is to call it once with a NULL buffer - * pointer to to retrieve the size of the record, then allocate the proper - * size of the buffer and call again. - * - * @param[in] i_record Record enumerator - * @param[in] i_keyword Keyword enumerator - * @param[in] i_procTarget Reference to processor chip target for the record - * @param[in] i_pBuffer Pointer to buffer where record will be stored. If - * NULL then the size of record will be stored in - * io_fieldSize - * @param[in,out] io_fieldSize Size of i_pBuffer in bytes - * - * @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value. - */ -fapi::ReturnCode fapiGetMvpdField(const fapi::MvpdRecord i_record, - const fapi::MvpdKeyword i_keyword, - const fapi::Target &i_procTarget, - uint8_t * const i_pBuffer, - uint32_t &io_fieldSize); - -/** - * @brief Set Module VPD field. - * - * A Module VPD field is specified using a record and keyword enumerator - * - * @param[in] i_record Record enumerator - * @param[in] i_keyword Keyword enumerator - * @param[in] i_procTarget Reference to processor chip target for the record - * @param[in] i_pBuffer Pointer to buffer where data to set is stored - * @param[in] i_fieldSize Size of i_pBuffer in bytes - * - * @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value. - */ -fapi::ReturnCode fapiSetMvpdField(const fapi::MvpdRecord i_record, - const fapi::MvpdKeyword i_keyword, - const fapi::Target &i_procTarget, - const uint8_t * const i_pBuffer, - const uint32_t i_fieldSize); - -/** - * @brief Get #V bucket data from VPD - * - * @par Detailed Description: - * This function reads PR keyword from the VPD, parses PR keyword - * to get voltage bucket id, reads #V keyword (Voltage data) from VPD, - * parses #V keyword to get voltage data corresponding to the bucket id - * indicated by the PR keyword and returns data to the caller. - * - * @param[in] i_pTarget Pointer to proc chip target. - * @param[in] i_record VPD record number to read #V bucket data - * @param[out] o_data On success, structure with #V bucket data from VPD - * - * @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value. - */ -fapi::ReturnCode fapiGetPoundVBucketData(const fapi::Target &i_procTarget, - const uint32_t i_record, - fapi::voltageBucketData_t & o_data); - -} - -#endif diff --git a/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H b/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H deleted file mode 100644 index d7bf534b9..000000000 --- a/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H +++ /dev/null @@ -1,370 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiPlatHwAccess.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiPlatHwAccess.H,v 1.10 2014/01/20 20:58:47 mjjones Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiPlatHwAccess.H,v $ - -/** - * @file fapiPlatHwAccess.H - * - * @brief Defines hardware-access functions for the platform layer. - * Hardware procedure writers will not call these functions. - * - * Implementors of platform code will provide worker routines - * for these functions in file hwpf/plat/fapiPlatHwAccess.C. - * fapi.H will not include this file, so platform implementors - * will have to include this file explicitly. - * - * These platform entry points are called by fapi functions from - * hwpf/fapi/fapiHwAccess.C which are wrapper functions that - * output scand traces common to all platforms. - * - * These functions have the same argument signatures as the - * fapi-level functions, but the function names her start with - * "plat." - * - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * monte 8sep2011 new - * mjjones 11/10/2011 Use ecmdDataBufferBase - * 836579 thi May 22,2012 Spy/Ring supports - * mjjones 07/12/2012 Add Pulse mode option to - * Ring funcs - * F876964 jknight Apr, 02,2013 fapi get/setSpyImage - * F873646 srimeesa Mar 10,2013 64Bit SPYID and - * ClockDomain ID support - * F883863 atendolk May 16,2013 fapi MultiScom support - */ - -#ifndef FAPIPLATHWACCESS_H_ -#define FAPIPLATHWACCESS_H_ - -#include <stdint.h> -#include <ecmdDataBufferBase.H> -#include <fapiReturnCode.H> -#include <fapiTarget.H> -#ifdef FAPI_SUPPORT_MULTI_SCOM -#include <fapiMultiScom.H> -#endif - -extern "C" -{ - -//------------------------------------------------------------------------------ -// HW Communication Functions to be implemented at the platform layer. -//------------------------------------------------------------------------------ - - -/** - * @brief Platform-level implementation called by GetScom() - * Hardware procedures writers will not call this function. - * - * - * @param[in] i_target Target to operate on - * @param[in] i_address Scom address to read from - * @param[out] o_data ecmdDataBufferBase object that holds data read from - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platGetScom(const fapi::Target& i_target, - const uint64_t i_address, - ecmdDataBufferBase & o_data); - - -/** - * @brief Platform-level implementation called by PutScom(). - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address Scom address to write to - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutScom(const fapi::Target& i_target, - const uint64_t i_address, - ecmdDataBufferBase & i_data); - - -/** - * @brief Platform-level implementation called by PutScomUnderMask() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address Scom address to write to - * @param[in] i_data ecmdDataBufferBase object that holds the data - * @param[in] i_mask ecmdDataBufferBase object that holds the mask (i_data to - * write) - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutScomUnderMask(const fapi::Target& i_target, - const uint64_t i_address, - ecmdDataBufferBase & i_data, - ecmdDataBufferBase & i_mask); - -#ifdef FAPI_SUPPORT_MULTI_SCOM -/** - * @brief Platform-level implementation called by fapiMultiScom() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[inout] io_multiScomList MultiScom object pre-populated with SCOMs to - * be performed on i_target - * @return ReturnCode Zero on success, else platform specified error - */ -fapi::ReturnCode platMultiScom (const fapi::Target& i_target, - fapi::MultiScom& io_multiScomList); -#endif - -/** - * @brief Platorm-level implementation called by GetCfamRegister() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address CFAM address to read from - * @param[out] o_data ecmdDataBufferBase object that holds data read from - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platGetCfamRegister(const fapi::Target& i_target, - const uint32_t i_address, - ecmdDataBufferBase & o_data); - - -/** - * @brief Platform-level implementation called by PutCfamRegister() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address CFAM address to write to - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutCfamRegister(const fapi::Target& i_target, - const uint32_t i_address, - ecmdDataBufferBase & i_data); - - -/** - * @brief Platform-level implementation of ModifyCfamRegister() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address CFAM address to write to - * @param[in] i_data ecmdDataBufferBase object that holds the modifying data - * @param[in] i_modifyMode The modify mode (or/and/xor) - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platModifyCfamRegister(const fapi::Target& i_target, - const uint32_t i_address, - ecmdDataBufferBase & i_data, - const fapi::ChipOpModifyMode i_modifyMode); - - -/** - * @brief Platform-level implementation called by fapiGetRing() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address Ring address to read from - * @param[out] o_data ecmdDataBufferBase object that holds data read from - * address - * @param[in] i_ringMode Any number of mode options from fapi::RingMode ORed - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platGetRing(const fapi::Target& i_target, - const scanRingId_t i_address, - ecmdDataBufferBase & o_data, - const uint32_t i_ringMode); - - -/** - * @brief Platform-level implementation called by fapiPutRing() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address Ring address to write to - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @param[in] i_ringMode Any number of mode options from fapi::RingMode ORed - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutRing(const fapi::Target& i_target, - const scanRingId_t i_address, - ecmdDataBufferBase & i_data, - const uint32_t i_ringMode); - - -/** - * @brief Platform-level implementation called by fapiModifyRing() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_address Ring address to modify - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * @param[in] i_ringMode Any number of mode options from fapi::RingMode ORed - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platModifyRing(const fapi::Target& i_target, - const scanRingId_t i_address, - ecmdDataBufferBase & i_data, - const fapi::ChipOpModifyMode i_modifyMode, - const uint32_t i_ringMode); - -// -------------------------------------------------------------------------- -// NOTE: -// These spy access interfaces are only used in FSP. -// HB does not allow spy access - -/** - * @brief Platform-level implementation called by fapiGetSpy() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[out] o_data Storage for output data - * - * @return ReturnCode. Zero on success, else platform specified error - */ -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -fapi::ReturnCode platGetSpy(const fapi::Target& i_target, - const spyId_t i_spyId, - ecmdDataBufferBase & o_data); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_STRING -/** - * @brief Reads a Spy from a target - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[out] o_data Storage for output data - * - * @return ReturnCode. Zero on success, else platform specified error - * - * @note: This is only supported in the cronus environment - * it will not compile in FSP code - */ -fapi::ReturnCode platGetSpy(const fapi::Target& i_target, - const char * const i_spyId, - ecmdDataBufferBase & o_data); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -/** - * @brief Platform-level implementation called by fapiPutSpy() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to operate on - * @param[in] i_spyId The spy's id - * @param[in] i_data ecmdDataBufferBase object that holds data to write into - * address - * - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutSpy(const fapi::Target& i_target, - const spyId_t i_spyId, - ecmdDataBufferBase & i_data); -#endif - -#ifdef FAPI_SUPPORT_SPY_AS_STRING -fapi::ReturnCode platPutSpy(const fapi::Target& i_target, - const char * const i_spyId, - ecmdDataBufferBase & i_data); -#endif -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -/** - * @brief Platform-level implementation called by fapiGetSpyImage() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[out] o_data Storage for output data - * @param[in] i_imageData Input ring data - * - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platGetSpyImage(const fapi::Target& i_target, - const spyId_t i_spyId, - ecmdDataBufferBase & o_data, - const ecmdDataBufferBase & i_imageData); -#endif -#ifdef FAPI_SUPPORT_SPY_AS_STRING -/** - * @brief Platform-level implementation called by fapiGetSpyImage() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[out] o_data Storage for output data - * @param[in] i_imageData Input ring data - * - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platGetSpyImage(const fapi::Target& i_target, - const char * const i_spyId, - ecmdDataBufferBase & o_data, - const ecmdDataBufferBase & i_imageData); -#endif -#ifdef FAPI_SUPPORT_SPY_AS_ENUM -/** - * @brief Platform-level implementation called by fapiPutSpyImage() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[in] i_data Data to be written into the image - * @param[out] io_imageData Holds ring image to write data into - * - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutSpyImage(const fapi::Target& i_target, - const spyId_t i_spyId, - const ecmdDataBufferBase & i_data, - ecmdDataBufferBase & io_imageData); -#endif -#ifdef FAPI_SUPPORT_SPY_AS_STRING -/** - * @brief Platform-level implementation called by fapiPutSpyImage() - * Hardware procedures writers will not call this function. - * - * @param[in] i_target Target to read spy from - * @param[in] i_spyId The spy's id - * @param[in] i_data Data to be written into the image - * @param[out] io_imageData Holds ring image to write data into - * - * @return ReturnCode. Zero on success, else platform specified error - */ -fapi::ReturnCode platPutSpyImage(const fapi::Target& i_target, - const char* const i_spyId, - const ecmdDataBufferBase & i_data, - ecmdDataBufferBase & io_imageData); - -#endif -} // extern "C" - -#endif // FAPIPLATHWACCESS_H_ diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H deleted file mode 100644 index 83c3b045d..000000000 --- a/src/include/usr/hwpf/fapi/fapiReturnCode.H +++ /dev/null @@ -1,633 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiReturnCode.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiReturnCode.H,v 1.21 2015/01/16 11:30:02 sangeet2 Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiReturnCode.H,v $ - -/** - * @file fapiReturnCode.H - * - * @brief Defines the ReturnCode class that is a generic return code. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. - * mjjones 07/05/2011 Removed const from data - * mjjones 07/25/2011 Added support for FFDC and - * Error Target - * camvanng 09/06/2011 Added function template for - * setHwpFfdc - * mjjones 09/22/2011 Added ErrorInfo Support - * mjjones 11/10/2011 Use ecmdDataBufferBase - * mjjones 01/12/2012 Enforce correct usage - * mjjones 02/22/2012 Allow user to add Target FFDC - * mjjones 03/16/2012 Add type to FFDC data - * mjjones 03/16/2012 Allow different PLAT errors - * mjjones 04/20/2012 Remove deprecated int assign - * brianh 07/31/2012 performance/size optimizations - * mjjones 08/14/2012 Created getCreateReturnCodeDataRef - * mjjones 09/19/2012 Add FFDC ID to error info - * mjjones 03/22/2013 Support Procedure Callouts - * mjjones 05/20/2013 Support Bus Callouts - * mjjones 06/06/2013 Check FFDC size at compile time - * mjjones 06/24/2013 Support Children CDGs - * mjjones 08/26/2013 Support Hw Callout - * rjknight 09/10/2013 Support DIMM callout from - * MBA port and dimm number - * mjjones 11/08/2013 Do not define struct in union - * whs 03/11/2014 Add FW traces to error logs - * sangeet2 01/16/2015 Modify ErrorInfoEntryHwCallout - */ - -#ifndef FAPIRETURNCODE_H_ -#define FAPIRETURNCODE_H_ - -#include <stdint.h> -#include <stddef.h> -#include <string.h> -#include <ecmdDataBufferBase.H> -#include <fapiTarget.H> -#include <fapiReturnCodes.H> -#include <fapiErrorInfo.H> -#include <fapiHwpErrorInfo.H> -#include <fapiPlatTrace.H> -#include <fapiHwpReturnCodes.H> -#include <fapiCollectRegFfdc.H> - -/** - * @brief Set HWP Error macro - * - * This macro should be used by a HWP to create an error. The ReturnCode's - * internal return code is set and any error information in the Error XML file - * is added to the ReturnCode - */ -#define FAPI_SET_HWP_ERROR(RC, ERROR) \ - RC._setHwpError(fapi::ERROR); \ - ERROR##_CALL_FUNCS_TO_COLLECT_FFDC(RC); \ - ERROR##_CALL_FUNCS_TO_COLLECT_REG_FFDC(RC); \ - ERROR##_ADD_ERROR_INFO(RC) - -/** - * @brief Add info to HWP Error macro - * - * This macro should be used by an FFDC HWP to add error information from an - * Error XML file to an existing error. - */ -#define FAPI_ADD_INFO_TO_HWP_ERROR(RC, ERROR) \ - ERROR##_CALL_FUNCS_TO_COLLECT_FFDC(RC); \ - ERROR##_CALL_FUNCS_TO_COLLECT_REG_FFDC(RC); \ - ERROR##_ADD_ERROR_INFO(RC) - -namespace fapi -{ - -// Forward declarations -class ReturnCodeDataRef; - -/** - * @class ReturnCode - * - * This class provides a generic return code. It contains the rcValue (return - * code value) which is of type uint32_t. - * - * FAPI can set an error in the ReturnCode by calling setFapiError. - * PLAT can set an error in the ReturnCode by calling setPlatError, this - * function associates heap based PlatData to the ReturnCode (use-case is - * an error log). - * HWP can set an error in the ReturnCode by calling FAPI_SET_HWP_ERROR, this - * macro adds any error information specified in the error XML file to the - * ReturnCode - * HWP can add error information to a ReturnCode that already contains an - * error by calling FAPI_ADD_INFO_TO_HWP_ERROR, this is called by HWPs - * that are specifically written to collect FFDC. This macro adds any error - * information specified in the error XML file to the ReturnCode - * FAPI/PLAT/HWP can set an ecmdDataBufferBase error in the ReturnCode by - * calling setEcmdError - * - * A ReturnCode is copyable and assignable. Therefore, it cannot be subclassed. - * - * When a ReturnCode is copied, any PlatData or ErrorInfo is not copied - * because it may be heavyweight. Both ReturnCodes will refer to the same data. - * this is achieved with the ReturnCodeDataRef class. - * - * A ReturnCode object is not thread safe, multiple threads must not use the - * same ReturnCode object concurrently. - */ -class ReturnCode -{ -public: - - /** - * @brief Default constructor. Sets rcValue to success - */ - ReturnCode() : iv_rcValue(FAPI_RC_SUCCESS), iv_pDataRef(NULL) { } - - /** - * @brief Constructor. Sets rcValue to the specified value - * - * @note This allows an implicit conversion from a value from the - * ReturnCodes enumeration and a ReturnCode. This is provided so that - * a function can do "return FAPI_RC_SUCCESS;" - * - * @param[in] i_rcValue The rcValue to set - */ - ReturnCode(const ReturnCodes i_rcValue); - - /** - * @brief Copy Constructor - * - * @param[in] i_right Reference to ReturnCode to copy - */ - ReturnCode(const ReturnCode & i_right); - - /** - * @brief Destructor - */ - ~ReturnCode(); - - /** - * @brief Assignment Operator. - * - * @param[in] i_right Reference to ReturnCode to assign from. - * - * @return Reference to 'this' ReturnCode - */ - ReturnCode & operator=(const ReturnCode & i_right); - - /** - * @brief Returns if the return code indicates success - * - * @return bool. True if ok, else false - */ - bool ok() const { return (iv_rcValue == FAPI_RC_SUCCESS); } - - /** - * @brief uint32_t conversion function. Returns the rcValue - * - * @note This allows a user to directly compare: - * 1/ ReturnCode to uint32_t (ReturnCode converted to uint32_t) - * 2/ ReturnCode to ReturnCode (Both ReturnCode converted to uint32_t) - * This allows a user to test if a ReturnCode is bad (if (l_rc){}) - */ - operator uint32_t() const { return iv_rcValue; } - - /** - * @brief Sets a FAPI error. Sets the rcValue to the supplied value (from - * the ReturnCodes enumeration) and deletes any associated data. - * - * This is called by FAPI code to generate an error. - * - * @param[in] i_rcValue Error value to set - */ - void setFapiError(const ReturnCodes i_rcValue); - - /** - * @brief Sets an ecmd error. Sets the rcValue to the supplied value and - * deletes any associated data. - * - * This is called by FAPI/PLAT/HWP code to generate an error when an - * ecmdDataBufferBase call returns non zero. This can also be used by PLAT - * code that reports errors with ecmd return codes. - * - * @param[in] i_rcValue ecmdDataBufferBase error value to set - */ - void setEcmdError(const uint32_t i_rcValue); - - /** - * @brief Sets a PLAT error. Sets the rcValue to the supplied value, deletes - * any associated data and associates the supplied heap based - * PlatData with the ReturnCode. The ReturnCode object takes - * responsibility for deleting the data (platform code implements the - * delete function and must know the type and how to delete it). - * - * This is called by PLAT code to generate an error. The expected use-case - * is to associate a platform error log with the ReturnCode. If the error is - * one that a HWP can look for (e.g. the HWP may want to retry in a specific - * error) then one of the specific FAPI_RC_PLAT errors in fapiReturnCodes.H - * can be used else it defaults to FAPI_RC_PLAT_ERR_SEE_DATA which means - * that there is a platform error that the HWP cannot decode. - * - * @param[in] i_pData Pointer to PlatData (on the heap). Can be NULL if - * the platform does not attach data - * @param[in] i_rcValue Error value to set - */ - void setPlatError(void * i_pData, - const ReturnCodes i_rcValue = FAPI_RC_PLAT_ERR_SEE_DATA); - - /** - * @brief Sets a HWP error. Sets the rcValue to the supplied value (from - * the HwpReturnCode enumeration) and deletes any associated data. - * - * HWP code must call the FAPI_SET_HWP_ERROR macro rather than this function - * directly to generate an error so that any error information is - * automatically added to the ReturnCode - * - * @param[in] i_rcValue Error value to set - */ - void _setHwpError(const HwpReturnCode i_rcValue); - - /** - * @brief Get a pointer to any PlatData. ReturnCode is still responsible for - * deletion of the data. The caller must not delete - * - * This is called by PLAT. The expected use-case is to get a pointer to a - * platform error log. The data pointer should be used immediately in the - * same thread. - * - * @return void *. Pointer to any PlatData. If NULL then no data - */ - void * getPlatData() const; - - /** - * @brief Get a pointer to any PlatData and release ownership from - * ReturnCode. The caller is responsible for deletion. - * - * This is called by PLAT. The expected use-case is to retrieve a platform - * error log. - * - * @return void *. Pointer to any PlatData. If NULL then no data - */ - void * releasePlatData(); - - /** - * @brief Enumeration of ErrorInfo types - */ - enum ErrorInfoType - { - EI_TYPE_FFDC = 1, - EI_TYPE_HW_CALLOUT = 2, - EI_TYPE_PROCEDURE_CALLOUT = 3, - EI_TYPE_BUS_CALLOUT = 4, - EI_TYPE_CDG = 5, // Target Callout/Deconfig/GARD - EI_TYPE_CHILDREN_CDG = 6, // Children Callout/Deconfig/GARD - EI_TYPE_COLLECT_TRACE = 7, - }; - - /** - * @brief Structure representing a single ErrorInfo entry. - * - * An array of these is passed to the addErrorInfo function when a HWP - * generates an error by calling the FAPI_SET_HWP_ERROR macro - */ - struct ErrorInfoEntryFfdc - { - uint8_t iv_ffdcObjIndex; - uint16_t iv_ffdcSize; - uint32_t iv_ffdcId; - }; - - struct ErrorInfoEntryHwCallout - { - uint8_t iv_hw; - uint8_t iv_calloutPriority; - uint8_t iv_refObjIndex; - //For a HW callout (clock) the position of the clock - uint8_t iv_objPosIndex; - }; - - struct ErrorInfoEntryProcCallout - { - uint8_t iv_procedure; - uint8_t iv_calloutPriority; - }; - - struct ErrorInfoEntryBusCallout - { - uint8_t iv_endpoint1ObjIndex; - uint8_t iv_endpoint2ObjIndex; - uint8_t iv_calloutPriority; - }; - - struct ErrorInfoEntryTargetCDG - { - uint8_t iv_targetObjIndex; - uint8_t iv_callout; - uint8_t iv_deconfigure; - uint8_t iv_gard; - uint8_t iv_calloutPriority; - }; - - struct ErrorInfoEntryChildrenCDG - { - uint8_t iv_parentObjIndex; - uint8_t iv_callout; - uint8_t iv_deconfigure; - uint32_t iv_childType; - uint8_t iv_childPort; - uint8_t iv_childNumber; - uint8_t iv_gard; - uint8_t iv_calloutPriority; - }; - - struct ErrorInfoEntryCollectTrace - { - uint32_t iv_eieTraceId; - }; - - struct ErrorInfoEntry - { - uint8_t iv_type; // Value from ErrorInfoType - union - { - ErrorInfoEntryFfdc ffdc; - ErrorInfoEntryHwCallout hw_callout; - ErrorInfoEntryProcCallout proc_callout; - ErrorInfoEntryBusCallout bus_callout; - ErrorInfoEntryTargetCDG target_cdg; - ErrorInfoEntryChildrenCDG children_cdg; - ErrorInfoEntryCollectTrace collect_trace; - }; - }; - - /** - * @brief Add ErrorInfo - * - * This is called by the FAPI_SET_HWP_ERROR and macro to add ErrorInfo to the - * ReturnCode when a HWP generates an error. The function is designed to add - * all the ErrorInfo at once rather than the FAPI_SET_HWP_ERROR macro making - * multiple function calls to add each piece of ErrorInfo individually in - * order to minimize code size - * - * @param[in] i_pObjects Pointer to array of const pointers to const objects - * that are referred to by ErrorInfoEntry objects - * @param[in] i_pEntries Pointer to array of ErrorInfoEntry objects defining - * the ErrorInfo that needs to be added - * @param[in] i_count Number of ErrorInfoEntry entries - */ - void addErrorInfo(const void * const * i_pObjects, - const ErrorInfoEntry * i_pEntries, - const uint8_t i_count); - - /** - * @brief Add a copy of FFDC to the ErrorInfo - * - * This is called by addErrorInfo - * - * @param[in] i_ffdcId FFDC Identifier - used for decoding - * @param[in] i_pFfdc Pointer to the FFDC to copy - * @param[in] i_size Size of the FFDC to copy - */ - void addEIFfdc(const uint32_t i_ffdcId, - const void * i_pFfdc, - const uint32_t i_size); - - /** - * @brief Get a pointer to any ErrorInfo - * - * This is called by PLAT to find information about an error - * - * @return ErrorInfo *. Pointer to any ErrorInfo. If NULL then no info - */ - const ErrorInfo * getErrorInfo() const; - - /** - * @brief Enumeration of return code creators - */ - enum returnCodeCreator - { - CREATOR_FAPI = 1, - CREATOR_PLAT = 2, - CREATOR_HWP = 3, - }; - - /** - * @brief Gets the creator of the return code - * - * @return ReturnCodeCreator - */ - returnCodeCreator getCreator() const; - -private: - - /** - * @brief Get a reference to the ReturnCodeDataRef, if it doesn't exist - * then one is created and returned - * - * @return ReturnCodeDataRef &. Reference to ReturnCodeDataRef - */ - ReturnCodeDataRef & getCreateReturnCodeDataRef(); - - /** - * @brief Forgets about any associated data (PlatData and ErrorInfo) - * - * If this is the only ReturnCode pointing to the data then the data is - * deleted - */ - void forgetData(); - - /** - * @brief Add a HW callout to the ErrorInfo - * - * This is called by addErrorInfo - * - * @param[in] i_hw The hardware to callout - * @param[in] i_priority The priority of the callout - * @param[in] i_refTarget Reference to reference Target - * @param[in] i_position Incase of a clock callout; - * position of the clock target - */ - void addEIHwCallout( - const HwCallouts::HwCallout i_hw, - const CalloutPriorities::CalloutPriority i_priority, - const Target & i_refTarget, - const targetPos_t i_position = INVALID_CLOCK_POS); - - /** - * @brief Add a procedure callout to the ErrorInfo - * - * This is called by addErrorInfo - * - * @param[in] i_procedure The procedure to callout - * @param[in] i_priority The priority of the callout - */ - void addEIProcedureCallout( - const ProcedureCallouts::ProcedureCallout i_procedure, - const CalloutPriorities::CalloutPriority i_priority); - - /** - * @brief Add a bus callout to the ErrorInfo - * - * This is called by addErrorInfo - * - * @param[in] i_target1 Reference to endpoint1 Target - * @param[in] i_target2 Reference to endpoint2 Target - * @param[in] i_priority The priority of the callout - */ - void addEIBusCallout( - const Target & i_target1, - const Target & i_target2, - const CalloutPriorities::CalloutPriority i_priority); - - /** - * @brief Add a target callout/deconfigure/GARD to the ErrorInfo - * - * This is called by addErrorInfo - * - * @param[in] i_target Reference to the target to cdg - * @param[in] i_callout True if Target should be called out - * @param[in] i_deconfigure True if Target should be deconfigured - * @param[in] i_gard True if Target should be GARDed - * @param[in] i_priority The priority of any callout - */ - void addEICdg( - const Target & i_target, - const bool i_callout, - const bool i_deconfigure, - const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority); - - /** - * @brief Add children target callout/deconfigure/GARDs to the ErrorInfo - * - * This is called by addErrorInfo to c/d/g all child Targets of a specified - * type. The function can take a chip/unit pair or an MBA/DIMM pair. For - * the MBA/DIMM pair two additional parameters are used to identify which - * dimms should be called out. - * - * @param[in] i_parent Reference to the parent chip - * @param[in] i_childType Child target types to c/d/g - * @param[in] i_callout True if Target should be called out - * @param[in] i_deconfigure True if Target should be deconfigured - * @param[in] i_gard True if Target should be GARDed - * @param[in] i_priority The priority of any callout - * @param[in] i_childPort MBA port where error was detected - * @param[in] i_childNum MBA dimm number of failing chip - */ - void addEIChildrenCdg( - const Target & i_parent, - const TargetType i_childType, - const bool i_callout, - const bool i_deconfigure, - const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority, - const uint8_t i_childPort, const uint8_t i_childNum); - - /** - * @brief Add traces to collect to the ErrorInfo - * - * @param[in] i_trace - */ - void addEICollectTrace( - const CollectTraces::CollectTrace i_traceId); - - // The rcValue - uint32_t iv_rcValue; - - // Pointer to ReturnCodeDataRef (manages associated data) - ReturnCodeDataRef * iv_pDataRef; -}; - -/** - * @namespace ReturnCodeFfdc - * - * This namespace contains template functions used for adding FFDC data to a - * ReturnCode. They cannot be a ReturnCode member functions because a function - * template cannot be specialized within a class - */ -namespace ReturnCodeFfdc -{ - /** - * @brief Enumeration of ErrorInfo FFDC sizes that are used to indicate a - * special type that cannot simply be memcopied - */ - enum ErrorInfoFfdcSize - { - EI_FFDC_SIZE_ECMDDB = 0xffff, // ecmdDataBufferBase - EI_FFDC_SIZE_TARGET = 0xfffe, // fapi::Target - EI_FFDC_MAX_SIZE = 0x1000, // Limit regular FFDC capture to 4kb - }; - - /** - * @brief Compile error if caller tries to add too much FFDC to a ReturnCode - * - * If the unspecialized function template is instantiated, the compile will - * fail due to the construction of an undefined class. If the specialized - * function template is instantiated (done if the FFDC size is not too big), - * the function does nothing and is optimized out - */ - class Error_FfdcTooLargeToCapture; - template<const bool TOO_BIG> void checkFfdcSize() - { - Error_FfdcTooLargeToCapture(); - } - template <> inline void checkFfdcSize<false>() {} - - /** - * @brief Get FFDC Size - * - * This is called by the FAPI_SET_HWP_ERROR macro to find out the size of - * FFDC data. If the data is of a special type that is handled differently - * than types that are simply memcopied then it is handled by a template - * specialization - * - * @return uint16_t. Size of the FFDC data - */ - template<typename T> - inline uint16_t getErrorInfoFfdcSize(const T &) - { - checkFfdcSize<(sizeof(T) > EI_FFDC_MAX_SIZE)>(); - return sizeof(T); - } - - /** - * @brief Get FFDC Size specialization for ecmdDataBufferBase - */ - template<> - inline uint16_t getErrorInfoFfdcSize<ecmdDataBufferBase>( - const ecmdDataBufferBase &) - { - return EI_FFDC_SIZE_ECMDDB; - } - - /** - * @brief Get FFDC Size specialization for fapi::Target - */ - template<> - inline uint16_t getErrorInfoFfdcSize<fapi::Target>( - const fapi::Target &) - { - return EI_FFDC_SIZE_TARGET; - } - - /** - * @brief Compile error if caller tries to get the FFDC size of a pointer - * - * If this function template is instantiated, the compile will fail due to - * the construction of an undefined class. - */ - class Error_PtrPassedToGetErrorInfoFfdcSize; - template<typename T> - inline int16_t getErrorInfoFfdcSize(const T *) - { - Error_PtrPassedToGetErrorInfoFfdcSize(); - return 0; - } -} - -} - -#endif // FAPIRETURNCODE_H_ diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H b/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H deleted file mode 100644 index 3f814c0a9..000000000 --- a/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H +++ /dev/null @@ -1,179 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiReturnCodeDataRef.H,v 1.7 2013/10/15 13:13:38 dcrowell Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiReturnCodeDataRef.H,v $ - -/** - * @file fapiReturnCodeDataRef.H - * - * @brief Defines the ReturnCodeDataRef class that manages the data associated - * with a ReturnCode - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. - * mjjones 07/05/2011. Removed const from data - * mjjones 07/25/2011 Added support for FFDC - * mjjones 09/22/2100 Added support for Error Info - */ - -#ifndef FAPIRETURNCODEDATAREF_H_ -#define FAPIRETURNCODEDATAREF_H_ - -#include <stdint.h> -#include <stddef.h> -#include <fapiErrorInfo.H> - -namespace fapi -{ - -/** - * @class ReturnCodeDataRef - * - * This class manages the data associated with a ReturnCode. A ReturnCode - * contains a pointer to a ReturnCodeDataRef. When a ReturnCode is copied or - * assigned, both ReturnCodes point to the same ReturnCodeDataRef (the data is - * not copied) and the ReturnCodeDataRef reference count is incremented. When a - * ReturnCode is destructed, the ReturnCodeDataRef reference count is - * decremented and if zero, the ReturnCodeDataRef is deleted which deletes the - * the data - * - * A ReturnCodeDataRef object is not thread safe, multiple threads must not use - * the same ReturnCodeDataRef object concurrently. - */ -class ReturnCodeDataRef -{ -public: - - /** - * @brief Constructor - */ - ReturnCodeDataRef(); - - /** - * @brief Destructor - */ - virtual ~ReturnCodeDataRef(); - - /** - * @brief Increments the ref count - */ - void incRefCount(); - - /** - * @brief Decrements the ref count - * - * @return bool True if zero reached - */ - bool decRefCountCheckZero(); - - /** - * @brief Associate heap based PlatData (use-case is platform error log) - * - * Any existing PlatData is deleted - * - * @param[in] i_pPlatData Pointer to PlatData to associate - */ - void setPlatData(void * i_pPlatData); - - /** - * @brief Get a pointer to any PlatData. ReturnCodeDataRef is still - * responsible for deletion of the data. The caller must not delete - * - * The pointer is only meaningful to platform code. - * - * @return void *. Pointer to PlatData. If NULL then no data - */ - void * getPlatData() const; - - /** - * @brief Get a pointer to any PlatData and release ownership from - * ReturnCodeDataRef. The caller is responsible for deletion. - * - * The pointer is only meaningful to platform code. - * - * @return void *. Pointer to PlatData. If NULL then no data - */ - void * releasePlatData(); - - /** - * @brief Get a pointer to any ErrorInfo - * - * @return ErrorInfo *. Pointer to ErrorInfo. If NULL then no info - */ - ErrorInfo * getErrorInfo(); - - /** - * @brief Get a reference to the ErrorInfo. If there is no info then - * it is created (empty) - * - * @return ErrorInfo &. Reference to ErrorInfo. - */ - ErrorInfo & getCreateErrorInfo(); - -#ifdef FAPI_CUSTOM_MALLOC - /** - * @brief Overload new operator to use platform-specific allocator - * - * @param[in] i_sz Size of memory to allocate in bytes - * - * @return Pointer to allocated memory - */ - static void * operator new(size_t i_sz); - - /** - * @brief Overload delete operator to use platform-specific deallocator - * - * @param[in] i_ptr Pointer to memory previously allocated with new - */ - static void operator delete(void * i_ptr); -#endif - -private: - - /** - * @brief Delete any associated PlatData. Implemented by platform code - * because only platform code knows the type of the data. - */ - void deletePlatData(); - - // Copy constructor and assignment operator disabled - ReturnCodeDataRef(const ReturnCodeDataRef & i_right); - ReturnCodeDataRef & operator=(const ReturnCodeDataRef & i_right); - - // The reference count (how many ReturnCodes are pointing to this object) - uint32_t iv_refCount; - - // Pointer to associated PlatData - void * iv_pPlatData; - - // Pointer to HWP Error Information - ErrorInfo * iv_pErrorInfo; -}; - -} - -#endif // FAPIRETURNCODEDATAREF_H_ diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodes.H b/src/include/usr/hwpf/fapi/fapiReturnCodes.H deleted file mode 100644 index 4b3107efc..000000000 --- a/src/include/usr/hwpf/fapi/fapiReturnCodes.H +++ /dev/null @@ -1,108 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiReturnCodes.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiReturnCodes.H,v 1.17 2014/04/15 17:50:40 whs Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiReturnCodes.H,v $ - -/** - * @file fapiReturnCodes.H - * - * @brief Defines the returns codes generated by HWPF code. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. - * mjjones 06/07/2011 Add FAPI_RC_NOT_IMPLEMENTED - * mjjones 06/30/2011 Add FAPI_RC_ATTR_UNIT_TEST_FAIL - * mjjones 08/10/2011 Add FAPI_RC_FFDC_HWP_NOT_FOUND - * mjjones 09/23/2011 Remove FAPI_RC_FFDC_HWP_NOT_FOUND - * mjjones 10/07/2011 Add FAPI_RC_INVALID_ATTR_GET - * mjjones 10/28/2011 Trim FAPI/PLAT errors - * mjjones 11/10/2011 Use ecmdDataBufferBase - * mjjones 01/13/2012 Name enumeration - * mjjones 04/16/2012 Add FAPI_RC_INVALID_CHIP_EC_FEATURE_GET - * mjjones 05/02/2012 Add FAPI_RC_PLAT_ERR_ADU_LOCKED - * mjjones 11/14/2012 Add FAPI_RC_UNRECOGNIZED_SBE_ERROR - * mjjones 03/26/2014 Remove FAPI_RC_UNRECOGNIZED_SBE_ERROR - * whs 04/14/2014 Remove FAPI_RC_INVALID_PARAM - */ - -#ifndef FAPIRETURNCODES_H_ -#define FAPIRETURNCODES_H_ - -#include <ecmdDataBufferBase.H> - -namespace fapi -{ - -/** - * @brief Enumeration of return codes - * - * @note HWP return codes are in the HwpReturnCode enumeration in the - * generated fapiHwpReturnCodes.H file - */ -enum ReturnCodes -{ - FAPI_RC_SUCCESS = 0, - - //-------------------------------------------------------------------------- - // Flag bits indicating which code generated the error If no flag set then - // it is generated by HWP - //-------------------------------------------------------------------------- - FAPI_RC_FAPI_MASK = 0x04000000, // FAPI generated error - FAPI_RC_PLAT_MASK = 0x02000000, // PLAT generated error - FAPI_RC_ECMD_MASK = ECMD_ERR_ECMD, // ECMD generated error (0x01000000) - - //-------------------------------------------------------------------------- - // FAPI generated return codes - //-------------------------------------------------------------------------- - - // Initfile requested an attribute with an invalid attribute ID - FAPI_RC_INVALID_ATTR_GET = FAPI_RC_FAPI_MASK | 0x01, - - // HWP requested a chip EC feature with an invalid attribute ID - FAPI_RC_INVALID_CHIP_EC_FEATURE_GET = FAPI_RC_FAPI_MASK | 0x02, - - // Invalid multiscom parameters - FAPI_RC_INVALID_MULTISCOM_LENGTH = FAPI_RC_FAPI_MASK | 0x03, - - //-------------------------------------------------------------------------- - // PLAT generated return codes. Additional details may be contained in - // ReturnCode platData (this can only be looked at by PLAT code) - //-------------------------------------------------------------------------- - - // Generic platform error - FAPI_RC_PLAT_ERR_SEE_DATA = FAPI_RC_PLAT_MASK | 0x01, - - // Operation to AlterDisplay unit failed because it is locked - FAPI_RC_PLAT_ERR_ADU_LOCKED = FAPI_RC_PLAT_MASK | 0x02, - - // Operation not supported by HB runtime - FAPI_RC_PLAT_NOT_SUPPORTED_AT_RUNTIME = FAPI_RC_PLAT_MASK | 0x03, -}; - -} - -#endif // FAPIRETURNCODES_H_ diff --git a/src/include/usr/hwpf/fapi/fapiSystemConfig.H b/src/include/usr/hwpf/fapi/fapiSystemConfig.H deleted file mode 100644 index cc9d01621..000000000 --- a/src/include/usr/hwpf/fapi/fapiSystemConfig.H +++ /dev/null @@ -1,121 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiSystemConfig.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiSystemConfig.H,v 1.6 2013/10/15 13:13:41 dcrowell Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiSystemConfig.H,v $ - -/** - * @file fapiSystemConfig.H - * - * @brief Defines the System Config query functions that platform code must - * implement. It is an eCMD requirement that these be "C" functions. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 09/12/2011 Updated with new functions. - * mjjones 02/17/2012 Updated fapiGetAssociatedDimms - * description to only allow MBA - * - */ - -#ifndef FAPISYSTEMCONFIG_H_ -#define FAPISYSTEMCONFIG_H_ - -#include <stdint.h> -#include <vector> -#include <fapiReturnCode.H> -#include <fapiTarget.H> - -extern "C" -{ - -/** -* @brief Gets the Target on the other side of the memory channel -* - Input MEMBUF_CHIP, Output MCS_CHIPLET -* - Input MCS_CHIPLET, Output MEMBUF_CHIP -* -* @param[in] i_target Input MCS_CHIPLET or MEMBUF_CHIP Target -* @param[out] o_target Reference to Target that is set to the Target on -* the other side of the memory channel, if there is no such -* Target in the specified state then an error is returned -* @param[in] i_state Only return a target in the specified state. Either -* present or functional (default) -* -* @return ReturnCode. Zero on success, else error -*/ -fapi::ReturnCode fapiGetOtherSideOfMemChannel( - const fapi::Target& i_target, - fapi::Target & o_target, - const fapi::TargetState i_state = fapi::TARGET_STATE_FUNCTIONAL); - -/** - * @brief Gets the chiplets that are children of the input chip - * - * @param[in] i_chip Input chip - * @param[in] i_chipletType Type of chiplet required - * @param[out] o_chiplets Reference to vector that is cleared then filled in - * with the children chiplet Targets - * @param[in] i_state Only return targets of the specified state. Either - * present or functional (default) - * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode fapiGetChildChiplets( - const fapi::Target & i_chip, - const fapi::TargetType i_chipletType, - std::vector<fapi::Target> & o_chiplets, - const fapi::TargetState i_state = fapi::TARGET_STATE_FUNCTIONAL); - -/** - * @brief Gets the DIMMs that are logically associated with the input MBA target - * - * @param[in] i_target Input MBA chiplet target - * @param[out] o_dimms Reference to vector that is cleared then filled in with - * the associated DIMM Targets - * @param[in] i_state Only return targets of the specified state. Either - * present or functional (default) - * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode fapiGetAssociatedDimms( - const fapi::Target& i_target, - std::vector<fapi::Target> & o_dimms, - const fapi::TargetState i_state = fapi::TARGET_STATE_FUNCTIONAL); - -/** - * @brief Gets the parent chip of the input chiplet - * - * @param[in] i_chiplet Input chiplet - * @param[out] o_chip Reference to Target that is set to the parent chip - * - * @return ReturnCode. Zero on success, else error - */ -fapi::ReturnCode fapiGetParentChip( - const fapi::Target& i_chiplet, - fapi::Target & o_chip); - -} // extern "C" - -#endif // FAPISYSTEMCONFIG_H_ diff --git a/src/include/usr/hwpf/fapi/fapiTarget.H b/src/include/usr/hwpf/fapi/fapiTarget.H deleted file mode 100644 index 4cb126381..000000000 --- a/src/include/usr/hwpf/fapi/fapiTarget.H +++ /dev/null @@ -1,326 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiTarget.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiTarget.H,v 1.9 2014/02/26 14:51:05 mjjones Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiTarget.H,v $ - -/** - * @file fapiTarget.H - * - * @brief Defines the Target class that is a generic target of a Hardware - * Procedure operation. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. Based on Hlava prototype - * mjjones 06/29/2011 Removed incorrect MSB from 2 enums - * mjjones 07/05/2011 Removed const from handle - * mjjones 08/29/2011 Updated toString function - * mjjones 09/12/2011 Added isChip and isChiplet - * mjjones 02/07/2012 Remove MBS_CHIPLET - * Add XBUS_ENDPOINT ABUS_ENDPOINT - * mjjones 02/21/2012 Add high performance toEcmdString - * mjjones 02/24/2014 Add isChip/Chiplet using types - * Add isPhysParentChild - */ - -#ifndef FAPITARGET_H_ -#define FAPITARGET_H_ - -#include <stdint.h> -#include <stddef.h> - -namespace fapi -{ - -/** - * @brief Enumeration of target types values (bitmask values) - */ -enum TargetType -{ - TARGET_TYPE_NONE = 0x00000000, - TARGET_TYPE_SYSTEM = 0x00000001, - TARGET_TYPE_DIMM = 0x00000002, - TARGET_TYPE_PROC_CHIP = 0x00000004, - TARGET_TYPE_MEMBUF_CHIP = 0x00000008, - TARGET_TYPE_EX_CHIPLET = 0x00000010, - TARGET_TYPE_MBA_CHIPLET = 0x00000020, - TARGET_TYPE_MCS_CHIPLET = 0x00000040, - TARGET_TYPE_XBUS_ENDPOINT = 0x00000080, - TARGET_TYPE_ABUS_ENDPOINT = 0x00000100, - TARGET_TYPE_L4 = 0x00000200, -}; - -/** - * @brief Typedef used when passing multiple TargetType values - */ -typedef uint32_t TargetTypes_t; - -/** - * @brief Enumeration of target state values (bitmask values) - */ -enum TargetState -{ - TARGET_STATE_PRESENT = 0x00000001, - TARGET_STATE_FUNCTIONAL = 0x00000002, -}; - -/** - * @brief Typedef used when passing multiple TargetState values - */ -typedef uint32_t TargetStates_t; - -/** - * @brief ECMD constants - */ -const uint32_t MAX_ECMD_STRING_LEN = 64; - -/** - * @class Target - * - * This class provides a generic Target of a Hardware Procedure Operation. - * - * A Target contains a void * pointer to a handle which is only meaningful to - * platform code. - * - * A Target object is copyable and assignable. Therefore, it cannot be - * subclassed. - * - * A Target object is not thread safe, multiple threads must not use the same - * Target object concurrently. - */ -class Target -{ -public: - - /** - * @brief Default constructor - */ - Target(); - - /** - * @brief Constructor - * - * @param[in] i_type Target type - * @param[in] i_pHandle Pointer to platform specific Target handle - */ - Target(const TargetType i_type, - void * i_pHandle); - - /** - * @brief Copy Constructor - * - * @param[in] i_right Reference to Target to copy - */ - Target(const Target & i_right); - - /** - * @brief Destructor - */ - ~Target(); - - /** - * @brief Assignment Operator. - * - * @param[in] i_right Reference to Target to assign from. - * - * @return Reference to 'this' Target - */ - Target & operator=(const Target & i_right); - - /** - * @brief Equality Comparison Operator - * - * @param[in] i_right Reference to Target to compare. - * - * @return bool. True if equal. - */ - bool operator==(const Target & i_right) const; - - /** - * @brief Inequality Comparison Operator - * - * @param[in] i_right Reference to Target to compare. - * - * @return bool. True if not equal. - */ - bool operator!=(const Target & i_right) const; - - /** - * @brief Get the handle pointer. - * - * The handle is only meaningful to platform code. - * - * @return Handle_t. The handle. - */ - void * get() const { return iv_pHandle; } - - /** - * @brief Set the handle. Platform using Handle_t as handle - * - * The handle is only meaningful to platform code. - * - * @param[in] i_pHandle Pointer to platform specific handle - */ - void set(void * i_pHandle); - - /** - * @brief Get the target type - * - * @return The type of target represented by this target - */ - TargetType getType() const { return iv_type; } - - /** - * @brief Set the target type - * - * @param[in] i_type The type of target represented by this target - */ - void setType(const TargetType i_type) { iv_type = i_type; } - - /** - * @brief Returns if a target type is a chip - * - * @param[in] i_type Target Type - * - * @return boolean. true if chip else false - */ - static bool isChip(const TargetType i_type); - - /** - * @brief Returns if the target is a chip - * - * @return boolean. true if chip else false - */ - bool isChip() const - { - return isChip(iv_type); - } - - /** - * @brief Returns if a target type is a chiplet - * - * @param[in] i_type Target Type - * - * @return boolean. true if chip else false - */ - static bool isChiplet(const TargetType i_type); - - /** - * @brief Returns if the target is a chiplet - * - * This includes all chip units (e.g. XBUS, ABUS) - * - * @return boolean. true if chiplet else false - */ - bool isChiplet() const - { - return isChiplet(iv_type); - } - - /** - * @brief Returns if a pair of target types is a physical parent/child - * - * This is true if the parent type is a chip and the child type is a - * chiplet that belongs to the chip (e.g. PROC_CHIP->EX_CHIPLET) - * - * @param[in] i_parentType Parent Target Type - * @param[in] i_childType Child Target Type - * - * @return boolean. - */ - static bool isPhysParentChild(const TargetType i_parentType, - const TargetType i_childType); - - /** - * @brief Convert a target to an ecmd-format target string - * - * This is used by HWP/FAPI code to trace the target. - * - * @return Pointer to NULL terminated character string. The caller must use - * the string before the Target object is destructed. - */ - const char * toEcmdString() const; - -private: - - /** - * @brief Convert a target to an ecmd-format target string - * - * This is a private function called by toEcmdString to load the ecmd-format - * string into the Target object. Subsequent calls of toEcmdString are high - * performance and just return a pointer to the internal string. - * - * @note Implemented by platform code - * - * @param[out] o_ecmdString. Reference to a character array of length - * MAX_ECMD_STRING_LEN. This is filled in with the - * null terminated ECMD string. - */ - void toString(char (&o_ecmdString)[MAX_ECMD_STRING_LEN]) const; - - /** - * @brief Compare the handle - * - * @note Implemented by platform code because only platform code knows the - * type pointed to by iv_pHandle to compare - * - * @param[in] i_right Reference to Target to compare handle to - * - * @return bool. True if the same - */ - bool compareHandle(const Target & i_right) const; - - /** - * @brief Copy the handle - * - * @note Implemented by platform code because only platform code knows the - * type pointed to by iv_pHandle to copy - * - * @param[in] i_right Reference to Target to copy handle from - */ - void copyHandle(const Target & i_right); - - /** - * @brief Delete the handle - * - * @note Implemented by platform code because only platform code knows the - * type to delete and if it should actually be deleted - */ - void deleteHandle(); - - // Type of target - TargetType iv_type; - - // Pointer to platform specific Target Handle - void * iv_pHandle; - - // Pointer to the ecmd-format string representing the Target - mutable char * iv_pEcmdString; -}; - -} - -#endif // FAPITARGET_H_ diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H deleted file mode 100644 index 470d78fec..000000000 --- a/src/include/usr/hwpf/fapi/fapiUtil.H +++ /dev/null @@ -1,293 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/include/usr/hwpf/fapi/fapiUtil.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2014 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: fapiUtil.H,v 1.21 2014/09/16 14:47:23 pragupta Exp $ -// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiUtil.H,v $ - -/** - * @file fapiUtil.H - * - * @brief Defines utility functions that the platform code must implement. - */ - -/* - * Change Log ****************************************************************** - * Flag Defect/Feature User Date Description - * ------ -------------- ---------- ----------- ---------------------------- - * mjjones 04/13/2011 Created. - * camvanng 05/31/2011 Removed fapiOutputx macros - * mjjones 06/30/2011 Removed #include - * mjjones 07/05/2011 Removed rogue tab - * camvanng 09/06/2011 Added fapiLogError - * mjjones 09/14/2011 Prepended fapi to delay - * mjjones 10/05/2011 Added fapiCheckType - * mjjones 10/13/2011 Added extern "C" to functions - * camvanng 10/14/2011 Added fapiLoadInitFile & - * fapiUnloadInitFile - * camvanng 11/15/2011 Pass target to fapiLoadInitFile - * and doxygen changes; - * needed by cronus - * mjjones 08/13/2012 Add fapiSpecialWakeup - * mjjones 09/24/2013 Update fapiLogError to - * accept another parameter - * dcrowell 10/14/2013 Add explicit inline - * pragupta 09/16/2014 Add fapi gen hash function - */ - -#ifndef FAPIUTIL_H_ -#define FAPIUTIL_H_ - -#include <stdint.h> -#include <stddef.h> -#include <fapiReturnCode.H> - -namespace fapi -{ - namespace hash - { - enum validHashes { CRC32 }; - } -}; - -#include <fapiPlatUtil.H> - -// Defines for endian convertion -#define FAPI_BE16TOH(x) FAPI_PLAT_BE16TOH(x) -#define FAPI_LE16TOH(x) FAPI_PLAT_LE16TOH(x) -#define FAPI_HTOBE16(x) FAPI_PLAT_HTOBE16(x) -#define FAPI_HTOLE16(x) FAPI_PLAT_HTOLE16(x) - -#define FAPI_BE32TOH(x) FAPI_PLAT_BE32TOH(x) -#define FAPI_LE32TOH(x) FAPI_PLAT_LE32TOH(x) -#define FAPI_HTOBE32(x) FAPI_PLAT_HTOBE32(x) -#define FAPI_HTOLE32(x) FAPI_PLAT_HTOLE32(x) - -#define FAPI_BE64TOH(x) FAPI_PLAT_BE64TOH(x) -#define FAPI_LE64TOH(x) FAPI_PLAT_LE64TOH(x) -#define FAPI_HTOBE64(x) FAPI_PLAT_HTOBE64(x) -#define FAPI_HTOLE64(x) FAPI_PLAT_HTOLE64(x) - -// Defines for platform-specific memory allocation -#define fapiMalloc(s) fapiPlatMalloc(s) -#define fapiFree(p) fapiPlatFree(p) - -#define FAPI_GEN_HASH(type, data, size) FAPI_PLAT_GEN_HASH(type,data,size) -// It is an eCMD requirement that these functions have a "C" symbol -// because they may be used from a dynamically linked shared library -extern "C" -{ - -/** - * @brief Assert that an expression is true. Aborting the process if false. - * - * @note Implemented by platform code - * - * @param[in] i_expression If not true then process should be aborted - */ -void fapiAssert(bool i_expression); - -/** - * @brief Delay this thread. Hostboot will use the nanoseconds parameter - * and make a syscall to nanosleep. While in the syscall, the hostboot - * kernel will continue to consume CPU cycles as it looks for a runnable - * task. When the delay time expires, the task becomes runnable and will soon - * return from the syscall. Callers of delay() in the hostboot environment - * will likely have to know the mHz clock speed they are running on and - * compute a non-zero value for i_nanoSeconds. - * - * On the FSP, it was sometimes acceptable to just provide zero for the - * sleep delay time, causing the task to yield its time slice. By the - * time the calling task could run again, it was pretty certain enough - * host cycles had past. This is probably not acceptable in - * the hostboot environment. Callers should calculate and provide a - * sleep value in nanoseconds relative to host clock speed. - * - * On FSP when VBU is the target, then the i_simCycles parameter will be - * used instead. The FSP needs to use the simdispatcher client/server - * API and issue a command to the awan to advance the simulation the - * specified number of cycles. - * - * @param[in] i_nanoSeconds nanoseconds to sleep - * @param[in] i_simCycles count of Awan cycles to advance - * - * @return ReturnCode. Zero on success, else platform specified error. - */ -fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles); - -namespace fapi -{ -/** - * @brief Enumeration of error log severity. - */ -enum fapiErrlSeverity_t -{ - FAPI_ERRL_SEV_RECOVERED = 0x10, //Not seen by customer - FAPI_ERRL_SEV_PREDICTIVE = 0x20, //Error recovered but customer will see - FAPI_ERRL_SEV_UNRECOVERABLE = 0x40 //Unrecoverable, general -}; - -} - -/** - * @brief Log an error. - * - * This function can be called by HWP to log an error. - * - * @note Implemented by platform code - * - * @param[in,out] io_rc Reference to ReturnCode (Any references to data and error - * target are removed and rc value is set to success after - * function ends.) - * @param[in] i_sev Fapi error log severity defaulted to unrecoverable - * @param[in] i_unitTestError - flag to log error which does not cause a unit - * test to fail. - * - * Example usage: <br> - * fapi::ReturnCode l_rc; <br> - * fapi::fapiErrlSeverity_t l_sev = fapi::FAPI_ERRL_SEV_UNRECOVERABLE;<br> - * FAPI_EXEC_HWP(l_rc, function1, i_target); <br> - * if (!l_rc) <br> - * { <br> - * fapiLogError(l_rc, l_sev); <br> - * } <br> - * - * FAPI_EXEC_HWP(l_rc, function2, i_target) <br> - * return rc; <br> - */ -void fapiLogError(fapi::ReturnCode & io_rc, - fapi::fapiErrlSeverity_t i_sev = - fapi::FAPI_ERRL_SEV_UNRECOVERABLE, - bool i_unitTestError=false); - -/** @brief This function answers the question, is scand tracing turned on? - * The implementation of this function is specific to the platform. - * - * @returns Boolean indication - */ -bool platIsScanTraceEnabled(); - -/** @brief Alter the state of scand tracing. - * The implementation of this function is specific to the platform. - * - * @param[in] i_enable True to enable or false to disable scan trace. - * @return void - */ -void platSetScanTrace(bool i_enable); - -/** @brief Load the initfile - * - * This function can be called by a HWP to load an initfile. - * - * @note Implemented by platform code. Platform code is - * responsible for allocating any memory needed to load - * the initfile. - * - * @param[in] i_Target reference to the target - * @param[in] i_file the .if filename: \<initfile\>.if - * @param[out] o_addr address in memory where initfile is loaded - * @param[out] o_size size of memory allocated for initfile - * - * @return ReturnCode. Zero on success, else platform specified error. - */ -fapi::ReturnCode fapiLoadInitFile(const fapi::Target & i_Target, - const char * i_file, const char *& o_addr, size_t & o_size); - -/** @brief Unload the initfile - * - * This function can be called by a HWP to unload an initfile. - * - * @note Implemented by platform code. Platform code is - * responsible for deleting any allocated memory. - * - * @param[in] i_file the .if filename: \<initfile\>.if - * @param[in,out] io_addr address in memory where initfile is loaded - * set to NULL on exit - * @param[in,out] io_size size of memory allocated for initfile - * set to 0 on exit - * - * @return ReturnCode. Zero on success, else platform specified error. - */ -fapi::ReturnCode fapiUnloadInitFile(const char * i_file, const char *& io_addr, - size_t & io_size); - -/** @brief Set a break point in the current procedure - * - * This function will suspend the calling istep/procedure. - * The procedure can be signaled to resume via a cmd through the - * istep dispatcher. - * @param[in] i_info Tag to send when at breakpoint - */ - -void fapiBreakPoint(uint32_t i_info); - -/** - * @brief Enable/Disable special wakeup on processor chip core(s) - * - * Special Wakeup Enable must be done when a HWP is doing an operation that - * requires core(s) to be awake (e.g. modifying the Sleep-Winkle image). For - * each Special Wakeup Enable call, there must be a subsequent Special Wakeup - * Disable call. - * - * This does not apply to SCOM operations, platforms must handle Special Wakeup - * for SCOM operations internally. - * - * If Special Wakeup is enabled, a core will not go to sleep (if already - * sleeping, it is woken up). If Special Wakeup is disabled, if there are no - * other active Enables, the core is allowed to sleep. - * - * @note Implemented by platform code calling the proc_cpu_special_wakeup HWP. - * This is a FAPI function because each platform may do different things - * Hostboot: Does nothing (cores cannot sleep while Hostboot running) - * FSP: Uses an algorithm to decide when to disable special wakeup - * Cronus: Does Special Wakeup enable/disable as requested - * - * @param[in] i_target - * TARGET_TYPE_PROC_CHIP: Enables/Disables Special Wakeup on all - * cores (EX chiplets) of the specified chip - * TARGET_TYPE_EX_CHIPLET: Enables/Disables Special Wakeup on the - * specified core (EX chiplet) - * @param[in] i_enable true = enable. false = disable. - * - * @return ReturnCode. Zero on success, else platform specified error. - */ -fapi::ReturnCode fapiSpecialWakeup(const fapi::Target & i_target, - const bool i_enable); - -} - -namespace fapi -{ - -/** - * @brief Check the type of a variable - * - * This function can be called to check that a variable type is as expected - */ -template<typename T> -inline -void fapiCheckType(const T &) {} - -} - -#endif // FAPIUTIL_H_ |

