diff options
author | Bill Schwartz <whs@us.ibm.com> | 2013-11-20 07:50:29 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-12-06 09:52:28 -0600 |
commit | fd95cabecf413f579457779a32b903cf9f789b77 (patch) | |
tree | b8e4ae21101bd6d4c47870ade5495e7be28fb8a4 /src/usr/hwpf/hwp | |
parent | a96e2080968c59e11745fc1d1ee55ab910821bc9 (diff) | |
download | talos-hostboot-fd95cabecf413f579457779a32b903cf9f789b77.tar.gz talos-hostboot-fd95cabecf413f579457779a32b903cf9f789b77.zip |
SENSOR_MAP FAPI attributes should come from Centaur VPD (MW)
Add hwp accessor for primary and secondary sensor map from VSPD keyword MW
Change-Id: I7f64632c32236ecb29f5fd177bd5d8e9e356d7ae
RTC: 91776
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7344
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp')
-rw-r--r-- | src/usr/hwpf/hwp/dimm_spd_attributes.xml | 38 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.C | 128 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk | 3 |
3 files changed, 168 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/dimm_spd_attributes.xml b/src/usr/hwpf/hwp/dimm_spd_attributes.xml index 77af0e71d..704d9c959 100644 --- a/src/usr/hwpf/hwp/dimm_spd_attributes.xml +++ b/src/usr/hwpf/hwp/dimm_spd_attributes.xml @@ -2307,6 +2307,44 @@ This Attribute is to be interpreted as an Integer</description> </attribute> <attribute> + <id>ATTR_VPD_CDIMM_SENSOR_MAP_PRIMARY</id> + <targetType>TARGET_TYPE_MEMBUF_CHIP</targetType> + <description>Custom DIMM Sensor Map for Primary I2C Port (1 byte of data): +0x00 No sensors attached +0x01 DIMM sensor 0 attached +0x02 DIMM sensor 1 attached +0x04 DIMM sensor 2 attached +0x08 DIMM sensor 3 attached +0x10 DIMM sensor 4 attached +0x20 DIMM sensor 5 attached +0x40 DIMM sensor 6 attached +0x80 DIMM sensor 7 attached +Comes from the VPD MW Keyword</description> + <valueType>uint8</valueType> + <platInit/> + <odmVisable/> +</attribute> + +<attribute> + <id>ATTR_VPD_CDIMM_SENSOR_MAP_SECONDARY</id> + <targetType>TARGET_TYPE_MEMBUF_CHIP</targetType> + <description>Custom DIMM Sensor Map for Secondary I2C Port (1 byte of data): +0x00 No sensors attached +0x01 DIMM sensor 0 attached +0x02 DIMM sensor 1 attached +0x04 DIMM sensor 2 attached +0x08 DIMM sensor 3 attached +0x10 DIMM sensor 4 attached +0x20 DIMM sensor 5 attached +0x40 DIMM sensor 6 attached +0x80 DIMM sensor 7 attached +Comes from the VPD MW Keyword</description> + <valueType>uint8</valueType> + <platInit/> + <odmVisable/> +</attribute> + +<attribute> <id>ATTR_VPD_DRAM_2N_MODE_ENABLED</id> <targetType>TARGET_TYPE_MBA_CHIPLET</targetType> <description>Describes if this MBA is in 2N address mode. The DIMM attributes associated with this MBA describes if this mode is needed for SI. Come from the VPD and consumed in the mba_def.initfile.</description> diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.C new file mode 100644 index 000000000..37d20d311 --- /dev/null +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.C @@ -0,0 +1,128 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.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: getMBvpdSensorMap.C,v 1.1 2013/11/20 22:37:38 whs Exp $ + +/** + * @file getMBvpdSensorMap.C + * + * @brief Return primary and secondary sensor map from cvpd record VSPD + * keyword MW for attributes: + * + * ATTR_VPD_CDIMM_SENSOR_MAP_PRIMARY + * ATTR_VPD_CDIMM_SENSOR_MAP_SECONDARY + */ + +#include <stdint.h> + +// fapi support +#include <fapi.H> +#include <getMBvpdSensorMap.H> + +extern "C" +{ +using namespace fapi; + +fapi::ReturnCode getMBvpdSensorMap( + const fapi::Target &i_mbTarget, + const fapi::MBvpdSensorMap i_attr, + uint8_t &o_val) + +{ + fapi::ReturnCode l_fapirc; + + //MW keyword layout + struct mw_keyword + { + uint8_t MWKeywordVersion; + uint8_t masterPowerSlope_MSB; //big endian order + uint8_t masterPowerSlope_LSB; + uint8_t masterPowerIntercept_MSB; //big endian order + uint8_t masterPowerIntercept_LSB; + 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("getMBvpdSensorMap: 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("getMBvpdSensorMap: 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("getMBvpdSensorMap:" + " 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 SENSOR_MAP_PRIMARY: + o_val = l_pMwBuffer->tempSensorPrimaryLayout; + break; + case SENSOR_MAP_SECONDARY: + o_val = l_pMwBuffer->tempSensorSecondaryLayout; + break; + default: // Hard to do, but needs to be caught + FAPI_ERR("getMBvpdSensorMap: invalid attribute ID 0x%02x", + i_attr); + const fapi::MBvpdSensorMap & ATTR_ID = i_attr; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INVALID_ATTRIBUTE_ID); + break; + } + + } while (0); + + delete l_pMwBuffer; + l_pMwBuffer = NULL; + + FAPI_DBG("getMBvpdSensorMap: 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 d90544f73..767090c12 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk @@ -36,5 +36,6 @@ OBJS += getMvpdRing.o \ getMBvpdSlopeInterceptData.o \ getMBvpdSpareDramData.o \ getMBvpdVersion.o \ - getMBvpdDram2NModeEnabled.o + getMBvpdDram2NModeEnabled.o \ + getMBvpdSensorMap.o |