diff options
author | Thi Tran <thi@us.ibm.com> | 2015-08-18 14:56:45 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-08-28 17:39:41 -0500 |
commit | 4cf927e07a771572d562230951a25ccdc4f3299a (patch) | |
tree | 9d5260bc83455e42e0b26753cfefb190f28b772f /src/usr/vpd | |
parent | 5eb573aefeda341cf272f70cfd18cfaa24dfe414 (diff) | |
download | talos-hostboot-4cf927e07a771572d562230951a25ccdc4f3299a.tar.gz talos-hostboot-4cf927e07a771572d562230951a25ccdc4f3299a.zip |
Add method to erase SPD on all dimms via attribute override
Change-Id: I3fb0759ef99b427cb043badddc1c3fd2afe1ae62
RTC: 132714
Depends-on: I4c74d3a6d5d900967b6add4e9edc7fa286e93a64
Depends-on: I04e83ee2a38a5be3b17fd5578709ed5b64127b83
Depends-on: I31c015962f39342d0d1d9d575fd0c4569496918c
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19891
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: MATTHEW A. PLOETZ <maploetz@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/vpd')
-rwxr-xr-x | src/usr/vpd/dimmPres.C | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/usr/vpd/dimmPres.C b/src/usr/vpd/dimmPres.C index cc7d19255..8c54eca75 100755 --- a/src/usr/vpd/dimmPres.C +++ b/src/usr/vpd/dimmPres.C @@ -212,7 +212,58 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType, { //populate serial and part number attributes SPD::setPartAndSerialNumberAttributes( i_target ); + } + + // Read ATTR_CLEAR_DIMM_SPD_ENABLE attribute + TARGETING::Target* l_sys = NULL; + TARGETING::targetService().getTopLevelTarget(l_sys); + + TARGETING::ATTR_CLEAR_DIMM_SPD_ENABLE_type l_clearSPD = + l_sys->getAttr<TARGETING::ATTR_CLEAR_DIMM_SPD_ENABLE>(); + + // If SPD clear is enabled then write 0's into magic word for + // DIMM_BAD_DQ_DATA keyword + // Note: If there's an error from performing the clearing, + // just log the error and continue. + if (l_clearSPD) + { + size_t l_size = 0; + + // Do a read to get the DIMM_BAD_DQ_DATA keyword size + err = deviceRead(i_target, NULL, l_size, + DEVICE_SPD_ADDRESS( DIMM_BAD_DQ_DATA )); + if (err) + { + TRACFCOMP(g_trac_spd, "dimmPresenceDetect - " + "Error reading DIMM_BAD_DQ_DATA keyword size"); + errlCommit( err, VPD_COMP_ID ); + } + else + { + // Clear the data + TRACFCOMP( g_trac_spd, "Clearing out BAD_DQ_DATA SPD on " + "DIMM HUID 0x%X", + TARGETING::get_huid(i_target)); + + uint8_t * l_data = static_cast<uint8_t*>(malloc( l_size )); + memset(l_data, 0, l_size); + + err = deviceWrite(i_target, l_data, l_size, + DEVICE_SPD_ADDRESS( DIMM_BAD_DQ_DATA )); + if (err) + { + TRACFCOMP( g_trac_spd, "Error trying to clear SPD on " + "DIMM HUID 0x%X", + TARGETING::get_huid(i_target)); + errlCommit( err, VPD_COMP_ID ); + } + // Free the memory + if (NULL != l_data) + { + free(l_data); + } + } } } |