summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/attribute_service.C
diff options
context:
space:
mode:
authorCaleb Palmer <cnpalmer@us.ibm.com>2018-02-08 16:48:22 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2018-02-12 13:55:19 -0500
commitb94740d309319dae501086a7abbdd27f9a65f94e (patch)
tree429af6bb52acadeb9162c450604ba987955b9620 /src/usr/fapi2/attribute_service.C
parent4648dad462fddbd4e4bd829b04b1a7090be409b5 (diff)
downloadtalos-hostboot-b94740d309319dae501086a7abbdd27f9a65f94e.tar.gz
talos-hostboot-b94740d309319dae501086a7abbdd27f9a65f94e.zip
Bad dq bitmap vpd write fixes
Change-Id: I4fa184b35b5d28feb837c3fa5b72b667c184877f CQ: SW414262 Backport: release-fips910 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53676 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/attribute_service.C')
-rw-r--r--src/usr/fapi2/attribute_service.C28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C
index cfd922596..8789e47a4 100644
--- a/src/usr/fapi2/attribute_service.C
+++ b/src/usr/fapi2/attribute_service.C
@@ -549,6 +549,7 @@ struct dimmBadDqDataFormat
uint8_t iv_reserved2;
uint8_t iv_reserved3;
uint8_t iv_bitmaps[mss::MAX_RANK_PER_DIMM][mss::BAD_DQ_BYTE_COUNT];
+ uint8_t iv_unused[32];
};
// constant definitions
@@ -956,7 +957,7 @@ ReturnCode __compareEccAndSpare(TARGETING::TargetHandle_t i_dimm,
ReturnCode __mcLogicalToDimmDqHelper(
const Target<TARGET_TYPE_ALL>& i_fapiDimm,
uint8_t i_wiringData[mss::PORTS_PER_MCS][mss::MAX_DQ_BITS],
- uint32_t i_ps, uint8_t i_mcPin, uint8_t o_dimm_dq )
+ uint32_t i_ps, uint8_t i_mcPin, uint8_t &o_dimm_dq )
{
fapi2::ReturnCode l_rc;
@@ -1087,7 +1088,7 @@ ReturnCode __mcLogicalToDimmDq( const Target<TARGET_TYPE_ALL>& i_fapiDimm,
ReturnCode __dimmDqToMcLogicalHelper(
const Target<TARGET_TYPE_ALL>& i_fapiDimm,
uint8_t i_wiringData[mss::PORTS_PER_MCS][mss::MAX_DQ_BITS],
- uint32_t i_ps, uint8_t i_dimm_dq, uint64_t o_mcPin )
+ uint32_t i_ps, uint8_t i_dimm_dq, uint64_t &o_mcPin )
{
fapi2::ReturnCode l_rc;
uint64_t l_c4 = 0;
@@ -1174,7 +1175,7 @@ ReturnCode __dimmDqToMcLogical( const Target<TARGET_TYPE_ALL>& i_fapiDimm,
{
// get the pin/bit position in DIMM DQ format
uint8_t l_dimm_dq = (byte*8) + bit; // pin 0-79
- uint8_t l_mcPin = 0;
+ uint64_t l_mcPin = 0;
// translate the DIMM DQ pin to MC Logical format
l_rc = __dimmDqToMcLogicalHelper( i_fapiDimm,
@@ -1483,6 +1484,27 @@ ReturnCode fapiAttrSetBadDqBitmap(
l_spdData.iv_reserved3 = 0;
memset( l_spdData.iv_bitmaps, 0, sizeof(l_spdData.iv_bitmaps) );
+ // We need to make sure the rest of the data in VPD beyond the bad dq
+ // bitmap is unchanged.
+ uint8_t * l_badDqData =
+ static_cast<uint8_t*>( malloc(DIMM_BAD_DQ_SIZE_BYTES) );
+
+ l_errl = deviceRead(l_dimmTarget, l_badDqData,
+ DIMM_BAD_DQ_SIZE_BYTES,
+ DEVICE_SPD_ADDRESS(SPD::DIMM_BAD_DQ_DATA));
+ if ( l_errl )
+ {
+ FAPI_ERR( "fapiAttrSetBadDqBitmap: Failed to read DIMM Bad DQ "
+ "data." );
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break;
+ }
+
+ dimmBadDqDataFormat l_prevSpdData;
+ memcpy( &l_prevSpdData, l_badDqData, sizeof(dimmBadDqDataFormat) );
+ memcpy( &l_spdData.iv_unused, l_prevSpdData.iv_unused,
+ sizeof(l_spdData.iv_unused) );
+
// Get the spare byte
uint8_t spareByte[mss::MAX_RANK_PER_DIMM];
memset( spareByte, 0, sizeof(spareByte) );
OpenPOWER on IntegriCloud