From 1bfd1c30b8c3ddd6db9491a638d4d9e55d72c1fb Mon Sep 17 00:00:00 2001 From: Santosh Puranik Date: Wed, 4 Nov 2015 06:16:22 -0600 Subject: FAPI cleanup in PPE 1) Removed importtemp/fapi2 2) Removed old files from import/ 3) Synced over parseErrorInfo.pl from ekb Change-Id: Ic830b9dd86b612f7892a40fb2d3158a73940d7af Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21760 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta Reviewed-by: Martin Peschke --- import/hwpf/fapi2/include/collect_reg_ffdc.H | 78 ---- import/hwpf/fapi2/include/hw_access.H | 582 --------------------------- import/hwpf/fapi2/include/plat_error_scope.H | 64 --- import/hwpf/fapi2/include/plat_hw_access.H | 39 -- import/hwpf/fapi2/include/plat_target.H | 43 -- import/hwpf/fapi2/include/plat_trace.H | 70 ---- import/hwpf/fapi2/include/target.H | 171 -------- 7 files changed, 1047 deletions(-) delete mode 100644 import/hwpf/fapi2/include/collect_reg_ffdc.H delete mode 100644 import/hwpf/fapi2/include/hw_access.H delete mode 100644 import/hwpf/fapi2/include/plat_error_scope.H delete mode 100644 import/hwpf/fapi2/include/plat_hw_access.H delete mode 100644 import/hwpf/fapi2/include/plat_target.H delete mode 100644 import/hwpf/fapi2/include/plat_trace.H delete mode 100644 import/hwpf/fapi2/include/target.H (limited to 'import/hwpf/fapi2') diff --git a/import/hwpf/fapi2/include/collect_reg_ffdc.H b/import/hwpf/fapi2/include/collect_reg_ffdc.H deleted file mode 100644 index 764bb3c8..00000000 --- a/import/hwpf/fapi2/include/collect_reg_ffdc.H +++ /dev/null @@ -1,78 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* 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 */ -/** - * @file collect_reg_ffdc.H - * - * @brief Defines the collectRegFfdc 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 - * element. This function should not be called - * directly by any user code. The function implementation is - * automatically generated from FAPI Error XML files. - */ - -#ifndef FAPI2_COLLECT_REG_FFDC_H_ -#define FAPI2_COLLECT_REG_FFDC_H_ - -#include -#include -#include -#include - -namespace fapi2 -{ - - /// - /// @brief Collects Register FFDC from a chip or chiplet - /// - /// @warning This should only be called by FAPI during FAPI_SET_HWP_ERROR or - /// FAPI_ADD_INFO_TO_HWP_ERROR - /// - /// @param[in] i_target Pointer to Target to collect FFDC from (ffdc_t.ptr()) - /// @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 collectRegFfdc(const fapi2::ffdc_t& i_target, - const fapi2::HwpFfdcId i_ffdcId, - fapi2::ReturnCode & o_rc, - const TargetType i_child = TARGET_TYPE_NONE, - const TargetType i_presChild = TARGET_TYPE_NONE, - uint32_t i_childOffsetMult = 0); -} - -#endif diff --git a/import/hwpf/fapi2/include/hw_access.H b/import/hwpf/fapi2/include/hw_access.H deleted file mode 100644 index d1c2ad28..00000000 --- a/import/hwpf/fapi2/include/hw_access.H +++ /dev/null @@ -1,582 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,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 */ - -/// @file hw_access.H -/// -/// @brief Hardware access functions that needs to be specialized for -/// platform implementation. -/// - -#ifndef _FAPI2_HWACCESS_H_ -#define _FAPI2_HWACCESS_H_ - - // variable_buffer isn't supported on PPE -#ifndef __PPE__ -#include -#endif - -#include -#include - -namespace fapi2 -{ - //-------------------------------------------------------------------------- - // PIB Error Functions - //-------------------------------------------------------------------------- - - /// @brief Sets the PIB error mask - platform dependant - /// @param[in] i_mask The new error mask - // note: this can be moved to a C file if desired - inline void setPIBErrorMask(uint8_t i_mask) - { - // Keeps the compiler from complaining about the unused i_mask - static_cast(i_mask); - - return; - } - - /// @brief Gets the PIB error mask - platform dependant - /// @return uint8_t The current PIB error mask - // note: this can be moved to a C file if desired - inline uint8_t getPIBErrorMask(void) - { - return 0; - } - - //-------------------------------------------------------------------------- - // Operational Mode Error Functions - //-------------------------------------------------------------------------- - - /// @brief Sets the operational mode - /// @param[in] i_mode The new mode - // note: this can be moved to a C file if desired - inline void setOpMode(const OpModes i_mode) - { - // Keeps the compiler from complaining about the unused i_mode - static_cast(i_mode); - - // No-op for now. Should set thread-local operational mode - return; - } - - /// @brief Gets the operational mode - /// @return the operational mode - // note: this can be moved to a C file if desired - inline OpModes getOpMode(void) - { - // No-op for now. Should read thread-local operational mode - return NORMAL; - } - - //------------------------------------------------------------------------------ - // HW Communication Functions to be implemented at the platform layer. - //------------------------------------------------------------------------------ - - /// - /// @brief Platform-level implementation of getScom() - /// @Tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address SCOM register address to read from. - /// @param[out] o_date Buffer that holds data read from HW target. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - template< TargetType K > - inline ReturnCode getScom(const Target& i_target, - const uint64_t i_address, - buffer& o_data) - { - o_data = 0x0000FEEDFACE0000; - std::cout << std::hex << " getScom " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "output data: " << uint64_t(o_data) - << std::dec << std::endl; - - return FAPI2_RC_SUCCESS; - } - - /// @brief Platform-level implementation of putScom() - /// @Tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address SCOM register address to write to. - /// @param[in] i_data Buffer that holds data to write into address. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - template< TargetType K > - inline ReturnCode putScom(const Target& i_target, - const uint64_t i_address, - const buffer i_data) - { - std::cout << std::hex << " putScom " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "input data: " << uint64_t(i_data) - << std::dec << std::endl; - return FAPI2_RC_SUCCESS; - } - - /// @brief Platform-level implementation of putScomUnderMask() - /// @tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address SCOM register address to write to. - /// @param[in] i_data Buffer that holds data to write into address. - /// @param[in] i_mask Buffer that holds the mask value. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - template< TargetType K > - inline ReturnCode putScomUnderMask(const Target& i_target, - const uint64_t i_address, - const buffer i_data, - const buffer i_mask) - { - std::cout << std::hex << " putScomUnderMask " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "input data: " << uint64_t(i_data) << "; " - << "input mask: " << uint64_t(i_mask) - << std::dec << std::endl; - return FAPI2_RC_SUCCESS; - } - - /// - /// @brief Platform-level implementation called by getCfamRegister() - /// Hardware procedures writers will not call this function. - /// @Tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address CFAM address to read from. - /// @param[out] o_data 32-bit buffer that holds data read from HW target. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - template< TargetType K > - inline ReturnCode getCfamRegister(const Target& i_target, - const uint32_t i_address, - buffer& o_data) - { - o_data = 0xFEED0CFA; - std::cout << std::hex << " getCfamRegister " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "output data: " << uint32_t(o_data) - << std::dec << std::endl; - return FAPI2_RC_SUCCESS; - } - - /// - /// @brief Platform-level implementation of putCfamRegister() - /// Hardware procedures writers will not call this function. - /// @Tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address CFAM address to write to. - /// @param[out] i_data 32-bit buffer that holds data to write into address. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - template< TargetType K > - inline ReturnCode putCfamRegister(const Target& i_target, - const uint32_t i_address, - const buffer i_data) - { - std::cout << std::hex << " putCfamRegister " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "input data: " << uint32_t(i_data) - << std::dec << std::endl; - return FAPI2_RC_SUCCESS; - } - - - /// - /// @brief Platform-level implementation of modifyCfamRegister() - /// Hardware procedures writers will not call this function. - /// @Tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address CFAM register address to modify. - /// @param[out] i_data 32-bit buffer that holds data to modify. - /// @param[in] i_modifyMode The modify mode (or/and/xor). - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - template< TargetType K > - inline ReturnCode modifyCfamRegister(const Target& i_target, - const uint32_t i_address, - const buffer i_data, - const fapi2::ChipOpModifyMode i_modifyMode) - { - std::cout << std::hex << " modifyCfamRegister " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "input modifying data: " << uint32_t(i_data) << "; " - << "input ChipOpModifyMode: " << i_modifyMode - << std::dec << std::endl; - return FAPI2_RC_SUCCESS; - } - - // variable_buffer isn't supported on PPE -#ifndef __PPE__ - /// - /// @brief Platform-level implementation of getRing() - /// Hardware procedures writers will not call this function. - /// @Tparam K template parameter, passed in target. - /// @param[in] i_target HW target to operate on. - /// @param[in] i_address Ring address to read from. - /// @param[out] o_data Buffer that holds ring data read from HW target. - /// @param[in] i_ringMode Ring operation mode. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - template< TargetType K > - inline ReturnCode getRing(const Target& i_target, - const scanRingId_t i_address, - variable_buffer& o_data, - const RingMode i_ringMode) - { - o_data.setBit(0); - o_data.setBit(3); - std::cout << std::hex << " getRing " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "ring address: " << i_address << "; " - << "ring mode: " << i_ringMode << "; " - << "first element of output data: " << o_data()[0] - << std::endl; - - return FAPI2_RC_SUCCESS; - } - - /// @brief Platform-level implementation of putRing() - /// Hardware procedures writers will not call this function. - /// @tparam K template parameter, passed in target. - /// @param[in] i_target Target to operate on. - /// @param[in] i_address Ring address to write to. - /// @param[in] i_data Buffer that contains RS4 compressed ring data - /// to write into address - /// @param[in] i_ringMode Ring operation mode. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - template< TargetType K > - inline ReturnCode putRing(const Target& i_target, - const scanRingId_t i_address, - const variable_buffer& i_data, - const RingMode i_ringMode) - { - std::cout << std::hex << " putRing " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "ring mode: " << i_ringMode << "; " - << "first element of the input data: " << i_data()[0] - << std::endl; - - return FAPI2_RC_SUCCESS; - } - - /// @brief Platform-level implementation of modifyRing() - /// @tparam K template parameter, passed in target. - /// @param[in] i_target Target to operate on. - /// @param[in] i_address Ring address to modify. - /// @param[in] i_data Buffer that contains RS4 compressed ring data - /// to be modified. - /// @param[in] i_modifyMode The modify mode (or/and/xor) - /// @param[in] i_ringMode Ring operation mode. - /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - template< TargetType K > - inline ReturnCode modifyRing(const Target& i_target, - const scanRingId_t i_address, - const variable_buffer& i_data, - const ChipOpModifyMode i_modifyMode, - const RingMode i_ringMode) - { - std::cout << std::hex << " modifyRing " - << "target: {" << i_target.getType() << "," - << uint64_t(i_target) << "}; " - << "address: " << i_address << "; " - << "input ChipOpModifyMode: " << i_modifyMode << "; " - << "ring mode: " << i_ringMode << "; " - << "first element of the input data: " << i_data()[0] - << std::endl; - - return FAPI2_RC_SUCCESS; - } -#endif - -#ifdef FAPI_SUPPORT_MULTI_SCOM - /// @brief Performs a multiple SCOM operation - /// This interface performs multiple SCOM operations on a chip in the - /// order specified by the input MultiScom object. - /// See fapiMultiScom.H for details of how to populate the MultiScom - /// object with SCOM operations. - /// - /// @tparam K template parameter, passed in target. - /// @param[in] i_target Target to operate on. - /// @param[in,out] io_multiScomObj Reference to a MultiScom object, - /// pre-populated with SingleScomInfo entries - /// to perform multiple SCOMs on input target - /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - /// @note This is a synchronous interface and would return after all the - /// SCOM operations are completed or on the first failed 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. - /// - template< TargetType K > - fapi2::ReturnCode multiScom (const Target& i_target, - MultiScom& io_multiScomObj) - { - } -#endif - - // -------------------------------------------------------------------------- - // NOTE: - // Implement platform Spy access functions if platform supports them. - // -------------------------------------------------------------------------- - - // variable_buffer isn't supported on PPE -#ifndef __PPE__ - /// @brief Reads a spy from a chip. - /// @tparam K template parameter, passed in target. - /// @param[in] i_target Target to operate on. - /// @param[in] i_spyId Id of the spy whose data to be read. - /// @param[out] o_data Buffer that holds data read from HW target. - /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - /// @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 - /// - /// fapi2::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 - /// -#ifdef FAPI_SUPPORT_SPY_AS_ENUM - template< TargetType K > - inline ReturnCode getSpy(const Target& i_target, - const spyId_t i_spyId, - variable_buffer& o_data) - { - static_assert(K == 0, "implement getSpy (string)"); - return ~FAPI2_RC_SUCCESS; - } -#endif -#ifdef FAPI_SUPPORT_SPY_AS_STRING - template< TargetType K > - inline ReturnCode getSpy(const Target& i_target, - const char * const i_spyId, - variable_buffer& o_data) - { - static_assert(K == 0, "implement getSpy (string)"); - return ~FAPI2_RC_SUCCESS; - } -#endif - /// @brief Writes a spy on a chip. - /// @tparam K template parameter, passed in target. - /// @param[in] i_target Target to operate on. - /// @param[in] i_spyId Id of the spy to write data to. - /// @param[out] i_data Buffer that holds data to write into spy. - /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - /// @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 - /// is 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 - /// - /// fapi2::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 - /// -#ifdef FAPI_SUPPORT_SPY_AS_ENUM - template< TargetType K > - inline ReturnCode putSpy(const Target& i_target, - const spyId_t i_spyId, - variable_buffer& i_data) - { - static_assert(K == 0, "implement putSpy (enum)"); - return ~FAPI2_RC_SUCCESS; - } -#endif -#ifdef FAPI_SUPPORT_SPY_AS_STRING - template< TargetType K > - inline ReturnCode putSpy(const Target& i_target, - const char* const i_spyId, - variable_buffer& i_data) - { - static_assert(K == 0, "implement putSpy (string)"); - return ~FAPI2_RC_SUCCESS; - } -#endif - /// @brief Writes spy data into a buffer holding ring data image - /// This API is used by L2/L3 repair to put column repair data - /// into a ring buffer image. - /// @tparam K template parameter, passed in target. - /// @param[in] i_target Target to operate on. - /// @param[in] i_spyId Id of the spy. - /// @param[in] i_data Buffer that holds spy data to write into ring - /// image. - /// @param[out] o_data Buffer that holds updated ring image. - /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - /// @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. - /// -#ifdef FAPI_SUPPORT_SPY_AS_ENUM - template< TargetType K > - inline ReturnCode putSpyImage(const Target& i_target, - const spyId_t i_spyId, - const variable_buffer& i_data, - variable_buffer& o_imageData) - { - static_assert(K == 0, "implement putSpyImage (enum)"); - return ~FAPI2_RC_SUCCESS; - } -#endif -#ifdef FAPI_SUPPORT_SPY_AS_STRING - template< TargetType K > - inline ReturnCode putSpyImage(const Target& i_target, - const char* const i_spyId, - const variable_buffer& i_data, - variable_buffer& o_imageData) - { - static_assert(K == 0, "implement putSpyImage (string)"); - return ~FAPI2_RC_SUCCESS; - } -#endif - /// @brief Reads spy data from a ring image buffer - /// @param[in] i_target Target to operate on - /// @param[in] i_spyId The spy's id - /// @param[out] o_data Buffer that holds data read from ring image. - /// @param[in] i_imageData Buffer that holds ring image to read data - /// from. - /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. - /// - /// @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. - /// -#ifdef FAPI_SUPPORT_SPY_AS_ENUM - template< TargetType K > - inline ReturnCode getSpyImage(const Target& i_target, - const spyId_t i_spyId, - variable_buffer& o_data, - const variable_buffer& i_imageData) - { - static_assert(K == 0, "implement getSpyImage (enum)"); - return ~FAPI2_RC_SUCCESS; - } -#endif -#ifdef FAPI_SUPPORT_SPY_AS_STRING - template< TargetType K > - inline ReturnCode getSpyImage(const Target& i_target, - const char * const i_spyId, - variable_buffer& o_data, - const variable_buffer& i_imageData) - { - static_assert(K == 0, "implement getSpyImage (string)"); - return ~FAPI2_RC_SUCCESS; - } -#endif - -#endif // PPE - -}; - -#endif // _FAPI2_HWACCESS_H_ diff --git a/import/hwpf/fapi2/include/plat_error_scope.H b/import/hwpf/fapi2/include/plat_error_scope.H deleted file mode 100644 index ff4421dd..00000000 --- a/import/hwpf/fapi2/include/plat_error_scope.H +++ /dev/null @@ -1,64 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,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 */ -/** - * @file plat_error_scope.H - * @brief platform definitions which create a scope for automatic error handling - */ - -#ifndef __FAPI2_PLAT_ERROR_SCOPE__ -#define __FAPI2_PLAT_ERROR_SCOPE__ - -/// @cond -#define PLAT_FAPI_TRY_NO_TRACE( __operation__ ) \ - if ((fapi2::current_err = (__operation__)) != fapi2::FAPI2_RC_SUCCESS) \ - { \ - goto fapi_try_exit; \ - } - -#define PLAT_FAPI_TRY_TRACE( __operation__, ... ) \ - if ((fapi2::current_err = (__operation__)) != fapi2::FAPI2_RC_SUCCESS) \ - { \ - FAPI_ERR(__VA_ARGS__); \ - goto fapi_try_exit; \ - } - -/// -/// @brief Assert a conditional is true. -/// If it is not, the FFDC gathering function is called and the -/// trace is output as a FAPI error trace. -/// @param[in] __conditional__ the condition to assert -/// @param[in] __ffdc__ the FFDC gathering function -/// @param[in] ... varargs, as input to FAPI_ERR -/// -#define PLAT_FAPI_ASSERT( __conditional__, __ffdc__, ... ) \ - if (! (__conditional__)) \ - { \ - (__ffdc__).execute(); \ - FAPI_ERR(__VA_ARGS__); \ - goto fapi_try_exit; \ - } -/// @endcond - -#endif diff --git a/import/hwpf/fapi2/include/plat_hw_access.H b/import/hwpf/fapi2/include/plat_hw_access.H deleted file mode 100644 index 208ed759..00000000 --- a/import/hwpf/fapi2/include/plat_hw_access.H +++ /dev/null @@ -1,39 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,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 */ - -/// @file plat_hw_access.H -/// -/// @brief Platform hardware-access definitions -/// - -#ifndef _FAPI2_PLAT_HWACCESS_H_ -#define _FAPI2_PLAT_HWACCESS_H_ - -namespace fapi2 -{ - -} - -#endif // _FAPI2_PLAT_HWACCESS_H_ diff --git a/import/hwpf/fapi2/include/plat_target.H b/import/hwpf/fapi2/include/plat_target.H deleted file mode 100644 index 86c70465..00000000 --- a/import/hwpf/fapi2/include/plat_target.H +++ /dev/null @@ -1,43 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,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 */ -/** - * @file plat_target.H - * @brief platform definitions for fapi2 targets - */ - -#ifndef __FAPI2_PLAT_TARGET__ -#define __FAPI2_PLAT_TARGET__ - -// -// Define what a platform handle looks like. For Hostboot, -// for example, this might be a void*. For the SBE, this -// will be a uint64_t ... -// -namespace fapi2 -{ - typedef uint64_t plat_target_handle_t; -} - -#endif diff --git a/import/hwpf/fapi2/include/plat_trace.H b/import/hwpf/fapi2/include/plat_trace.H deleted file mode 100644 index 9104e767..00000000 --- a/import/hwpf/fapi2/include/plat_trace.H +++ /dev/null @@ -1,70 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* 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 */ -/** - * @file plat_trace.H - * @brief Defines the FAPI2 trace macros. - * - * Note that platform code must provide the implementation. - * - * FAPI has provided a default implementation. Platform code must - * provide an alternate implementation if needed. - */ - -#ifndef FAPI2_PLATTRACE_H_ -#define FAPI2_PLATTRACE_H_ - -#include -#include - -// Why not a #define, why is this in the fapi2 namespace? -// To prevent problems with Cronus and the fapi1 definitions. -namespace fapi2 -{ - static const uint32_t MAX_ECMD_STRING_LEN = 64; -}; - -// Information traces (go into fast trace buffer that can wrap often) -#define FAPI_TRACE(_id_, _fmt_, _args_...) \ - printf("%s: %s:%d ", _id_, __func__, __LINE__); \ - printf(_fmt_, ##_args_); \ - printf("\n") - -#define FAPI_INF(_fmt_, _args_...) FAPI_TRACE("inf", _fmt_, ##_args_) - -// Important traces (go into slow trace buffer that should not wrap often) -#define FAPI_IMP(_fmt_, _args_...) FAPI_TRACE("imp", _fmt_, ##_args_) - -// Error traces (go into slow trace buffer that should not wrap often) -#define FAPI_ERR(_fmt_, _args_...) FAPI_TRACE("err", _fmt_, ##_args_) - -// Debug traces (go into fast trace buffer that can wrap often) -#define FAPI_DBG(_fmt_, _args_...) FAPI_TRACE("dbg", _fmt_, ##_args_) - -// Scan traces -#define FAPI_SCAN(_fmt_, _args_...) FAPI_TRACE("scan", _fmt_, ##_args_) - -#define FAPI_MFG(_fmt_, _args_...) FAPI_TRACE("mfg", _fmt_, ##_args_) - -#endif // FAPI2_PLATTRACE_H_ diff --git a/import/hwpf/fapi2/include/target.H b/import/hwpf/fapi2/include/target.H deleted file mode 100644 index 1cd14451..00000000 --- a/import/hwpf/fapi2/include/target.H +++ /dev/null @@ -1,171 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,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 */ -/** - * @file target.H - * @brief platform specializations for fapi2 targets - */ - -#ifndef __FAPI2_TARGET__ -#define __FAPI2_TARGET__ - -#include -#include -#include - -namespace fapi2 -{ - - /// - /// @brief Assignment Operator. - /// @param[in] i_right Reference to Target to assign from. - /// @return Reference to 'this' Target - /// - template - Target& Target::operator=(const Target& i_right) - { iv_handle = i_right.iv_handle; return *this; } - - /// - /// @brief Equality Comparison Operator - /// @param[in] i_right Reference to Target to compare. - /// @return bool. True if equal. - /// @note Platforms need to define this so that the physical - /// targets are determined to be equivilent rather than just the handles - /// - template - bool Target::operator==(const Target& i_right) const - { return i_right.iv_handle == iv_handle; } - - /// - /// @brief Inquality Comparison Operator - /// @param[in] i_right Reference to Target to compare. - /// @return bool. True if not equal. - /// @note Platforms need to define this so that the physical - /// targets are determined to be equivilent rather than just the handles - /// - template - bool Target::operator!=(const Target& i_right) const - { return i_right.iv_handle != iv_handle; } - - /// - /// @brief Get this target's immediate parent - /// @tparam T The type of the parent - /// @return Target a target representing the parent - /// - template - template - inline Target Target::getParent(void) const - { - // For testing - return Target(iv_handle); - } - - /// - /// @brief Get this target's children - /// @tparam T The type of the parent - /// @param[in] i_state The desired TargetState of the children - /// @return std::vector > a vector of present/functional - /// children - /// @warning The children of EX's (cores) are expected to be returned - /// in order. That is, core 0 is std::vector[0]. - /// - template - template< TargetType T> - inline std::vector > - Target::getChildren(const TargetState i_state) const - { - // To keep the compiler quiet about unused variables - static_cast(i_state); - // For testing - return {Target(), Target()}; - } - - /// - /// @brief Get the target at the other end of a bus - dimm included - /// @tparam T The type of the parent - /// @param[in] i_state The desired TargetState of the children - /// @return Target a target representing the thing on the other end - /// @note Can be easily changed to a vector if needed - /// - template - template - inline Target - Target::getOtherEnd(const TargetState i_state) const - { - // Implementation note: cast to a composite of - // bus types and the compiler will check if this is - // a good function at compile time - return Target(); - } - - - /// - /// @brief Return the string interpretation of this target - /// @tparam T The type of the target - /// @param[in] i_target Target - /// @param[in] i_buffer buffer to write in to - /// @param[in] i_bsize size of the buffer - /// @return void - /// @post The contents of the buffer is replaced with the string - /// representation of the target - /// - template< TargetType T > - inline void toString(const Target& i_target, char* i_buffer, size_t i_bsize) - { - snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target.get(), T); - } - - /// - /// @brief Return the string interpretation of this target - /// @tparam T The type of the target - /// @tparam B The type of the buffer - /// @param[in] A pointer to the Target - /// @param[in] i_buffer buffer to write in to - /// @param[in] i_bsize size of the buffer - /// @return void - /// @post The contents of the buffer is replaced with the string - /// representation of the target - /// - template< TargetType T > - inline void toString(const Target* i_target, char* i_buffer, size_t i_bsize) - { - snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target->get(), T); - } - - /// - /// @brief Get an enumerated target of a specific type - /// @tparam T The type of the target - /// @param[in] Ordinal representing the ordinal number of - /// the desired target - /// @return Target the target requested - /// - template - inline Target getTarget(uint64_t Ordinal) - { - // For testing - return Target(Ordinal); - } -} - -#endif -- cgit v1.2.1