diff options
| -rw-r--r-- | src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H | 80 | ||||
| -rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatAttributeService.H | 44 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/memory_attributes.xml | 4 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C | 11 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C | 372 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk | 3 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml | 8 | ||||
| -rw-r--r-- | src/usr/hwpf/plat/fapiPlatAttributeService.C | 14 | ||||
| -rw-r--r-- | src/usr/hwpf/test/fapiwinkletest.H | 111 | ||||
| -rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 76 | ||||
| -rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 4 | ||||
| -rw-r--r-- | src/usr/vpd/makefile | 2 |
12 files changed, 635 insertions, 94 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_ diff --git a/src/usr/hwpf/hwp/memory_attributes.xml b/src/usr/hwpf/hwp/memory_attributes.xml index 4ea2f6de6..93b62644c 100644 --- a/src/usr/hwpf/hwp/memory_attributes.xml +++ b/src/usr/hwpf/hwp/memory_attributes.xml @@ -3217,7 +3217,6 @@ Comes from the VPD MW Keyword</description> <description>Master Power Slope that comes from the VPD MW Keyword</description> <valueType>uint32</valueType> <platInit/> - <writeable/> <odmVisable/> <odmChangeable/> <persistRuntime/> @@ -3229,7 +3228,6 @@ Comes from the VPD MW Keyword</description> <description>Master Power Intercept that comes from the VPD MW Keyword</description> <valueType>uint32</valueType> <platInit/> - <writeable/> <odmVisable/> <odmChangeable/> <persistRuntime/> @@ -3241,7 +3239,6 @@ Comes from the VPD MW Keyword</description> <description>Supplier Power Slope that comes from the VPD the MV Keyword</description> <valueType>uint32</valueType> <platInit/> - <writeable/> <odmVisable/> <odmChangeable/> <persistRuntime/> @@ -3253,7 +3250,6 @@ Comes from the VPD MW Keyword</description> <description>Supplier Power Intercept that comes from MV Keyword</description> <valueType>uint32</valueType> <platInit/> - <writeable/> <odmVisable/> <odmChangeable/> <persistRuntime/> diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C index 22389959d..cc76bf84f 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C @@ -57,17 +57,18 @@ fapi::ReturnCode getMBvpdAddrMirrorData( { port_attributes mba_port[NUM_PORTS]; }; - struct ma_keyword + struct am_keyword { mba_attributes mb_mba[NUM_MBAS]; + uint8_t spare[8]; //VPD data CCIN_31E1_v.5.3.ods }; - const uint32_t AM_KEYWORD_SIZE = sizeof(ma_keyword); // keyword size + const uint32_t AM_KEYWORD_SIZE = sizeof(am_keyword); // keyword size fapi::ReturnCode l_fapirc; fapi::Target l_mbTarget; uint8_t l_mbaPos = NUM_MBAS; //initialize to out of range value (+1) - ma_keyword * l_pMaBuffer = NULL; // MBvpd MT keyword buffer - uint32_t l_MaBufsize = sizeof(ma_keyword); + am_keyword * l_pMaBuffer = NULL; // MBvpd MT keyword buffer + uint32_t l_MaBufsize = sizeof(am_keyword); FAPI_DBG("getMBvpdAddrMirrorData: entry "); @@ -95,7 +96,7 @@ fapi::ReturnCode getMBvpdAddrMirrorData( l_mbTarget.toEcmdString() ); // Read the AM keyword field - l_pMaBuffer = new ma_keyword; + l_pMaBuffer = new am_keyword; l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, fapi::MBVPD_KEYWORD_AM, diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C new file mode 100644 index 000000000..2936e5854 --- /dev/null +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C @@ -0,0 +1,372 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C $ */ +/* */ +/* 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.C + * + * @brief get master and supplier power slope and intercept data + * from MBvpd MV and MW keywords + * + */ + +#include <stdint.h> + +// fapi support +#include <fapi.H> +#include <getMBvpdSlopeInterceptData.H> + +extern "C" +{ +using namespace fapi; + +// local function to get master power slope and intercept data +fapi::ReturnCode getMBvpdMasterData( + const fapi::Target &i_mbTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t & o_val); + +// local function to get supplier power slope and intercept data +fapi::ReturnCode getMBvpdSupplierData( + const fapi::Target &i_mbTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t & o_val); + +/** + * @brief get power slope and intercept data from cvpd record VSPD + * keyword MW and MV + * @param[in] i_mbTarget - mb 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) +{ + fapi::ReturnCode l_fapirc; + + FAPI_DBG("getMBvpdSlopeInterceptData: entry "); + + // get master values from MW keyword or supplier values from MV keyword + switch (i_attr) + { + case MASTER_POWER_SLOPE: + case MASTER_POWER_INTERCEPT: + l_fapirc = getMBvpdMasterData(i_mbTarget, i_attr, o_val); + break; + case SUPPLIER_POWER_SLOPE: + case SUPPLIER_POWER_INTERCEPT: + l_fapirc = getMBvpdSupplierData(i_mbTarget, i_attr, o_val); + break; + default: // Hard to do, but needs to be caught + FAPI_ERR("getMBvpdSlopeInterceptData: invalid attribute ID 0x%02x", + i_attr); + const fapi::MBvpdSlopeIntercept & ATTR_ID = i_attr; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INVALID_ATTRIBUTE_ID); + } + + FAPI_DBG("getMBvpdSlopeInterceptData: exit rc=0x%08x", + static_cast<uint32_t>(l_fapirc)); + return l_fapirc; +} + +// local function to get master power slope and intercept data +// +// the master power slope and intercept are in the MW keyword +// +fapi::ReturnCode getMBvpdMasterData( + const fapi::Target &i_mbTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t & o_val) +{ + fapi::ReturnCode l_fapirc; + + //MW keyword layout + struct mw_keyword + { + uint8_t MWKeywordVersion; + uint8_t masterPowerSlope_LSB; //little endian order + uint8_t masterPowerSlope_MSB; + uint8_t masterPowerIntercept_LSB; //little endian order + uint8_t masterPowerIntercept_MSB; + uint8_t reserved[4]; + uint8_t tempSensorPrimaryLayout; + uint8_t tempSensorSecondaryLayout; + }; + const uint32_t MW_KEYWORD_SIZE = sizeof(mw_keyword); // keyword size + + mw_keyword * l_pMwBuffer = NULL; // MBvpd MW keyword buffer + uint32_t l_MwBufsize = sizeof(mw_keyword); + + FAPI_DBG("getMBvpdMasterData: entry "); + + do { + + l_pMwBuffer = new mw_keyword; + + // Read the MW keyword field + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_MW, + i_mbTarget, + reinterpret_cast<uint8_t *>(l_pMwBuffer), + l_MwBufsize); + if (l_fapirc) + { + FAPI_ERR("getMBvpdMasterData: Read of MV keyword failed"); + break; // break out with fapirc + } + + // Check that sufficient MW keyword was returned. + if (l_MwBufsize < MW_KEYWORD_SIZE ) + { + FAPI_ERR("getMBvpdMasterData:" + " less MW keyword returned than expected %d < %d", + l_MwBufsize, MW_KEYWORD_SIZE); + const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_MW; + const uint32_t & RETURNED_SIZE = l_MwBufsize; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INSUFFICIENT_VPD_RETURNED ); + break; // break out with fapirc + } + + // Return requested value + switch (i_attr) + { + case MASTER_POWER_SLOPE: //convert from little endian order + o_val = l_pMwBuffer->masterPowerSlope_LSB; + o_val |= (l_pMwBuffer->masterPowerSlope_MSB << 8); + break; + case MASTER_POWER_INTERCEPT: //convert from little endian order + o_val = l_pMwBuffer->masterPowerIntercept_LSB; + o_val |= (l_pMwBuffer->masterPowerIntercept_MSB << 8); + break; + default: //i_attr value was checked before call so should not get here + break; + } + + } while (0); + + delete l_pMwBuffer; + l_pMwBuffer = NULL; + + FAPI_DBG("getMBvpdMasterData: exit rc=0x%08x", + static_cast<uint32_t>(l_fapirc)); + + return l_fapirc; +} + +// local function to get supplier power slope and intercept data +// +// Read the #I keyword to get the module ID of this CDIMM +// Then read the #MV keyword which has all the vendor supplied info +// and search the list for the module ID found in the #I keyword +// +fapi::ReturnCode getMBvpdSupplierData( + const fapi::Target &i_mbTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t & o_val) +{ + + //#I keyword layout + const uint32_t PDI_KEYWORD_SIZE = 256; + struct pdI_keyword + { + uint8_t filler1[117]; // other fields and reserved bytes + uint8_t moduleID_LSB; // at offset 117. Little endian order + uint8_t moduleID_MSB; // VPD data CCIN_31E1_v.5.3.ods + uint8_t filler2[PDI_KEYWORD_SIZE-117-2]; // trailing space + }; + + //MV keyword layout + struct mv_vendorInfo + { + uint8_t supplierID_LSB; // little endian order + uint8_t supplierID_MSB; + uint8_t supplierPowerSlope_LSB; // little endian order + uint8_t supplierPowerSlope_MSB; + uint8_t supplierPowerIntercept_LSB; // little endian order + uint8_t supplierPowerIntercept_MSB; + uint8_t reserved[4]; + }; + struct mv_keyword //variable length + { + uint8_t version; + uint8_t numEntries; + mv_vendorInfo firstVendorInfo; + // variable number of vendor supplied entries + }; + + fapi::ReturnCode l_fapirc; + pdI_keyword * l_pPdIBuffer = NULL; // MBvpd #I keyword buffer + uint32_t l_pdIBufsize = sizeof(pdI_keyword); + uint8_t l_moduleID_LSB = 0; // module ID to look for + uint8_t l_moduleID_MSB = 0; + mv_keyword * l_pMvBuffer = NULL; // MBvpd MV keyword buffer + uint32_t l_mvBufsize = 0; // variable length + mv_vendorInfo * l_pVendorInfo = NULL; + uint32_t l_offset = 0; + bool l_found = false; + + do { + + l_pPdIBuffer = new pdI_keyword; + + // Read the #I keyword field to get the Module ID + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_PDI, + i_mbTarget, + reinterpret_cast<uint8_t *>(l_pPdIBuffer), + l_pdIBufsize); + if (l_fapirc) + { + FAPI_ERR("getMBvpdSupplierData: Read of pdI keyword failed"); + break; // break out with fapirc + } + + // Check that sufficient #I was returned. + if (l_pdIBufsize < PDI_KEYWORD_SIZE ) + { + FAPI_ERR("getMBvpdSupplierData:" + " less #I keyword returned than expected %d < %d", + l_pdIBufsize, PDI_KEYWORD_SIZE); + const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_PDI; + const uint32_t & RETURNED_SIZE = l_pdIBufsize; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INSUFFICIENT_VPD_RETURNED ); + break; // break out with fapirc + } + + // grab module ID and free buffer + l_moduleID_LSB = l_pPdIBuffer->moduleID_LSB; + l_moduleID_MSB = l_pPdIBuffer->moduleID_MSB; + + FAPI_DBG("getMBvpdSupplierData: #I moduleID=0x%08x ", + l_moduleID_LSB+(l_moduleID_MSB<<8)); + + // see how big the MV keyword is as it is variable length + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_MV, + i_mbTarget, + NULL, //pass NULL buff pointer to get size + l_mvBufsize); + if (l_fapirc) + { + FAPI_ERR("getMBvpdSupplierData: Read of MV keyword failed"); + break; // break out with fapirc + } + + // read MV keyword + l_pMvBuffer = (mv_keyword *)new uint8_t[l_mvBufsize]; + + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_MV, + i_mbTarget, + reinterpret_cast<uint8_t *>(l_pMvBuffer), + l_mvBufsize); + if (l_fapirc) + { + FAPI_ERR("getMBvpdSupplierData: Read of MV keyword failed"); + break; // break out with fapirc + } + + // Check that sufficient MV was returned to get at least the count. + l_pVendorInfo = &(l_pMvBuffer->firstVendorInfo); + l_offset = (uint8_t *)l_pVendorInfo - (uint8_t *)l_pMvBuffer; + + if (l_mvBufsize < l_offset ) + { + FAPI_ERR("getMBvpdSupplierData:" + " less MV keyword returned than expected %d < %d", + l_mvBufsize, l_offset); + const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_MV; + const uint32_t & RETURNED_SIZE = l_mvBufsize; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INSUFFICIENT_VPD_RETURNED ); + break; // break out with fapirc + } + + // look for matching module ID + for (uint32_t l_count=0;l_count < l_pMvBuffer->numEntries;l_count++) + { + // shouldn't run past end of buffer, checking to be sure + if (l_offset + sizeof (mv_vendorInfo) > l_mvBufsize) + { + break; + } + + FAPI_DBG("getMBvpdSupplierData: cnt=%d this supplier ID= 0x%08x ", + l_count, + l_pVendorInfo->supplierID_LSB+(l_pVendorInfo->supplierID_MSB<<8)); + + if ((l_pVendorInfo->supplierID_LSB == l_moduleID_LSB ) && + (l_pVendorInfo->supplierID_MSB == l_moduleID_MSB )) + { + l_found = true; + break; + } + l_offset += sizeof (mv_vendorInfo); + l_pVendorInfo++; + } + + // Return requested value if found + if ( l_found ) + { + switch (i_attr) + { + case SUPPLIER_POWER_SLOPE: //convert from little endian order + o_val = l_pVendorInfo->supplierPowerSlope_LSB; + o_val |= (l_pVendorInfo->supplierPowerSlope_MSB << 8); + break; + case SUPPLIER_POWER_INTERCEPT: //convert from little endian order + o_val = l_pVendorInfo->supplierPowerIntercept_LSB; + o_val |= (l_pVendorInfo->supplierPowerIntercept_MSB << 8); + break; + default: //i_attr value was checked already so should not get here + break; + } + } + else + { + FAPI_ERR("getMBvpdSupplierData:" + " supplier ID not found 0x%04x", + l_moduleID_LSB+(l_moduleID_MSB<<8)); + const uint32_t & MODULE_ID = l_moduleID_LSB+(l_moduleID_MSB<<8); + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_SUPPLIER_ID_NOT_IN_MV_VPD ); + } + + } while (0); + + delete l_pPdIBuffer; + l_pPdIBuffer = NULL; + delete l_pMvBuffer; + l_pMvBuffer = NULL; + + FAPI_DBG("getMBvpdSupplierData: exit rc=0x%08x", + static_cast<uint32_t>(l_fapirc)); + + return l_fapirc; +} + + +} // extern "C" diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk index 96a602a10..19ea33724 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk @@ -31,5 +31,6 @@ OBJS += getMvpdRing.o \ getMvpdExL2SingleMemberEnable.o \ getMBvpdPhaseRotatorData.o \ getMBvpdAddrMirrorData.o \ - getMBvpdTermData.o + getMBvpdTermData.o \ + getMBvpdSlopeInterceptData.o diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml index 6d0347349..b2d984b27 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml @@ -108,4 +108,12 @@ <ffdc>KEYWORD</ffdc> <ffdc>RETURNED_SIZE</ffdc> </hwpError> + <!-- ********************************************************************* --> + <hwpError> + <rc>RC_MBVPD_SUPPLIER_ID_NOT_IN_MV_VPD</rc> + <description> + The Module ID in the #I keyword is not in the list of supplier provided entries in the MV keyword. + </description> + <ffdc>MODULE_ID</ffdc> + </hwpError> </hwpErrors> diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C index 9db439a93..d1e0459a1 100644 --- a/src/usr/hwpf/plat/fapiPlatAttributeService.C +++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C @@ -45,6 +45,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> // The following file checks at compile time that all HWPF attributes are // handled by Hostboot. This is done to ensure that the HTML file listing @@ -1305,6 +1306,19 @@ fapi::ReturnCode fapiPlatGetTermData ( return l_rc; } +fapi::ReturnCode fapiPlatGetSlopeInterceptData ( + const fapi::Target * i_pTarget, + const fapi::MBvpdSlopeIntercept i_attr, + uint32_t & o_Val) +{ + // Call a VPD Accessor HWP to get the data + fapi::ReturnCode l_rc; + FAPI_EXEC_HWP(l_rc, getMBvpdSlopeInterceptData, + *i_pTarget, i_attr, o_Val); + return l_rc; +} + + fapi::ReturnCode fapiPlatGetEnableAttr ( fapi::AttributeId i_id, const fapi::Target * i_pFapiTarget, uint8_t & o_enable ) { diff --git a/src/usr/hwpf/test/fapiwinkletest.H b/src/usr/hwpf/test/fapiwinkletest.H index 871b0a63a..99ca55192 100644 --- a/src/usr/hwpf/test/fapiwinkletest.H +++ b/src/usr/hwpf/test/fapiwinkletest.H @@ -49,6 +49,7 @@ #include <mvpd_accessors/getMBvpdPhaseRotatorData.H> #include <mvpd_accessors/getMBvpdAddrMirrorData.H> #include <mvpd_accessors/getMBvpdTermData.H> +#include <mvpd_accessors/getMBvpdSlopeInterceptData.H> #include <errl/errlmanager.H> #include <errl/errlentry.H> @@ -293,6 +294,116 @@ public: } /** + * @brief call getMBvpdSlopeInterceptData to fetch power slope and intercept + * attributes from the MW and MV keywords + * + */ + void testGetSlopeInterceptData() + { + fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS ); + getMBvpdSlopeInterceptData_FP_t (l_getMBvpdSlopeInterceptData) + = &getMBvpdSlopeInterceptData; + uint32_t l_val = 0xFFFFFFFF; + + TS_TRACE( "testGetSlopeInterceptData entry" ); + + TARGETING::TargetHandleList l_memBufList; + getAllChips(l_memBufList, TYPE_MEMBUF); + + TS_TRACE( "testGetSlopeInterceptData l_memBufList.size()=%d", + l_memBufList.size() ); + // loop thru memory buffers +#if UNITTESTfwt + uint8_t l_mbNum = 0; // check them all in unit test +#else + uint8_t l_mbNum = (l_memBufList.size() > 0) ? l_memBufList.size()-1 : 0; +#endif + for (; l_mbNum < l_memBufList.size(); l_mbNum++ ) + { + // make a local copy of the memory buffer target + TARGETING::Target* l_mb_target = l_memBufList[l_mbNum]; + + // dump physical path to target + EntityPath l_path; + l_path = l_mb_target->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); + + // cast OUR type of target to a FAPI type of target. + fapi::Target l_fapi_mb_target( + TARGET_TYPE_MEMBUF_CHIP, + (const_cast<TARGETING::Target*>(l_mb_target)) ); + + // MASTER_POWER_SLOPE + l_fapirc = (*l_getMBvpdSlopeInterceptData)(l_fapi_mb_target, + fapi::MASTER_POWER_SLOPE, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData accessor " + "MASTER_POWER_SLOPE=0x%08x", l_val); +#if UNITTESTfwt + + // MASTER_POWER_INTERCEPT + l_fapirc = (*l_getMBvpdSlopeInterceptData)(l_fapi_mb_target, + fapi::MASTER_POWER_INTERCEPT, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData accessor " + "MASTER_POWER_INTERCEPT=0x%08x", l_val); + + // SUPPLIER_POWER_SLOPE + l_fapirc = (*l_getMBvpdSlopeInterceptData)(l_fapi_mb_target, + fapi::SUPPLIER_POWER_SLOPE, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData accessor " + "SUPPLIER_POWER_SLOPE=0x%08x", l_val); +#endif + // SUPPLIER_POWER_INTERCEPT + l_fapirc = (*l_getMBvpdSlopeInterceptData)(l_fapi_mb_target, + fapi::SUPPLIER_POWER_INTERCEPT, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData accessor " + "SUPPLIER_POWER_INTERCEPT=0x%08x", l_val); + + // MASTER_POWER_SLOPE + l_fapirc = FAPI_ATTR_GET(ATTR_CDIMM_VPD_MASTER_POWER_SLOPE, + &l_fapi_mb_target, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData attr " + "MASTER_POWER_SLOPE=0x%08x", l_val); +#if UNITTESTfwt + // MASTER_POWER_INTERCEPT + l_fapirc = FAPI_ATTR_GET(ATTR_CDIMM_VPD_MASTER_POWER_INTERCEPT, + &l_fapi_mb_target, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData attr " + "MASTER_POWER_INTERCEPT=0x%08x", l_val); + + // SUPPLIER_POWER_SLOPE + l_fapirc = FAPI_ATTR_GET(ATTR_CDIMM_VPD_SUPPLIER_POWER_SLOPE, + &l_fapi_mb_target, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData attr " + "SUPPLIER_POWER_SLOPE=0x%08x", l_val); + +#endif + // SUPPLIER_POWER_INTERCEPT + l_fapirc = FAPI_ATTR_GET(ATTR_CDIMM_VPD_SUPPLIER_POWER_INTERCEPT, + &l_fapi_mb_target, l_val); + if (l_fapirc) break; + TS_TRACE( "testSlopeInterceptData attr " + "SUPPLIER_POWER_INTERCEPT=0x%08x", l_val); + } + + if (l_fapirc) + { + TS_FAIL( "fapiGetSlopeInterceptData: FAPI_ATTR_GET fail rc=0x%x", + static_cast<uint32_t>(l_fapirc) ); + fapiLogError(l_fapirc); + } + + TS_TRACE( "testGetSlopeInterceptData exit" ); + + } + + /** * @brief call getMBvpdAddrMirrorData to fetch memory buffer AM attributes * */ diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index ca26c9d55..5a4a9bd25 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -12381,82 +12381,6 @@ firmware notes: Platforms should initialize this attribute to AUTO (0)</descript </attribute> <attribute> - <id>CDIMM_VPD_MASTER_POWER_SLOPE</id> - <description> - Master Power Slope that comes from the VPD MW Keyword - </description> - <simpleType> - <uint32_t> - <default>0</default> - </uint32_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - <hwpfToHbAttrMap> - <id>ATTR_CDIMM_VPD_MASTER_POWER_SLOPE</id> - <macro>DIRECT</macro> - </hwpfToHbAttrMap> -</attribute> - -<attribute> - <id>CDIMM_VPD_MASTER_POWER_INTERCEPT</id> - <description> - Master Power Intercept that comes from the VPD MW Keyword - </description> - <simpleType> - <uint32_t> - <default>0</default> - </uint32_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - <hwpfToHbAttrMap> - <id>ATTR_CDIMM_VPD_MASTER_POWER_INTERCEPT</id> - <macro>DIRECT</macro> - </hwpfToHbAttrMap> -</attribute> - -<attribute> - <id>CDIMM_VPD_SUPPLIER_POWER_SLOPE</id> - <description> - Supplier Power Slope that comes from the VPD the MV Keyword - </description> - <simpleType> - <uint32_t> - <default>0</default> - </uint32_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - <hwpfToHbAttrMap> - <id>ATTR_CDIMM_VPD_SUPPLIER_POWER_SLOPE</id> - <macro>DIRECT</macro> - </hwpfToHbAttrMap> -</attribute> - -<attribute> - <id>CDIMM_VPD_SUPPLIER_POWER_INTERCEPT</id> - <description> - Supplier Power Intercept that comes from MV Keyword - </description> - <simpleType> - <uint32_t> - <default>0</default> - </uint32_t> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - <hwpfToHbAttrMap> - <id>ATTR_CDIMM_VPD_SUPPLIER_POWER_INTERCEPT</id> - <macro>DIRECT</macro> - </hwpfToHbAttrMap> -</attribute> - -<attribute> <id>EFF_DRAM_ADDRESS_MIRRORING</id> <description> Address mirroring on the DIMM by rank, up to 4 ranks. diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 9fde630ba..ab0c06669 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -1127,10 +1127,6 @@ <attribute><id>MEMB_NEST_FREQ</id></attribute> <attribute><id>CDIMM_SENSOR_MAP_PRIMARY</id></attribute> <attribute><id>CDIMM_SENSOR_MAP_SECONDARY</id></attribute> - <attribute><id>CDIMM_VPD_MASTER_POWER_SLOPE</id></attribute> - <attribute><id>CDIMM_VPD_MASTER_POWER_INTERCEPT</id></attribute> - <attribute><id>CDIMM_VPD_SUPPLIER_POWER_SLOPE</id></attribute> - <attribute><id>CDIMM_VPD_SUPPLIER_POWER_INTERCEPT</id></attribute> <attribute><id>MSS_BLUEWATERFALL_BROKEN</id></attribute> </targetType> diff --git a/src/usr/vpd/makefile b/src/usr/vpd/makefile index b09d57a75..dee15e070 100644 --- a/src/usr/vpd/makefile +++ b/src/usr/vpd/makefile @@ -29,6 +29,6 @@ SUBDIRS = test.d BINARY_FILES = $(IMGDIR)/dimmspd.dat:9a6e6b6a7f6d3fc77a12d38537279d402124d699 BINARY_FILES += $(IMGDIR)/procmvpd.dat:9473e24c02c40a577700ae0292676c4b82698c13 -BINARY_FILES += $(IMGDIR)/cvpd.dat:e64471326f58d3b6375e4d05f9d0938932fdb1ec +BINARY_FILES += $(IMGDIR)/cvpd.dat:7410a45451fb7826daf1ae218f81b2a694e64234 include ${ROOTPATH}/config.mk |

