diff options
author | Monte Copeland <copelanm@us.ibm.com> | 2011-09-13 10:22:55 -0500 |
---|---|---|
committer | MIKE J. JONES <mjjones@us.ibm.com> | 2011-09-14 09:19:46 -0500 |
commit | f6760755b655a3601612a8d4f11de0c394e24d49 (patch) | |
tree | 47096bb9621491395a98ab5cfc006df18cc64867 /src/include | |
parent | e59e01da049d2b864ff7cb1dd03b82e5a8a393b9 (diff) | |
download | talos-hostboot-f6760755b655a3601612a8d4f11de0c394e24d49.tar.gz talos-hostboot-f6760755b655a3601612a8d4f11de0c394e24d49.zip |
Common Scan Tracing Redux
Change-Id: Idca69173153f9ffedab37df22438ee600a0d9150
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/336
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiPlatHwAccess.H | 164 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiUtil.H | 19 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatTrace.H | 5 |
3 files changed, 188 insertions, 0 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H b/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H new file mode 100644 index 000000000..f3f48e166 --- /dev/null +++ b/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H @@ -0,0 +1,164 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwpf/fapi/fapiHwAccess.H $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2011 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +/** + * @file 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 + */ + +#ifndef FAPIPLATHWACCESS_H_ +#define FAPIPLATHWACCESS_H_ + +#include <stdint.h> +#include <ecmdDataBuffer.H> +#include <fapiReturnCode.H> +#include <fapiTarget.H> + + +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); + + +/** + * @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); + + +} // extern "C" + +#endif // FAPIPLATHWACCESS_H_ diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H index ad1532699..b8224483d 100644 --- a/src/include/usr/hwpf/fapi/fapiUtil.H +++ b/src/include/usr/hwpf/fapi/fapiUtil.H @@ -110,6 +110,25 @@ void fapiAssert(bool i_expression); */ void fapiLogError(ReturnCode & io_rc); + +/** @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] True to enable or false to disable scan trace. + * @return void + */ +void platSetScanTrace( bool i_enable ); + + } #endif // FAPIUTIL_H_ diff --git a/src/include/usr/hwpf/plat/fapiPlatTrace.H b/src/include/usr/hwpf/plat/fapiPlatTrace.H index 8ce17b5bd..3b5ec2bb9 100644 --- a/src/include/usr/hwpf/plat/fapiPlatTrace.H +++ b/src/include/usr/hwpf/plat/fapiPlatTrace.H @@ -44,6 +44,7 @@ const char * const FAPI_INF_TRACE_NAME = "FAPI_T"; const char * const FAPI_IMP_TRACE_NAME = "FAPI_I"; const char * const FAPI_ERR_TRACE_NAME = "FAPI_E"; const char * const FAPI_DBG_TRACE_NAME = "FAPI_D"; +const char * const FAPI_SCAN_TRACE_NAME = "SCAN"; //****************************************************************************** // Trace descriptors that are defined in a C file @@ -52,6 +53,7 @@ extern trace_desc_t* g_fapiInfTd; extern trace_desc_t* g_fapiImpTd; extern trace_desc_t* g_fapiErrTd; extern trace_desc_t* g_fapiDbgTd; +extern trace_desc_t* g_fapiScanTd; // Information traces (standard flight recorder that can wrap often) #define FAPI_INF(_fmt_, _args_...) TRACFCOMP(g_fapiInfTd, _fmt_, ##_args_ ) @@ -65,4 +67,7 @@ extern trace_desc_t* g_fapiDbgTd; // Debug traces (can wrap often) #define FAPI_DBG(_fmt_, _args_...) TRACDCOMP(g_fapiDbgTd, _fmt_, ##_args_) +// Scan traces +#define FAPI_SCAN(_fmt_, _args_...) TRACFCOMP(g_fapiScanTd, _fmt_, ##_args_) + #endif // PLATTRACE_H_ |