diff options
| author | Bill Schwartz <whs@us.ibm.com> | 2013-06-13 10:55:44 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-07-01 10:18:00 -0500 |
| commit | d125363f31f9277d1791966e5c694580d1b5e6fe (patch) | |
| tree | d758d43a3bb1053f63823b1dd717a80505b05571 /src/include/usr/hwpf | |
| parent | 50c029f1ac96bc844550000cb5ee4e9fac4ad462 (diff) | |
| download | blackbird-hostboot-d125363f31f9277d1791966e5c694580d1b5e6fe.tar.gz blackbird-hostboot-d125363f31f9277d1791966e5c694580d1b5e6fe.zip | |
VPD Accessor functions for Slope/Intercept
Create a HWP accessor to retrieve power slope and intercept data attributes
from cvpd record VSPD keyword MW and MV.
Change-Id: Ia7516505a03695c80d565523242e5c2350402cd0
RTC: 67125
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4999
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
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/mvpd_accessors/getMBvpdSlopeInterceptData.H | 80 | ||||
| -rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatAttributeService.H | 44 |
2 files changed, 121 insertions, 3 deletions
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H new file mode 100644 index 000000000..356bb4f50 --- /dev/null +++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H @@ -0,0 +1,80 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $Id$ + +/** + * @file getMBvpdSlopeInterceptData.H + * + * @brief Prototype for getMBvpdSlopeInterceptData() - + * get master and supplier power slope and intercept from MBvpd + */ + +#ifndef _HWP_MBVPDSLOPEINTERCEPTDATA_ +#define _HWP_MBVPDSLOPEINTERCEPTDATA_ + +#include <fapi.H> + +namespace fapi +{ + + enum MBvpdSlopeIntercept + { + MASTER_POWER_SLOPE = 0x00, + MASTER_POWER_INTERCEPT = 0x01, + SUPPLIER_POWER_SLOPE = 0x02, + SUPPLIER_POWER_INTERCEPT = 0x03, + }; +} + +// function pointer typedef definition for HWP call support +typedef fapi::ReturnCode (*getMBvpdSlopeInterceptData_FP_t) + (const fapi::Target &, const fapi::MBvpdSlopeIntercept, uint32_t &); + +extern "C" +{ +/** + * @brief Return power slope and intercept data from cvpd record VSPD + * keyword MW and MV + * + * The Master power slope and intercept data is in the MW keyword. + * The Supplier power slope and intercept data is in the MV keyword. + * The #I keyword has the Module ID for this CDIMM. The MV keyword + * has the supplier power slope and intercept for multiple vendors. + * The list in MV is searched for the Module ID in the #I keyword. + * Values for the matching vendor are returned. + * + * @param[in] i_mbTarget - membuf chip target + * @param[in] i_attr - enumerator to select requested value + * @param[out] o_val - master/supplier slope/intercept value + * + * @return fapi::ReturnCode - FAPI_RC_SUCCESS if success, + * relevant error code for failure. + */ +fapi::ReturnCode getMBvpdSlopeInterceptData( + const fapi::Target &i_mbTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t &o_val); + +} + +#endif diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H index c45250917..fd2776f7c 100644 --- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H +++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H @@ -56,6 +56,7 @@ #include <hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H> #include <hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H> #include <hwpf/hwp/mvpd_accessors/getMBvpdTermData.H> +#include <hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H> #include <vpd/spdenums.H> #include <dimmConsts.H> #include <util/singleton.H> @@ -474,9 +475,9 @@ fapi::ReturnCode fapiPlatGetAddrMirrorData ( * It should not be called directly. * * @param[in] i_pTarget Target pointer - * @param i_attr Termination Data attribute enumerator - * @param o_pVal Pointer to variable typed output values - * @param i_valSize Size of output variable + * @param[in] i_attr Termination Data attribute enumerator + * @param[out] o_pVal Pointer to variable typed output values + * @param[in] i_valSize Size of output variable * @return ReturnCode. Zero on success, else platform specified error */ fapi::ReturnCode fapiPlatGetTermData ( @@ -484,6 +485,20 @@ fapi::ReturnCode fapiPlatGetTermData ( const fapi::MBvpdTermData i_attr, void * o_pVal, const uint32_t i_valSize); +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting + * the Slope Intercept Data attributes + * It should not be called directly. + * + * @param[in] i_pTarget Target pointer + * @param[in] i_attr Slope Intercept Data attribute enumerator + * @param[out] o_Val Slope Intercept Data + * @return ReturnCode. Zero on success, else platform specified error + */ +fapi::ReturnCode fapiPlatGetSlopeInterceptData ( + const fapi::Target * i_pTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t & o_Val); } // namespace platAttrSvc } // namespace fapi @@ -1270,5 +1285,28 @@ fapi::ReturnCode fapiPlatGetTermData ( fapi::FAPI_RC_SUCCESS #endif +//------------------------------------------------------------------------------ +// MACROS to support MBVPD Slope Intercept attributes +//------------------------------------------------------------------------------ +#define ATTR_CDIMM_VPD_MASTER_POWER_SLOPE_GETMACRO(ID, PTARGET, VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\ + fapi::FAPI_RC_SUCCESS :\ + fapi::platAttrSvc::fapiPlatGetSlopeInterceptData\ + (PTARGET, fapi::MASTER_POWER_SLOPE , VAL) +#define ATTR_CDIMM_VPD_MASTER_POWER_INTERCEPT_GETMACRO(ID, PTARGET, VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\ + fapi::FAPI_RC_SUCCESS :\ + fapi::platAttrSvc::fapiPlatGetSlopeInterceptData\ + (PTARGET, fapi::MASTER_POWER_INTERCEPT , VAL) +#define ATTR_CDIMM_VPD_SUPPLIER_POWER_SLOPE_GETMACRO(ID, PTARGET, VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\ + fapi::FAPI_RC_SUCCESS :\ + fapi::platAttrSvc::fapiPlatGetSlopeInterceptData\ + (PTARGET, fapi::SUPPLIER_POWER_SLOPE , VAL) +#define ATTR_CDIMM_VPD_SUPPLIER_POWER_INTERCEPT_GETMACRO(ID, PTARGET, VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\ + fapi::FAPI_RC_SUCCESS :\ + fapi::platAttrSvc::fapiPlatGetSlopeInterceptData\ + (PTARGET, fapi::SUPPLIER_POWER_INTERCEPT , VAL) #endif // FAPIPLATATTRIBUTESERVICE_H_ |

