diff options
| author | Thi Tran <thi@us.ibm.com> | 2015-05-07 19:56:40 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-06-08 13:26:46 -0500 |
| commit | 88d80a5413edb09b8862016b6550ec49d18acd90 (patch) | |
| tree | 9c61b4cb8aea40564d01916eeb94d4963bb85c1f /src/include/usr/hwpf | |
| parent | 2c58244681b00392889f7be602d1d80f3efa44ef (diff) | |
| download | blackbird-hostboot-88d80a5413edb09b8862016b6550ec49d18acd90.tar.gz blackbird-hostboot-88d80a5413edb09b8862016b6550ec49d18acd90.zip | |
SW272633: proc_tp_collect_dbg_data.C : review use of arrays
Change-Id: Ibdf88aee255fba74968a9188ee878258947b727c
CQ:SW272633
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/17636
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Tested-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/17639
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwpf')
| -rw-r--r-- | src/include/usr/hwpf/hwp/tp_dbg_data_accessors/getTpDbgDataAttr.H | 93 | ||||
| -rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatAttributeService.H | 51 |
2 files changed, 144 insertions, 0 deletions
diff --git a/src/include/usr/hwpf/hwp/tp_dbg_data_accessors/getTpDbgDataAttr.H b/src/include/usr/hwpf/hwp/tp_dbg_data_accessors/getTpDbgDataAttr.H new file mode 100644 index 000000000..c4e25d8e8 --- /dev/null +++ b/src/include/usr/hwpf/hwp/tp_dbg_data_accessors/getTpDbgDataAttr.H @@ -0,0 +1,93 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/hwp/tp_dbg_data_accessors/getTpDbgDataAttr.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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: getTpDbgDataAttr.H,v 1.1 2015/05/07 20:11:12 thi Exp $ +/** + * @file getTpDbgDataAttr.H + * + * @brief Prototype for getPervVitalAttr() - + * Fetch TP Debug data attributes based on chip EC + * from static arrays (fapiTpDbgDataAttr.H) + */ + +#ifndef _HWP_GETPERVVITALATTR_ +#define _HWP_GETPERVVITALATTR_ + +#include <fapi.H> +#include <fapiTpDbgDataAttr.H> + +// Function pointer typedef definition for HWP call support +typedef fapi::ReturnCode (*getPervVitlRingLengthAttr_FP_t) + (const fapi::Target &, uint32_t &); + +typedef fapi::ReturnCode (*getTpVitlSpyLengthAttr_FP_t) + (const fapi::Target &, uint32_t &); + +typedef fapi::ReturnCode (*getTpVitlSpyOffsetAttr_FP_t) + (const fapi::Target &, uint32_t (&)[SPY_OFFSET_SIZE]); + +extern "C" +{ + +/** + * @brief Get processor TP VITL spy length for the specified target CPU. + * + * @param i_fapiTarget - cpu target + * @param o_ringLength - out: Length of decompressed data + * + * @return fapi::ReturnCode - FAPI_RC_SUCCESS if success, + * relevant error code for failure. + */ +fapi::ReturnCode getPervVitlRingLengthAttr(const fapi::Target &i_fapiTarget, + uint32_t (&o_ringLength)); + + +/** + * @brief Get processor PERV VITL ring length for the specified target CPU. + * + * @param i_fapiTarget - cpu target + * @param o_spyLength - out: Length of spy + * + * @return fapi::ReturnCode - FAPI_RC_SUCCESS if success, + * relevant error code for failure. + */ +fapi::ReturnCode getTpVitlSpyLengthAttr(const fapi::Target &i_fapiTarget, + uint32_t (&o_spyLength)); + + +/** + * @brief Get processor TP VITL spy offsets for the specified target CPU. + * + * @param i_fapiTarget - cpu target + * @param o_data - out: spy offset data + * + * @return fapi::ReturnCode - FAPI_RC_SUCCESS if success, + * relevant error code for failure. + */ +fapi::ReturnCode getTpVitlSpyOffsetAttr(const fapi::Target &i_fapiTarget, + uint32_t (&o_data)[SPY_OFFSET_SIZE]); + +} + +#endif diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H index 61f44f9f6..58efade6f 100644 --- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H +++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H @@ -66,6 +66,7 @@ #include <util/singleton.H> #include <procMemConsts.H> #include <fapiL3DeltaDataAttr.H> +#include <fapiTpDbgDataAttr.H> #include <config.h> //****************************************************************************** @@ -758,6 +759,43 @@ fapi::ReturnCode getIsDimmToC4DQS fapi::ReturnCode fapiPlatGetRCDCntlWord015 (const fapi::Target * i_pTarget, uint64_t & o_val); +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting the + * ATTR_PROC_PERV_VITL_LENGTH attribute. It should not be called + * directly. + * + * @param[in] i_pProcTarget Processor Chip Target pointer + * @param[out] o_ringLength length of decompressed ring + */ +fapi::ReturnCode fapiPlatGetPervVitlRingLengthAttr( + const fapi::Target * i_pProcTarget, + uint32_t (&o_ringLength)); + + +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting the + * ATTR_PROC_TP_VITL_SPY_LENGTH attribute. It should not be called + * directly. + * + * @param[in] i_pProcTarget Processor Chip Target pointer + * @param[out] o_spyLength length of the spy + */ +fapi::ReturnCode fapiPlatGetTpVitlSpyLengthAttr( + const fapi::Target * i_pProcTarget, + uint32_t (&o_spyLength)); + +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting the + * ATTR_PROC_TP_VITL_SPY_OFFSETS attribute. It should not be called + * directly. + * + * @param[in] i_pProcTarget Processor Chip Target pointer + * @param[out] o_offsets Reference to output spy offsets + */ +fapi::ReturnCode fapiPlatGetTpVitlSpyOffsetAttr( + const fapi::Target * i_pProcTarget, + uint32_t (&o_data)[SPY_OFFSET_SIZE]); + } // namespace platAttrSvc } // namespace fapi @@ -2697,4 +2735,17 @@ fapi::ReturnCode fapiPlatGetRCDCntlWord015 (const fapi::Target * i_pTarget, fapi::platAttrSvc::fapiPlatGetOscswitchCtl \ (PTARGET,fapi::getOscswitchCtl::CTL2,&VAL,sizeof(VAL)) +//------------------------------------------------------------------------------ +// MACROS to support VITL ring/spy data attributes +//------------------------------------------------------------------------------ +#define ATTR_PROC_PERV_VITL_LENGTH_GETMACRO(ID, PTARGET, VAL) \ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \ + fapi::platAttrSvc::fapiPlatGetPervVitlRingLengthAttr(PTARGET, VAL) +#define ATTR_PROC_TP_VITL_SPY_LENGTH_GETMACRO(ID, PTARGET, VAL) \ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \ + fapi::platAttrSvc::fapiPlatGetTpVitlSpyLengthAttr(PTARGET, VAL) +#define ATTR_PROC_TP_VITL_SPY_OFFSETS_GETMACRO(ID, PTARGET, VAL) \ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \ + fapi::platAttrSvc::fapiPlatGetTpVitlSpyOffsetAttr(PTARGET, VAL) + #endif // FAPIPLATATTRIBUTESERVICE_H_ |

