diff options
author | Sumit Kumar <sumit_kumar@in.ibm.com> | 2018-07-12 06:25:50 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2018-07-20 13:28:28 -0500 |
commit | 8af690ede64b2f7e99c7c315819d6082a17e1204 (patch) | |
tree | a40ac2462b3c40afb4d7e2a1ba8dab0c8569746b /src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H | |
parent | cdf4b35b7d63847fa607395596a7eee1b6cc54fc (diff) | |
download | talos-hostboot-8af690ede64b2f7e99c7c315819d6082a17e1204.tar.gz talos-hostboot-8af690ede64b2f7e99c7c315819d6082a17e1204.zip |
eRepair: Fixed DMI/MemBuf lanes update in vpd
- Fixed addition of new lanes record in vpd
- Fixed to pick right mem buf size for mem buf target
- Fixed null target returned from determineRepairLanesDMI
- Added code to get serial number of chip to verify record in vpd
- Added more traces
Change-Id: I261f3e65bb9b0f6a75ddd203dfbb2b0560992a52
CQ:SW435969
CQ:SW436010
CQ:SW438169
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62295
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62301
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: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H')
-rwxr-xr-x | src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H | 173 |
1 files changed, 160 insertions, 13 deletions
diff --git a/src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H b/src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H index 9d82c08e3..aa4fe80e1 100755 --- a/src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H +++ b/src/import/chips/p9/procedures/hwp/io/p9_io_erepairGetFailedLanesHwp.H @@ -124,7 +124,7 @@ fapi2::ReturnCode decodeFailedLanes( uint8_t maxBusLanes = 0; uint32_t checkBitPosition = (0x80000000); - FAPI_DBG(">> decodeFailedLanes"); + FAPI_INF(">> decodeFailedLanes - IF:0x%x FailBit:%d ", i_busInterface, i_failBit); // Check for target type and corresponding sub interface // to get max lanes supported per interface @@ -153,7 +153,7 @@ fapi2::ReturnCode decodeFailedLanes( //Check for all the failed bit SET in the bit stream and update the vector //And print the failed lanes - FAPI_INF("No. of Failed Lanes:"); + FAPI_INF("decodeFailedLanes: No. of Failed Lanes:"); for( loop = 0; loop < maxBusLanes; @@ -210,7 +210,7 @@ fapi2::ReturnCode determineRepairLanesProc( bool l_bClkGroupFound = false; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; - FAPI_DBG(">> determineRepairLanesProc"); + FAPI_INF(">> determineRepairLanesProc - BufSize:%d ", i_bufSz); // Get the parent chip target l_chipTarget = i_target.template getParent<fapi2::TARGET_TYPE_PROC_CHIP>(); @@ -239,11 +239,14 @@ fapi2::ReturnCode determineRepairLanesProc( l_loop < l_numRepairs; l_loop++, (l_vpdPtr += l_fabricRepairDataSz)) { + FAPI_INF("Loop data:Numrepair:%d Bytesparse:%d ", l_numRepairs, l_bytesParsed); + // Make sure we are not parsing more data than the passed size l_bytesParsed += l_fabricRepairDataSz; if(l_bytesParsed > i_bufSz) { + FAPI_INF("Size:Byteparsed:%d BufSize:%d ", l_bytesParsed, i_bufSz); break; } @@ -268,6 +271,8 @@ fapi2::ReturnCode determineRepairLanesProc( // continue; //} + FAPI_INF("Type:%d IF:%d ", l_fabricBus->type, l_fabricBus->interface); + if(l_fabricBus->type != EREPAIR::PROCESSOR_EDIP) { continue; @@ -278,6 +283,8 @@ fapi2::ReturnCode determineRepairLanesProc( i_target, l_busNum)); + FAPI_INF("Channel:%d BusNum:%d ", l_fabricBus->device.fabricBus, l_busNum); + if(l_fabricBus->device.fabricBus != l_busNum) { continue; @@ -291,6 +298,8 @@ fapi2::ReturnCode determineRepairLanesProc( } // Copy the fail lane numbers in the vectors + FAPI_INF("Decode:IF:0x%x FailBit:%d ", l_fabricBus->interface, l_fabricBus->failBit); + if(l_fabricBus->interface == EREPAIR::PBUS_DRIVER) { decodeFailedLanes(i_target, l_fabricBus->interface, @@ -349,7 +358,7 @@ fapi2::ReturnCode determineRepairLanesMemBuf( fapi2::ATTR_CHIP_UNIT_POS_Type l_busNum; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; - FAPI_DBG(">> determineRepairLanesMemBuf"); + FAPI_INF(">> determineRepairLanesMemBuf - BufSize:%d ", i_bufSz); // Get the chip position uint32_t l_chipPosition; @@ -385,11 +394,14 @@ fapi2::ReturnCode determineRepairLanesMemBuf( l_loop < l_numRepairs; l_loop++, (l_vpdPtr += l_memRepairDataSz)) { + FAPI_INF("Loop data:Numrepair:%d Bytesparse:%d ", l_numRepairs, l_bytesParsed); + // Make sure we are not parsing more data than the passed size l_bytesParsed += l_memRepairDataSz; if(l_bytesParsed > i_bufSz) { + FAPI_INF("Size:Byteparsed:%d BufSize:%d ", l_bytesParsed, i_bufSz); break; } @@ -414,9 +426,12 @@ fapi2::ReturnCode determineRepairLanesMemBuf( if((l_customDimm != fapi2::ENUM_ATTR_CEN_SPD_CUSTOM_YES) && (l_chipPosition != l_memBus->device.proc_centaur_id)) { + FAPI_INF("DIMM:%d ChipPos:%d ", l_customDimm, l_chipPosition); continue; } + FAPI_INF("Type:%d IF:%d ", l_memBus->type, l_memBus->interface); + // Check if we have the matching the Memory Bus types if(l_memBus->type != EREPAIR::MEMORY_EDIP) { @@ -428,12 +443,15 @@ fapi2::ReturnCode determineRepairLanesMemBuf( l_dmiTarget, l_busNum)); + FAPI_INF("Channel:%d BusNum:%d ", l_memBus->device.memChannel, l_busNum); + if(l_memBus->device.memChannel != l_busNum) { continue; } // Copy the fail lane numbers in the vectors + FAPI_INF("Decode:IF:0x%x FailBit:%d ", l_memBus->interface, l_memBus->failBit); { if(l_memBus->interface == EREPAIR::DMI_MEMBUF_DRIVE) { @@ -489,13 +507,12 @@ fapi2::ReturnCode determineRepairLanesDMI( uint32_t l_loop = 0; uint32_t l_bytesParsed = 0; const uint32_t l_memRepairDataSz = sizeof(eRepairMemBus); - fapi2::Target<fapi2::TARGET_TYPE_DMI> l_dmiTarget; fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_chipTarget; fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS; fapi2::ATTR_CHIP_UNIT_POS_Type l_busNum; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; - FAPI_DBG(">> determineRepairLanesMemDMI"); + FAPI_INF(">> determineRepairLanesMemDMI - BufSize:%d ", i_bufSz); // Get the parent chip target l_chipTarget = i_target.template getParent<fapi2::TARGET_TYPE_PROC_CHIP>(); @@ -524,11 +541,14 @@ fapi2::ReturnCode determineRepairLanesDMI( l_loop < l_numRepairs; l_loop++, (l_vpdPtr += l_memRepairDataSz)) { + FAPI_INF("Loop data:Numrepair:%d Bytesparse:%d ", l_numRepairs, l_bytesParsed); + // Make sure we are not parsing more data than the passed size l_bytesParsed += l_memRepairDataSz; if(l_bytesParsed > i_bufSz) { + FAPI_INF("Size:Byteparsed:%d BufSize:%d ", l_bytesParsed, i_bufSz); break; } @@ -550,6 +570,8 @@ fapi2::ReturnCode determineRepairLanesDMI( // the Lane eRepair data for multiple Centaurs is maintained in // a common VPD. + FAPI_INF("Type:%d IF:%d ", l_memBus->type, l_memBus->interface); + // Check if we have the matching the Memory Bus types if(l_memBus->type != EREPAIR::MEMORY_EDIP) { @@ -558,15 +580,19 @@ fapi2::ReturnCode determineRepairLanesDMI( // Check if we have the matching memory bus interface FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, - l_dmiTarget, + i_target, l_busNum)); + FAPI_INF("Channel:%d BusNum:%d ", l_memBus->device.memChannel, l_busNum); + if(l_memBus->device.memChannel != l_busNum) { continue; } // Copy the fail lane numbers in the vectors + FAPI_INF("Decode:IF:0x%x FailBit:%d ", l_memBus->interface, l_memBus->failBit); + if(l_memBus->interface == EREPAIR::DMI_MCS_DRIVE) { decodeFailedLanes(i_target, l_memBus->interface, @@ -617,7 +643,9 @@ fapi2::ReturnCode retrieveRepairDataProc( fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; uint8_t* l_retBuf = NULL; + uint8_t* l_serialBuf = NULL; uint32_t l_bufSize = 0; + uint32_t l_serialNum = 0; fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_procTarget; FAPI_DBG(">> retrieveRepairDataProc"); @@ -633,6 +661,42 @@ fapi2::ReturnCode retrieveRepairDataProc( l_vpdRecord = fapi2::MVPD_RECORD_MER0; } + // Determine the serial number to uniquely identify the proc + FAPI_TRY( getMvpdField( + fapi2::MVPD_RECORD_VINI, + fapi2::MVPD_KEYWORD_SN, + l_procTarget, + NULL, + l_serialNum), + "Serial number size read failed w/rc=0x%x", + (uint64_t)fapi2::current_err ); + + FAPI_INF("Serial number size:0x%08x ", l_serialNum); + + if( l_serialNum ) + { + // Allocate memory for buffer + l_serialBuf = new uint8_t[l_serialNum]; + + // Retrieve the serial number data from the MVPD + FAPI_TRY( getMvpdField( + fapi2::MVPD_RECORD_VINI, + fapi2::MVPD_KEYWORD_SN, + l_procTarget, + l_serialBuf, + l_serialNum), + "Serial number read failed w/rc=0x%x", + (uint64_t)fapi2::current_err ); + + FAPI_INF("Serial Number: "); + + for(uint32_t i = 0; i < l_serialNum; i++) + { + FAPI_INF("%02x ", *(l_serialBuf + i)); + } + } + + // Determine the size of the eRepair data in the VPD FAPI_TRY( getMvpdField( l_vpdRecord, @@ -643,6 +707,8 @@ fapi2::ReturnCode retrieveRepairDataProc( "VPD size read failed w/rc=0x%x", (uint64_t)fapi2::current_err ); + FAPI_INF("retrieveRepairDataProc:VPD data:RC:0x%x KW:0x%x BS:%d ", l_vpdRecord, fapi2::MVPD_KEYWORD_PDI, l_bufSize); + if((l_bufSize == 0) || ((i_vpdType == EREPAIR::EREPAIR_VPD_FIELD) && (l_bufSize > EREPAIR::EREPAIR_P9_MODULE_VPD_FIELD_SIZE)) || @@ -683,12 +749,13 @@ fapi2::ReturnCode retrieveRepairDataProc( i_clkGroup, o_txFailLanes, o_rxFailLanes), - "Call to determineRepairLanes failed w/rc=0x%x", + "Call to determineRepairLanesProc failed w/rc=0x%x", (uint64_t)fapi2::current_err ); } // Delete the buffer which has Field eRepair data delete[] l_retBuf; + delete[] l_serialBuf; FAPI_DBG("<< retrieveRepairDataProc"); @@ -724,6 +791,8 @@ fapi2::ReturnCode retrieveRepairDataMemBuf( fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; uint8_t* l_retBuf = NULL; + uint8_t* l_serialBuf = NULL; + size_t l_serialNum = 0; size_t l_bufSize = 0; uint8_t l_customDimm; @@ -737,6 +806,41 @@ fapi2::ReturnCode retrieveRepairDataMemBuf( l_vpdRecord = fapi2::MBVPD_RECORD_MER0; } + // Determine the serial number to uniquely identify centaur vpd + FAPI_TRY( getMBvpdField( + fapi2::MBVPD_RECORD_VINI, + fapi2::MBVPD_KEYWORD_SN, + i_target, + NULL, + l_serialNum), + "Serial number size read failed w/rc=0x%x", + (uint64_t)fapi2::current_err ); + + FAPI_INF("Serial number size:0x%08x ", l_serialNum); + + if( l_serialNum ) + { + // Allocate memory for buffer + l_serialBuf = new uint8_t[l_serialNum]; + + // Retrieve the serial number data from the MVPD + FAPI_TRY( getMBvpdField( + fapi2::MBVPD_RECORD_VINI, + fapi2::MBVPD_KEYWORD_SN, + i_target, + l_serialBuf, + l_serialNum), + "Serial number read failed w/rc=0x%x", + (uint64_t)fapi2::current_err ); + + FAPI_INF("Serial Number: "); + + for(size_t i = 0; i < l_serialNum; i++) + { + FAPI_INF("%02x ", *(l_serialBuf + i)); + } + } + // Determine the size of the eRepair data in the VPD FAPI_TRY( getMBvpdField( l_vpdRecord, @@ -747,6 +851,8 @@ fapi2::ReturnCode retrieveRepairDataMemBuf( "VPD size read failed w/rc=0x%x", (uint64_t)fapi2::current_err ); + FAPI_INF("retrieveRepairDataMemBuf:VPD data:RC:0x%x KW:0x%x BS:%d ", l_vpdRecord, fapi2::MBVPD_KEYWORD_PDI, l_bufSize); + // Check whether we have Memory on a CDIMM l_rc = getDimmType(i_target, l_customDimm); @@ -797,12 +903,13 @@ fapi2::ReturnCode retrieveRepairDataMemBuf( l_bufSize, o_txFailLanes, o_rxFailLanes), - "Call to determineRepairLanes failed w/rc=0x%x", + "Call to determineRepairLanesMemBuf failed w/rc=0x%x", (uint64_t)fapi2::current_err ); } // Delete the buffer which has Field eRepair data delete[] l_retBuf; + delete[] l_serialBuf; FAPI_DBG("<< retrieveRepairDataMemBuf"); @@ -838,7 +945,9 @@ fapi2::ReturnCode retrieveRepairDataDMI( fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; uint8_t* l_retBuf = NULL; + uint8_t* l_serialBuf = NULL; uint32_t l_bufSize = 0; + uint32_t l_serialNum = 0; fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_procTarget; FAPI_DBG(">> retrieveRepairDataDMI"); @@ -854,6 +963,41 @@ fapi2::ReturnCode retrieveRepairDataDMI( l_vpdRecord = fapi2::MVPD_RECORD_MER0; } + // Determine the serial number to uniquely identify the proc + FAPI_TRY( getMvpdField( + fapi2::MVPD_RECORD_VINI, + fapi2::MVPD_KEYWORD_SN, + l_procTarget, + NULL, + l_serialNum), + "Serial number size read failed w/rc=0x%x", + (uint64_t)fapi2::current_err ); + + FAPI_INF("Serial number size:0x%08x ", l_serialNum); + + if( l_serialNum ) + { + // Allocate memory for buffer + l_serialBuf = new uint8_t[l_serialNum]; + + // Retrieve the serial number data from the MVPD + FAPI_TRY( getMvpdField( + fapi2::MVPD_RECORD_VINI, + fapi2::MVPD_KEYWORD_SN, + l_procTarget, + l_serialBuf, + l_serialNum), + "Serial number read failed w/rc=0x%x", + (uint64_t)fapi2::current_err ); + + FAPI_INF("Serial Number: "); + + for(uint32_t i = 0; i < l_serialNum; i++) + { + FAPI_INF("%02x ", *(l_serialBuf + i)); + } + } + // Determine the size of the eRepair data in the VPD FAPI_TRY( getMvpdField( l_vpdRecord, @@ -864,6 +1008,8 @@ fapi2::ReturnCode retrieveRepairDataDMI( "VPD size read failed w/rc=0x%x", (uint64_t)fapi2::current_err ); + FAPI_INF("retrieveRepairDataDMI:VPD data:RC:0x%x KW:0x%x BS:%d ", l_vpdRecord, fapi2::MVPD_KEYWORD_PDI, l_bufSize); + if((l_bufSize == 0) || ((i_vpdType == EREPAIR::EREPAIR_VPD_FIELD) && (l_bufSize > EREPAIR::EREPAIR_P9_MODULE_VPD_FIELD_SIZE)) || @@ -903,12 +1049,13 @@ fapi2::ReturnCode retrieveRepairDataDMI( l_bufSize, o_txFailLanes, o_rxFailLanes), - "Call to determineRepairLanes failed w/rc=0x%x", + "Call to determineRepairLanesDMI failed w/rc=0x%x", (uint64_t)fapi2::current_err ); } // Delete the buffer which has Field eRepair data delete[] l_retBuf; + delete[] l_serialBuf; FAPI_DBG("<< retrieveRepairDataDMI"); @@ -953,7 +1100,7 @@ fapi2::ReturnCode p9_io_erepairGetFailedLanesHwp( i_clkGroup, o_txFailLanes, o_rxFailLanes), - "p9_io_erepairGetFailedLanesHwp() failed w/rc=0x%x", + "retrieveRepairDataProc() failed w/rc=0x%x", (uint64_t)fapi2::current_err ); fapi_try_exit: @@ -980,7 +1127,7 @@ fapi2::ReturnCode p9_io_erepairGetFailedLanesHwp( i_vpdType, o_txFailLanes, o_rxFailLanes), - "p9_io_erepairGetFailedLanesHwp() failed w/rc=0x%x", + "retrieveRepairDataMemBuf() failed w/rc=0x%x", (uint64_t)fapi2::current_err ); fapi_try_exit: @@ -1007,7 +1154,7 @@ fapi2::ReturnCode p9_io_erepairGetFailedLanesHwp( i_vpdType, o_txFailLanes, o_rxFailLanes), - "p9_io_erepairGetFailedLanesHwp() failed w/rc=0x%x", + "retrieveRepairDataDMI() failed w/rc=0x%x", (uint64_t)fapi2::current_err ); fapi_try_exit: |