summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2013-11-22 11:38:52 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-12-06 10:14:14 -0600
commit4212697848ab0687158e4a18d7a493fdcd44a776 (patch)
treef2a9cd5703220077e438e1d01a78125f67709602 /src/usr/hwpf
parent7615414ee5ffc83a9c2c9d65770c57f69d37fc4e (diff)
downloadtalos-hostboot-4212697848ab0687158e4a18d7a493fdcd44a776.tar.gz
talos-hostboot-4212697848ab0687158e4a18d7a493fdcd44a776.zip
Workaround missing Manu-Id for Centaur DD1.X
Create a new Chip EC Feature attribute to indicate to use the first vendor information in the MV keyword for DD1.X if the module ID does not match any of the MV entries. Change-Id: I34322f2c0805e6625fb05a0b8d1233a7db7110ff RTC: 92039 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7393 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/usr/hwpf')
-rw-r--r--src/usr/hwpf/hwp/centaur_ec_attributes.xml23
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C120
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml10
3 files changed, 133 insertions, 20 deletions
diff --git a/src/usr/hwpf/hwp/centaur_ec_attributes.xml b/src/usr/hwpf/hwp/centaur_ec_attributes.xml
index b373256bb..8aac31a1d 100644
--- a/src/usr/hwpf/hwp/centaur_ec_attributes.xml
+++ b/src/usr/hwpf/hwp/centaur_ec_attributes.xml
@@ -22,7 +22,7 @@
<!-- IBM_PROLOG_END_TAG -->
<attributes>
<!-- ********************************************************************* -->
- <!-- $Id: centaur_ec_attributes.xml,v 1.14 2013/10/31 13:17:30 bwieman Exp $ -->
+<!-- $Id: centaur_ec_attributes.xml,v 1.15 2013/11/22 22:13:33 whs Exp $ -->
<attribute>
<id>ATTR_CENTAUR_EC_ENABLE_TRACE_LCL_CLK_GATE_CTRL</id>
<targetType>TARGET_TYPE_MEMBUF_CHIP</targetType>
@@ -268,4 +268,25 @@ Controls the ddr_phy_reset procedure. When set to TRUE, the procedure will cont
</chipEcFeature>
</attribute>
+ <attribute>
+ <id>ATTR_CENTAUR_EC_USE_FIRST_SUPPLIER_FOR_INVALID_MODULE_ID</id>
+ <targetType>TARGET_TYPE_MEMBUF_CHIP</targetType>
+ <description>
+ The getMBvpdSlopeInterceptData Attribute Accessor returns power data from the MW (master) and MV (supplier) Centaur DIMM VPD.
+ For MV attributes, the Attribute Accessor finds the Manufacturer-ID from JEDEC SPD (#I) and then matches it to a Supplier-ID in the array of supplier entries in the MV field .
+ For Centaur DD 1.X chips, the Manufacturer-ID may be invalid.
+The getMBvpdSlopeInterceptData Attribute Accessor, if it does not find a matching Supplier-ID in MV, will return the data for the first supplier on Centaur DD 1.X chips.
+ This is true for Centaur 1.*
+ </description>
+ <chipEcFeature>
+ <chip>
+ <name>ENUM_ATTR_NAME_CENTAUR</name>
+ <ec>
+ <value>0x20</value>
+ <test>LESS_THAN</test>
+ </ec>
+ </chip>
+ </chipEcFeature>
+ </attribute>
+
</attributes>
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C
index 5693581e2..f2b2e06ef 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: getMBvpdSlopeInterceptData.C,v 1.2 2013/07/19 18:41:09 whs Exp $
+// $Id: getMBvpdSlopeInterceptData.C,v 1.3 2013/11/22 22:14:11 whs Exp $
/**
* @file getMBvpdSlopeInterceptData.C
*
@@ -82,7 +82,7 @@ fapi::ReturnCode getMBvpdSlopeInterceptData(
case SUPPLIER_POWER_INTERCEPT:
l_fapirc = getMBvpdSupplierData(i_mbTarget, i_attr, o_val);
break;
- default: // Hard to do, but needs to be caught
+ default: // Unlikely, but needs to be caught
FAPI_ERR("getMBvpdSlopeInterceptData: invalid attribute ID 0x%02x",
i_attr);
const fapi::MBvpdSlopeIntercept & ATTR_ID = i_attr;
@@ -191,13 +191,34 @@ fapi::ReturnCode getMBvpdSupplierData(
{
//#I keyword layout
- const uint32_t PDI_KEYWORD_SIZE = 256;
+ const uint32_t PDI_DDR3_KEYWORD_SIZE = 256;
+ const uint32_t PDI_DDR4_KEYWORD_SIZE = 512; // assumed size for DDR4
+ const uint8_t SPD_DDR3 = 0xB;
+ const uint8_t SPD_DDR4 = 0xC;
struct pdI_keyword
{
- uint8_t filler1[117]; // other fields and reserved bytes
- uint8_t moduleID_MSB; // at offset 117. Big endian order
- uint8_t moduleID_LSB; // VPD data CCIN_31E1_v.5.3.ods
- uint8_t filler2[PDI_KEYWORD_SIZE-117-2]; // trailing space
+ union
+ {
+ struct // common
+ {
+ uint8_t filler1[2];
+ uint8_t mem_type;
+ } common;
+ struct // DDR3 layout of #I
+ {
+ uint8_t filler1[117]; // other fields and reserved bytes
+ uint8_t moduleID_MSB; // at offset 117. Big endian order
+ uint8_t moduleID_LSB; // VPD data CCIN_31E1_v.5.3.ods
+ uint8_t filler2[PDI_DDR3_KEYWORD_SIZE-117-2]; //trailing space
+ } ddr3;
+ struct // DDR4 layout of #I
+ {
+ uint8_t filler1[320]; // other fields and reserved bytes
+ uint8_t moduleID_MSB; // at offset 320. Big endian order
+ uint8_t moduleID_LSB; //
+ uint8_t filler2[PDI_DDR4_KEYWORD_SIZE-320-2]; //trailing space
+ } ddr4;
+ } pdI;
};
//MV keyword layout
@@ -211,7 +232,7 @@ fapi::ReturnCode getMBvpdSupplierData(
uint8_t supplierPowerIntercept_LSB;
uint8_t reserved[4];
};
- struct mv_keyword //variable length
+ struct mv_keyword //variable length. Structure is size of 1 entry.
{
uint8_t version;
uint8_t numEntries;
@@ -246,21 +267,58 @@ fapi::ReturnCode getMBvpdSupplierData(
break; // break out with fapirc
}
- // Check that sufficient #I was returned.
- if (l_pdIBufsize < PDI_KEYWORD_SIZE )
+ FAPI_DBG("getMBvpdSupplierData: #I mem type=0x%02x ",
+ l_pPdIBuffer->pdI.common.mem_type);
+
+ // check for DDR3 or DDR4
+ if (SPD_DDR3 == l_pPdIBuffer->pdI.common.mem_type )
+ {
+ // Check that sufficient #I was returned.
+ if (l_pdIBufsize < PDI_DDR3_KEYWORD_SIZE )
+ {
+ FAPI_ERR("getMBvpdSupplierData:"
+ " less DDR3 #I keyword returned than expected %d < %d",
+ l_pdIBufsize, PDI_DDR3_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
+ l_moduleID_LSB = l_pPdIBuffer->pdI.ddr3.moduleID_LSB;
+ l_moduleID_MSB = l_pPdIBuffer->pdI.ddr3.moduleID_MSB;
+ }
+ else if (SPD_DDR4 == l_pPdIBuffer->pdI.common.mem_type )
+ {
+ // Check that sufficient #I was returned.
+ if (l_pdIBufsize < PDI_DDR4_KEYWORD_SIZE )
+ {
+ FAPI_ERR("getMBvpdSupplierData:"
+ " less DDR4 #I keyword returned than expected %d < %d",
+ l_pdIBufsize, PDI_DDR4_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
+ l_moduleID_LSB = l_pPdIBuffer->pdI.ddr4.moduleID_LSB;
+ l_moduleID_MSB = l_pPdIBuffer->pdI.ddr4.moduleID_MSB;
+ }
+ else
{
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 );
+ " unexpected memory type in #I");
+ const uint8_t & MEM_TYPE = l_pPdIBuffer->pdI.common.mem_type;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_UNEXPECTED_MEM_TYPE);
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;
+ // Done with #I buffer. Error paths free buffer at end.
+ delete l_pPdIBuffer;
+ l_pPdIBuffer = NULL;
FAPI_DBG("getMBvpdSupplierData: #I moduleID=0x%08x ",
l_moduleID_LSB+(l_moduleID_MSB<<8));
@@ -329,6 +387,32 @@ fapi::ReturnCode getMBvpdSupplierData(
l_pVendorInfo++;
}
+ // If not found, see if first supplier should be used
+ // and there is one (unlikely that there is not one).
+ if ( ! l_found &&
+ 0 < l_pMvBuffer->numEntries &&
+ sizeof (mv_keyword) <= l_mvBufsize)
+ {
+ uint8_t l_checkUseFirstSupplier = 0;
+ l_fapirc = FAPI_ATTR_GET(
+ ATTR_CENTAUR_EC_USE_FIRST_SUPPLIER_FOR_INVALID_MODULE_ID,
+ &i_mbTarget,
+ l_checkUseFirstSupplier);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdSupplierData:"
+ " get attr use first supplier failed");
+ break; // break out with fapirc
+ }
+ FAPI_DBG("getMBvpdSupplierData: attr use first supplier = 0x%02x",
+ l_checkUseFirstSupplier);
+ if ( l_checkUseFirstSupplier)
+ {
+ l_pVendorInfo = &(l_pMvBuffer->firstVendorInfo);
+ l_found = true;
+ }
+ }
+
// Return requested value if found
if ( l_found )
{
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
index 69cebc849..d8f4ea9ea 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
+++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
@@ -20,7 +20,7 @@
<!-- Origin: 30 -->
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
-<!-- $Id: mvpd_errors.xml,v 1.11 2013/10/30 21:14:03 whs Exp $ -->
+<!-- $Id: mvpd_errors.xml,v 1.13 2013/11/22 22:14:37 whs Exp $ -->
<hwpErrors>
<!-- ********************************************************************* -->
<hwpError>
@@ -141,4 +141,12 @@
<ffdc>PORT0</ffdc>
<ffdc>PORT1</ffdc>
</hwpError>
+ <!-- ********************************************************************* -->
+ <hwpError>
+ <rc>RC_MBVPD_UNEXPECTED_MEM_TYPE</rc>
+ <description>
+ Memory type in VSPD keyword #I not DDR3 or DDR4
+ </description>
+ <ffdc>MEM_TYPE</ffdc>
+ </hwpError>
</hwpErrors>
OpenPOWER on IntegriCloud