diff options
-rw-r--r-- | src/include/usr/fsi/fsi_reasoncodes.H | 1 | ||||
-rw-r--r-- | src/include/usr/fsi/fsiif.H | 7 | ||||
-rw-r--r-- | src/include/usr/ibscom/ibscomreasoncodes.H | 1 | ||||
-rw-r--r-- | src/makefile | 3 | ||||
-rw-r--r-- | src/usr/fsi/fsidd.C | 359 | ||||
-rw-r--r-- | src/usr/fsi/fsipres.C | 4 | ||||
-rw-r--r-- | src/usr/fsi/test/fsiddtest.H | 46 | ||||
-rw-r--r-- | src/usr/fsiscom/fsiscom.C | 140 | ||||
-rw-r--r-- | src/usr/fsiscom/fsiscom.H | 62 | ||||
-rw-r--r-- | src/usr/fsiscom/test/fsiscomtest.H | 133 | ||||
-rw-r--r-- | src/usr/fsiscom/test/makefile | 32 | ||||
-rw-r--r-- | src/usr/ibscom/ibscom.C | 109 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 50 | ||||
-rw-r--r-- | src/usr/xscom/piberror.C | 3 | ||||
-rw-r--r-- | src/usr/xscom/xscom.C | 2 |
15 files changed, 604 insertions, 348 deletions
diff --git a/src/include/usr/fsi/fsi_reasoncodes.H b/src/include/usr/fsi/fsi_reasoncodes.H index 49cddda9d..7e469af42 100644 --- a/src/include/usr/fsi/fsi_reasoncodes.H +++ b/src/include/usr/fsi/fsi_reasoncodes.H @@ -45,6 +45,7 @@ namespace FSI enum FSIReasonCode { + RC_BAD_REASONCODE = FSI_COMP_ID | 0x00, RC_INVALID_LENGTH = FSI_COMP_ID | 0x01, RC_INVALID_ADDRESS = FSI_COMP_ID | 0x02, RC_OPB_TIMEOUT = FSI_COMP_ID | 0x03, diff --git a/src/include/usr/fsi/fsiif.H b/src/include/usr/fsi/fsiif.H index e355ebd98..f6cd8dcb9 100644 --- a/src/include/usr/fsi/fsiif.H +++ b/src/include/usr/fsi/fsiif.H @@ -67,8 +67,9 @@ bool isSlavePresent( TARGETING::Target* i_target ); */ enum fsiFFDCType_t { - FSI_FFDC_PRESENCE_FAIL = 0, - FSI_FFDC_READWRITE_FAIL, + FFDC_PRESENCE_FAIL = 0, + FFDC_READWRITE_FAIL = 1, + FFDC_PIB_FAIL = 2 }; /** @@ -107,6 +108,8 @@ enum SlaveRegistersP8 }; +// Trace buffer for FSI Register read/writes +#define FSIR_TRACE_BUF "FSIR" } diff --git a/src/include/usr/ibscom/ibscomreasoncodes.H b/src/include/usr/ibscom/ibscomreasoncodes.H index 011660859..2990cc56b 100644 --- a/src/include/usr/ibscom/ibscomreasoncodes.H +++ b/src/include/usr/ibscom/ibscomreasoncodes.H @@ -45,6 +45,7 @@ namespace IBSCOM IBSCOM_SUE_IN_ERR_PATH = IBSCOM_COMP_ID | 0x05, IBSCOM_BUS_FAILURE = IBSCOM_COMP_ID | 0x06, IBSCOM_INVALID_ADDRESS = IBSCOM_COMP_ID | 0x07, + IBSCOM_PIB_FAILURE = IBSCOM_COMP_ID | 0x08, }; }; diff --git a/src/makefile b/src/makefile index c803d941d..1a8a81ec7 100644 --- a/src/makefile +++ b/src/makefile @@ -65,7 +65,8 @@ TESTCASE_MODULES = cxxtest testtrace testerrl testdevicefw testsyslib \ testhwpf testecmddatabuffer initsvctesttask testcxxtest \ testpnor testi2c testfsi testvfs testhwas testintr testvpd \ testpore testutil testmbox testmdia testprdf testattn \ - testscan testruntime testibscom testdump testsecureboot + testscan testruntime testibscom testdump testsecureboot \ + testfsiscom RELOCATABLE_IMAGE_LDFLAGS = -pie --export-dynamic diff --git a/src/usr/fsi/fsidd.C b/src/usr/fsi/fsidd.C index 3cf150d20..4413ed129 100644 --- a/src/usr/fsi/fsidd.C +++ b/src/usr/fsi/fsidd.C @@ -46,11 +46,11 @@ // FSI : General driver traces trace_desc_t* g_trac_fsi = NULL; -TRAC_INIT(&g_trac_fsi, "FSI", KILOBYTE); //1K +TRAC_INIT(&g_trac_fsi, FSI_COMP_NAME, KILOBYTE); //1K // FSIR : Register reads and writes (should always use TRACS) trace_desc_t* g_trac_fsir = NULL; -TRAC_INIT(&g_trac_fsir, "FSIR", KILOBYTE); //1K +TRAC_INIT(&g_trac_fsir, FSIR_TRACE_BUF, KILOBYTE); //1K // Easy macro replace for unit testing //#define TRACUCOMP(args...) TRACFCOMP(args) @@ -106,7 +106,7 @@ errlHndl_t ddOp(DeviceFW::OperationType i_opType, FSI::RC_INVALID_LENGTH, i_addr, TO_UINT64(io_buflen)); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); break; } @@ -130,7 +130,7 @@ errlHndl_t ddOp(DeviceFW::OperationType i_opType, FSI::RC_NULL_TARGET, i_addr, TO_UINT64(i_opType)); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); break; } // check target for sentinel @@ -150,7 +150,7 @@ errlHndl_t ddOp(DeviceFW::OperationType i_opType, FSI::RC_MASTER_TARGET, i_addr, TO_UINT64(i_opType)); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); break; } @@ -194,7 +194,7 @@ errlHndl_t ddOp(DeviceFW::OperationType i_opType, FSI::RC_INVALID_OPERATION, i_addr, TO_UINT64(i_opType)); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); break; } @@ -330,7 +330,7 @@ errlHndl_t FsiDD::read(TARGETING::Target* i_target, TWO_UINT32_TO_UINT64( TARGETING::get_huid(i_target), TARGETING::get_huid(iv_master))); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); break; } @@ -385,7 +385,7 @@ errlHndl_t FsiDD::write(TARGETING::Target* i_target, TWO_UINT32_TO_UINT64( TARGETING::get_huid(i_target), TARGETING::get_huid(iv_master))); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); break; } @@ -409,149 +409,6 @@ errlHndl_t FsiDD::write(TARGETING::Target* i_target, } -/** - * @brief Add FFDC for the target to an error log - */ -void FsiDD::getFsiFFDC(FSI::fsiFFDCType_t i_ffdc_type, errlHndl_t &io_log, - TARGETING::Target* i_target) -{ - TRACDCOMP( g_trac_fsi, "FSI::getFFDC>" ); - - // Local Variables - uint8_t * l_data_ptr = NULL; - uint32_t l_ffdc_byte_len = 0; - bool i_merge = false; - uint64_t l_slaveEnableIndex=0; - uint64_t l_byte_index = 0; - - // Check Type -- Not doing anything unique right now - if ( ! (i_ffdc_type == FSI::FSI_FFDC_PRESENCE_FAIL ) || - (i_ffdc_type == FSI::FSI_FFDC_READWRITE_FAIL) ) - { - // Unsupported FSI FFDC type, so don't add FFDC section - TRACFCOMP( g_trac_fsi, "FSI::getFFDC> Incorect i_ffdc_type (%d) " - "Not Adding FFDC section!", - i_ffdc_type); - - return; - } - - // Add target to error log - if (i_target != NULL) - { - ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(io_log); - } - - // Add Master Target to Log - if (iv_master != NULL) - { - ERRORLOG::ErrlUserDetailsTarget(iv_master).addToLog(io_log); - } - - // Information to capture - // 1) FsiChipInfo_t associated with this target - // 2) Size of iv_slaves[] - // 3) iv_slaves[] - // 4) uint64_t -- slave enable Index - l_ffdc_byte_len = sizeof(FsiChipInfo_t) + - sizeof(uint32_t) + - sizeof(iv_slaves) + - sizeof(uint64_t); - - l_data_ptr = static_cast<uint8_t*>(malloc(l_ffdc_byte_len)); - - - // Collect the data - FsiChipInfo_t l_fsi_chip_info = getFsiInfo(i_target); - - l_slaveEnableIndex = getSlaveEnableIndex (l_fsi_chip_info.master, - l_fsi_chip_info.type); - - - TRACFCOMP( g_trac_fsi, - "FSI::getFFDC> l_ffdc_byte_len =%d, l_data_ptr=%p," - " sizeof: FsiChipInfo_t=%d, iv_slaves=%d, u32=%d " - "u64=%d, l_slaveEnableIndex=0x%x", l_ffdc_byte_len, - l_data_ptr, sizeof(FsiChipInfo_t), sizeof(iv_slaves), - sizeof(uint32_t), sizeof(uint64_t), l_slaveEnableIndex); - - - // Copy Data into memory bloack - l_byte_index = 0; - - // FsiChipInfo_t - memcpy(reinterpret_cast<void*>(l_data_ptr + l_byte_index), - &l_fsi_chip_info, sizeof(FsiChipInfo_t)); - - l_byte_index += sizeof(FsiChipInfo_t); - - - // Size of iv_slaves[] - const uint32_t l_so_iv_slaves = sizeof(iv_slaves); - memcpy(reinterpret_cast<void*>(l_data_ptr + l_byte_index), - &l_so_iv_slaves, sizeof(uint32_t)); - - l_byte_index += sizeof(uint32_t); - - - // iv_slaves[] - memcpy(reinterpret_cast<void*>(l_data_ptr + l_byte_index), - &iv_slaves, sizeof(iv_slaves)); - - l_byte_index += sizeof(iv_slaves); - - - // getSlaveEnable Index - memcpy(reinterpret_cast<void*>(l_data_ptr + l_byte_index), - &l_slaveEnableIndex, sizeof(uint64_t)); - - l_byte_index += sizeof(uint64_t); - - - // Check we didn't go too far or too short - if (l_byte_index != l_ffdc_byte_len) - { - TRACFCOMP( g_trac_fsi, "FSI::getFFDC> Byte Length Mismatch: " - "Not Adding FFDC section!" - "l_byte_index=%d, l_ffdc_byte_len=%d", - l_byte_index, l_ffdc_byte_len); - - // Free malloc'ed memory - if (l_data_ptr != NULL) - { - free(l_data_ptr); - } - - return; - } - - // Actual call to log the data - ERRORLOG::ErrlUD * l_pUD = (io_log)->addFFDC(FSI_COMP_ID, - l_data_ptr, - l_ffdc_byte_len, - FsiFFDC_Ver1, - FsiFFDC_CapData_1, - i_merge); - - // Check for success - if (l_pUD == NULL) - { - // Failure to add FFDC section - TRACFCOMP( g_trac_fsi, "FSI::getFFDC> FAILURE TO ADD FFDC" ); - - // Add errl trace - (io_log)->collectTrace("ERR"); - } - else - { - TRACFCOMP( g_trac_fsi, "FSI::getFFDC> FFDC Successfully added " - "(%d bytes)", l_ffdc_byte_len ); - } - - return; - -} - /******************** Internal Methods @@ -772,6 +629,134 @@ errlHndl_t FsiDD::initializeHardware() return l_err; } +/** + * @brief Add FFDC for the target to an error log + */ +void FsiDD::getFsiFFDC(FSI::fsiFFDCType_t i_ffdc_type, + errlHndl_t &io_log, + TARGETING::Target* i_target) +{ + TRACDCOMP( g_trac_fsi, "FSI::getFFDC>" ); + + // Local Variables + uint8_t * i_data_ptr = NULL; + uint32_t i_ffdc_byte_len = 0; + bool i_merge = false; + uint64_t l_slaveEnableIndex=0; + uint64_t l_byte_index = 0; + + // Add target to error log + if (i_target != NULL) + { + ERRORLOG::ErrlUserDetailsTarget(i_target,"FSI Slave") + .addToLog(io_log); + } + + // Add Master Target to Log + if (iv_master != NULL) + { + ERRORLOG::ErrlUserDetailsTarget(iv_master,"FSI Master") + .addToLog(io_log); + } + + if( FSI::FFDC_PRESENCE_FAIL == i_ffdc_type ) + { + // Information to capture + // 1) FsiChipInfo_t associated with this target + // 2) Size of iv_slaves[] + // 3) iv_slaves[] + // 4) uint64_t -- slave enable Index + i_ffdc_byte_len = sizeof(FsiChipInfo_t) + + sizeof(uint32_t) + + sizeof(iv_slaves) + + sizeof(uint64_t); + + i_data_ptr = static_cast<uint8_t*>(malloc(i_ffdc_byte_len)); + + + // Collect the data + FsiChipInfo_t l_fsi_chip_info = getFsiInfo(i_target); + + l_slaveEnableIndex = getSlaveEnableIndex (l_fsi_chip_info.master, + l_fsi_chip_info.type); + + + TRACFCOMP( g_trac_fsi, + "FSI::getFFDC> i_ffdc_byte_len =%d, i_data_ptr=%p," + " sizeof: FsiChipInfo_t=%d, iv_slaves=%d, u32=%d " + "u64=%d, l_slaveEnableIndex=0x%x", i_ffdc_byte_len, + i_data_ptr, sizeof(FsiChipInfo_t), sizeof(iv_slaves), + sizeof(uint32_t), sizeof(uint64_t), l_slaveEnableIndex); + + + // Copy Data into memory block + l_byte_index = 0; + + // FsiChipInfo_t + memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index), + &l_fsi_chip_info, sizeof(FsiChipInfo_t)); + + l_byte_index += sizeof(FsiChipInfo_t); + + + // Size of iv_slaves[] + const uint32_t l_so_iv_slaves = sizeof(iv_slaves); + memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index), + &l_so_iv_slaves, sizeof(uint32_t)); + + l_byte_index += sizeof(uint32_t); + + + // iv_slaves[] + memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index), + &iv_slaves, sizeof(iv_slaves)); + + l_byte_index += sizeof(iv_slaves); + + + // getSlaveEnable Index + memcpy(reinterpret_cast<void*>(i_data_ptr + l_byte_index), + &l_slaveEnableIndex, sizeof(uint64_t)); + + l_byte_index += sizeof(uint64_t); + + // Actual call to log the data + ERRORLOG::ErrlUD * l_pUD = (io_log)->addFFDC(FSI_COMP_ID, + i_data_ptr, + i_ffdc_byte_len, + FsiFFDC_Ver1, + FsiFFDC_CapData_1, + i_merge); + + // Check for success + if (l_pUD == NULL) + { + // Failure to add FFDC section + TRACFCOMP( g_trac_fsi, "FSI::getFFDC> FAILURE TO ADD FFDC" ); + + // Add errl trace + (io_log)->collectTrace(ERRL_COMP_NAME); + } + else + { + TRACFCOMP( g_trac_fsi, "FSI::getFFDC> FFDC Successfully added " + "(%d bytes)", i_ffdc_byte_len ); + } + } + else if( FSI::FFDC_READWRITE_FAIL == i_ffdc_type ) + { + // No additional data for read/write fails yet + } + else if( FSI::FFDC_PIB_FAIL == i_ffdc_type ) + { + ERRORLOG::ErrlUserDetailsLogRegister regdata(iv_master); + regdata.addData(DEVICE_XSCOM_ADDRESS(0x00020001ull)); + regdata.addToLog(io_log); + } + + return; + +} /******************** Internal Methods @@ -1131,8 +1116,8 @@ errlHndl_t FsiDD::handleOpbErrors(FsiAddrInfo_t& i_addrInfo, // Add opbTarg to original error log ERRORLOG::ErrlUserDetailsTarget(i_addrInfo.opbTarg).addToLog(l_err); - l_err->collectTrace("FSI"); - l_err->collectTrace("FSIR"); + l_err->collectTrace(FSI_COMP_NAME); + l_err->collectTrace(FSIR_TRACE_BUF); //@todo - implement recovery and callout code (Story 35287) @@ -1191,9 +1176,57 @@ errlHndl_t FsiDD::pollForComplete(FsiAddrInfo_t& i_addrInfo, elapsed_time_ns += 10000; } while( elapsed_time_ns <= MAX_OPB_TIMEOUT_NS ); // hardware has 1ms limit if( l_err ) { break; } - TRACDCOMP(g_trac_fsi, - "FsiDD::pollForComplete> elapsed_time_ns=%d, Status=%.8X", - elapsed_time_ns,read_data[0]); + + // we should never timeout because the hardware should set an error + if( elapsed_time_ns > MAX_OPB_TIMEOUT_NS ) + { + TRACFCOMP( g_trac_fsi, "FsiDD::pollForComplete> Never got complete or error on OPB operation : absAddr=0x%X, OPB Status=0x%.8X", i_addrInfo.absAddr, read_data[0] ); + /*@ + * @errortype + * @moduleid FSI::MOD_FSIDD_POLLFORCOMPLETE + * @reasoncode FSI::RC_OPB_TIMEOUT + * @userdata1[0:31] Relative FSI Address + * @userdata1[32:63] Absolute FSI Address + * @userdata2 OPB Status Register + * @devdesc FsiDD::pollForComplete> Error during FSI access + */ + l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + FSI::MOD_FSIDD_POLLFORCOMPLETE, + FSI::RC_OPB_TIMEOUT, + TWO_UINT32_TO_UINT64( + i_addrInfo.relAddr, + i_addrInfo.absAddr), + TWO_UINT32_TO_UINT64( + read_data[0], + read_data[1]) ); + + // Save both targets in i_addrInfo to error log + ERRORLOG::ErrlUserDetailsTarget( + i_addrInfo.fsiTarg + ).addToLog(l_err); + ERRORLOG::ErrlUserDetailsTarget( + i_addrInfo.opbTarg + ).addToLog(l_err); + + // Read some error regs from scom + ERRORLOG::ErrlUserDetailsLogRegister + l_scom_data(i_addrInfo.opbTarg); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020000ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020001ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020002ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020005ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020006ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020007ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020008ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x00020009ull)); + l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x0002000Aull)); + l_scom_data.addToLog(l_err); + + l_err->collectTrace(FSI_COMP_NAME); + l_err->collectTrace(FSIR_TRACE_BUF); + + break; + } // check if we got an error from the OPB // (will also check for busy/timeout) @@ -1250,8 +1283,8 @@ errlHndl_t FsiDD::pollForComplete(FsiAddrInfo_t& i_addrInfo, l_scom_data.addData(DEVICE_XSCOM_ADDRESS(0x0002000Aull)); l_scom_data.addToLog(l_err); - l_err->collectTrace("FSI"); - l_err->collectTrace("FSIR"); + l_err->collectTrace(FSI_COMP_NAME); + l_err->collectTrace(FSIR_TRACE_BUF); break; } @@ -1314,7 +1347,7 @@ errlHndl_t FsiDD::genFullFsiAddr(FsiAddrInfo_t& io_addrInfo) FSI::RC_FSI_NOT_SUPPORTED, TARGETING::get_huid(io_addrInfo.fsiTarg), fsi_info.linkid.id ); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); return l_err; } //target is behind another proc @@ -1356,7 +1389,7 @@ errlHndl_t FsiDD::genFullFsiAddr(FsiAddrInfo_t& io_addrInfo) TWO_UINT32_TO_UINT64( fsi_info.linkid.id, mfsi_info.linkid.id) ); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); return l_err; } else if( TARGETING::FSI_MASTER_TYPE_MFSI != mfsi_info.type ) @@ -1389,7 +1422,7 @@ errlHndl_t FsiDD::genFullFsiAddr(FsiAddrInfo_t& io_addrInfo) TWO_UINT32_TO_UINT64( fsi_info.linkid.id, mfsi_info.linkid.id) ); - l_err->collectTrace("FSI",1024); + l_err->collectTrace(FSI_COMP_NAME); return l_err; } @@ -1553,8 +1586,8 @@ errlHndl_t FsiDD::initPort(FsiChipInfo_t i_fsiInfo, DEVICE_FSI_ADDRESS(master_ctl_reg|FSI_MESRB0_1D0)); l_scom_data.addToLog(l_err); - l_err->collectTrace("FSI"); - l_err->collectTrace("FSIR"); + l_err->collectTrace(FSI_COMP_NAME); + l_err->collectTrace(FSIR_TRACE_BUF); break; } diff --git a/src/usr/fsi/fsipres.C b/src/usr/fsi/fsipres.C index 26859196a..400f5aba0 100644 --- a/src/usr/fsi/fsipres.C +++ b/src/usr/fsi/fsipres.C @@ -200,7 +200,7 @@ errlHndl_t procPresenceDetect(DeviceFW::OperationType i_opType, } // Add FFDC for the target to an error log - getFsiFFDC( FSI_FFDC_PRESENCE_FAIL, l_errl, i_target); + getFsiFFDC( FFDC_PRESENCE_FAIL, l_errl, i_target); // Add FSI and VPD trace @@ -372,7 +372,7 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType, } // Add FFDC for the target to an error log - getFsiFFDC( FSI_FFDC_PRESENCE_FAIL, l_errl, i_target); + getFsiFFDC( FFDC_PRESENCE_FAIL, l_errl, i_target); // Add FSI and VPD trace l_errl->collectTrace("FSI"); diff --git a/src/usr/fsi/test/fsiddtest.H b/src/usr/fsi/test/fsiddtest.H index b1b103190..20f901e5c 100644 --- a/src/usr/fsi/test/fsiddtest.H +++ b/src/usr/fsi/test/fsiddtest.H @@ -38,6 +38,7 @@ #include <fsi/fsi_reasoncodes.H> #include <sys/time.h> #include <targeting/common/attributes.H> +#include <targeting/common/utilFilter.H> extern trace_desc_t* g_trac_fsi; @@ -461,6 +462,51 @@ class FsiDDTest : public CxxTest::TestSuite TRACFCOMP( g_trac_fsi, "FsiDDTest::test_badTargets> %d/%d fails", fails, total ); }; + /** + * @brief FSI DD test - FFDC Collection + * Verify FFDC for errors + */ + void test_FFDC(void) + { + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_FFDC> Start" ); + errlHndl_t l_err = NULL; + + // Find any Centaur target + TARGETING::TargetHandleList l_memTargetList; + getAllChips( l_memTargetList, TYPE_MEMBUF, true ); + if( l_memTargetList.empty() ) + { + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_FFDC> No Centaurs found..." ); + TS_FAIL( "FsiDDTest::test_FFDC> No Centaurs found..." ); + } + TARGETING::Target* fsi_target = *(l_memTargetList.begin()); + + l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + FSI::MOD_FSIDD_INVALID, + FSI::RC_BAD_REASONCODE, + TARGETING::get_huid(fsi_target), + FSI::FFDC_PRESENCE_FAIL); + FSI::getFsiFFDC( FSI::FFDC_PRESENCE_FAIL, l_err, fsi_target ); + errlCommit(l_err,CXXTEST_COMP_ID); + + l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + FSI::MOD_FSIDD_INVALID, + FSI::RC_BAD_REASONCODE, + TARGETING::get_huid(fsi_target), + FSI::FFDC_READWRITE_FAIL); + FSI::getFsiFFDC( FSI::FFDC_READWRITE_FAIL, l_err, fsi_target ); + errlCommit(l_err,CXXTEST_COMP_ID); + + l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + FSI::MOD_FSIDD_INVALID, + FSI::RC_BAD_REASONCODE, + TARGETING::get_huid(fsi_target), + FSI::FFDC_PIB_FAIL); + FSI::getFsiFFDC( FSI::FFDC_PIB_FAIL, l_err, fsi_target ); + errlCommit(l_err,CXXTEST_COMP_ID); + + TRACFCOMP( g_trac_fsi, "FsiDDTest::test_FFDC> Finish" ); + }; }; diff --git a/src/usr/fsiscom/fsiscom.C b/src/usr/fsiscom/fsiscom.C index d87a6f393..0c3e94361 100644 --- a/src/usr/fsiscom/fsiscom.C +++ b/src/usr/fsiscom/fsiscom.C @@ -28,14 +28,18 @@ #include <trace/interface.H> #include <errl/errlentry.H> #include <errl/errlmanager.H> +#include <errl/errludtarget.H> +#include <xscom/piberror.H> #include <fsiscom/fsiscom_reasoncodes.H> +#include <fsi/fsiif.H> +#include <sys/time.h> #include "fsiscom.H" //Globals/Constants // Trace definition trace_desc_t* g_trac_fsiscom = NULL; -TRAC_INIT(&g_trac_fsiscom, "FSISCOM", 2*KILOBYTE); //2K +TRAC_INIT(&g_trac_fsiscom, FSISCOM_COMP_NAME, 2*KILOBYTE); //2K // Easy macro replace for unit testing //#define TRACUCOMP(args...) TRACFCOMP(args) @@ -54,8 +58,55 @@ union ioData6432 }; }; -//@fixme - not full tested due to simics instability. Will full test when -// enabling the scom test cases. +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +void pib_error_handler( TARGETING::Target* i_target, + errlHndl_t i_errlog, + uint32_t i_status ) +{ + //Add this target to the FFDC + ERRORLOG::ErrlUserDetailsTarget(i_target,"SCOM Target").addToLog(i_errlog); + + //Add the callouts for the specific PCB/PIB error + uint32_t pib_error = i_status >> 12; + PIB::addFruCallouts( i_target, + pib_error, + i_errlog ); + + //Grab the PIB2OPB Status reg for a Resource Occupied error + if( pib_error == PIB::PIB_RESOURCE_OCCUPIED ) //piberr=001 + { + FSI::getFsiFFDC( FSI::FFDC_PIB_FAIL, + i_errlog, + i_target ); + } + + //Recovery sequence from Markus + // if SCOM fails and FSI Master displays "MasterTimeOut" + // then 7,6 <covered by FSI driver> + // else if SCOM fails and FSI2PIB Status shows PIB abort + // then just perform unit reset (6) and wait 1 ms + // else (PIB_abort='0' but PIB error is unequal 0) + // then just perform unit reset (6) (wait not needed). + uint32_t l_command = 0; + size_t op_size = sizeof(uint32_t); + errlHndl_t l_err = DeviceFW::deviceOp( DeviceFW::WRITE, + i_target, + &l_command, + op_size, + DEVICE_FSI_ADDRESS(ENGINE_RESET_REG)); + if(l_err) + { + TRACFCOMP( g_trac_fsiscom, + ERR_MRK"Error resetting FSI : %.4X", + ERRL_GETRC_SAFE(l_err) ); + l_err->plid(i_errlog->plid()); + errlCommit(l_err,FSISCOM_COMP_ID); + } + + nanosleep( 0,NS_PER_MSEC ); //sleep for ms + +} /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -87,36 +138,41 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, * @reasoncode FSISCOM::RC_INVALID_LENGTH * @userdata1 SCOM Address * @userdata2 Data Length - * @devdesc FSISCOM: fsiScomPerformOp> Invalid data length (!= 8 bytes) + * @devdesc fsiScomPerformOp> Invalid data length (!= 8 bytes) */ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, FSISCOM::MOD_FSISCOM_PERFORMOP, FSISCOM::RC_INVALID_LENGTH, l_scomAddr, TO_UINT64(io_buflen)); - //@fixme: Need to callout target somehow. Need to decide how to callout target and where - // it should be done (this layer or somewhere higher in the call stack?) + l_err->addProcedureCallout( HWAS::EPUB_PRC_HB_CODE, + HWAS::SRCI_PRIORITY_LOW ); + ERRORLOG::ErrlUserDetailsTarget(i_target,"SCOM Target"). + addToLog(l_err); break; } if( (l_scomAddr & 0xFFFFFFFF80000000) != 0) { - TRACFCOMP( g_trac_fsiscom, ERR_MRK "fsiScomPerformOp> Address contains more than 31 bits : l_scomAddr=0x%.8x", l_scomAddr ); + TRACFCOMP( g_trac_fsiscom, ERR_MRK "fsiScomPerformOp> Address contains more than 31 bits : l_scomAddr=0x%.16X", l_scomAddr ); /*@ * @errortype * @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP * @reasoncode FSISCOM::RC_INVALID_ADDRESS * @userdata1 SCOM Address * @userdata2 0 - * @devdesc FSISCOM: fsiScomPerformOp> Address contains more than 31 bits. + * @devdesc fsiScomPerformOp> Address contains + * more than 31 bits. */ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, FSISCOM::MOD_FSISCOM_PERFORMOP, FSISCOM::RC_INVALID_ADDRESS, l_scomAddr, - 0); - //@fixme: Need to callout target somehow. Need to decide how to callout target and where - // it should be done (this layer or somewhere higher in the call stack?) + TARGETING::get_huid(i_target)); + l_err->addProcedureCallout( HWAS::EPUB_PRC_HB_CODE, + HWAS::SRCI_PRIORITY_LOW ); + ERRORLOG::ErrlUserDetailsTarget(i_target,"SCOM Target"). + addToLog(l_err); break; } @@ -183,12 +239,9 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, break; } - // atomic section << - need_unlock = false; - mutex_unlock(l_mutex); - - //bits 17-19 indicates PCB/PIB error - if(l_status & 0x00007000) + // Check the status reg for errors + if( (l_status & PIB_ERROR_BITS) // PCB/PIB Errors + || (l_status & PIB_ABORT_BIT) ) // PIB Abort { TRACFCOMP( g_trac_fsiscom, ERR_MRK"fsiScomPerformOp:Write: PCB/PIB error received: l_status=0x%X)", l_status); /*@ @@ -197,17 +250,18 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, * @reasoncode FSISCOM::RC_WRITE_ERROR * @userdata1 SCOM Addr * @userdata2 SCOM Status Reg - * @devdesc fsiScomPerformOp> Error returned from SCOM Engine after write + * @devdesc fsiScomPerformOp> Error returned + * from SCOM Engine after write */ - l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - FSISCOM::MOD_FSISCOM_PERFORMOP, - FSISCOM::RC_WRITE_ERROR, - l_scomAddr, - TO_UINT64(l_status)); + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + FSISCOM::MOD_FSISCOM_PERFORMOP, + FSISCOM::RC_WRITE_ERROR, + l_scomAddr, + TO_UINT64(l_status)); - //@fixme: Need to callout target somehow. Need to decide how to callout target and where - // it should be done (this layer or somewhere higher in the call stack?) - //@todo: May add recover actions later. Currently undefined + // call common error handler to do callouts and recovery + pib_error_handler( i_target, l_err, l_status ); //Grab the PIB2OPB Status reg for a XSCOM Block error if( (l_status & 0x00007000) == 0x00001000 ) //piberr=001 @@ -234,8 +288,9 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, break; } - - + // atomic section << + need_unlock = false; + mutex_unlock(l_mutex); } else if(i_opType == DeviceFW::READ) { @@ -269,8 +324,9 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, break; } - //bits 17-19 indicates PCB/PIB error - if((l_status & 0x00007000) != 0) + // Check the status reg for errors + if( (l_status & PIB_ERROR_BITS) // PCB/PIB Errors + || (l_status & PIB_ABORT_BIT) ) // PIB Abort { TRACFCOMP( g_trac_fsiscom, ERR_MRK"fsiScomPerformOp:Read: PCB/PIB error received: l_status=0x%0.8X)", l_status); @@ -288,9 +344,9 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, l_scomAddr, TO_UINT64(l_status)); - //@fixme: Need to callout target somehow. Need to decide how to callout target and where - // it should be done (this layer or somewhere higher in the call stack?) - //@todo: May add recover actions later. Currently undefined + // call common error handler to do callouts and recovery + pib_error_handler( i_target, l_err, l_status ); + break; } @@ -332,18 +388,24 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType, * @errortype * @moduleid FSISCOM::MOD_FSISCOM_PERFORMOP * @reasoncode FSISCOM::RC_INVALID_OPTYPE - * @userdata1 Operation Type (i_opType) : 0=READ, 1=WRITE - * @userdata2 0 + * @userdata1[0:31] Operation Type (i_opType) : 0=READ, 1=WRITE + * @userdata1[32:64] Input scom address + * @userdata2 Target HUID * @devdesc fsiScomPerformOp> Unsupported Operation Type specified */ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, FSISCOM::MOD_FSISCOM_PERFORMOP, FSISCOM::RC_INVALID_OPTYPE, - TO_UINT64(i_opType), - 0); + TWO_UINT32_TO_UINT64(i_opType, + l_scomAddr), + TARGETING::get_huid(i_target)); + //Add this target to the FFDC + ERRORLOG::ErrlUserDetailsTarget(i_target,"SCOM Target"). + addToLog(l_err); + + l_err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE, + HWAS::SRCI_PRIORITY_HIGH); - //@fixme: Need to callout target somehow. Need to decide how to callout target and where - // it should be done (this layer or somewhere higher in the call stack?) break; } diff --git a/src/usr/fsiscom/fsiscom.H b/src/usr/fsiscom/fsiscom.H index 62ed12f27..0c17946b3 100644 --- a/src/usr/fsiscom/fsiscom.H +++ b/src/usr/fsiscom/fsiscom.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/fsiscom/fsiscom.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// 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 other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/fsiscom/fsiscom.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,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 */ #ifndef __FSISCOM_H #define __FSISCOM_H @@ -31,12 +31,18 @@ namespace FSISCOM { enum { - //FSI addresses are byte offsets, so need to multiply by 4 since each register is 4 bytes long. - //prefix with 0x10xx for engine offset - DATA0_REG = 0x1000, /* SCOM Data Register 0 (0x00) */ - DATA1_REG = 0x1004, /* SCOM Data Register 1 (0x01) */ - COMMAND_REG = 0x1008, /* SCOM Command Register (0x02) */ - STATUS_REG = 0x101C, /* STATUS Register (0x07) */ + //FSI addresses are byte offsets, so need to multiply by 4 + // since each register is 4 bytes long. + // prefix with 0x10xx for FSI2PIB engine offset + DATA0_REG = 0x1000, /* SCOM Data Register 0 (0x00) */ + DATA1_REG = 0x1004, /* SCOM Data Register 1 (0x01) */ + COMMAND_REG = 0x1008, /* SCOM Command Register (0x02) */ + ENGINE_RESET_REG = 0x1018, /* Engine Reset Register (0x06) */ + STATUS_REG = 0x101C, /* STATUS Register (0x07) */ + PIB_RESET_REG = 0x101C, /* PIB Reset Register (0x07) */ + + PIB_ABORT_BIT = 0x00100000, /* 12= PIB Abort */ + PIB_ERROR_BITS = 0x00007000, /* 17:19= PCB/PIB Errors */ }; /** diff --git a/src/usr/fsiscom/test/fsiscomtest.H b/src/usr/fsiscom/test/fsiscomtest.H index 5c570793b..16481987d 100644 --- a/src/usr/fsiscom/test/fsiscomtest.H +++ b/src/usr/fsiscom/test/fsiscomtest.H @@ -1,43 +1,124 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/fsiscom/test/fsiscomtest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// 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 other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/fsiscom/test/fsiscomtest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,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 */ #include <cxxtest/TestSuite.H> #include <errl/errlmanager.H> #include <errl/errlentry.H> #include <limits.h> #include <devicefw/driverif.H> +#include <fsiscom/fsiscom_reasoncodes.H> +extern trace_desc_t* g_trac_fsiscom; class FsiScomTest : public CxxTest::TestSuite { public: /** - * @brief test1 + * @brief Test error path and recovery */ - void test_fsiScom(void) + void test_Error(void) { + TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> Start" ); - //FSISCOM testing driving by SCOM device driver. This allows for testing FSISCOM <-> XSCOM - //coherency. + //@fixme: RTC:80081 + TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> Disabling test until D892724 is in a build" ); +#if 0 + uint64_t fails = 0; + uint64_t total = 0; + errlHndl_t l_err = NULL; + uint64_t regdata = 0; + size_t op_size = sizeof(uint64_t); + + // Centaur target + TARGETING::EntityPath epath(TARGETING::EntityPath::PATH_PHYSICAL); + epath.addLast(TARGETING::TYPE_SYS,0); + epath.addLast(TARGETING::TYPE_NODE,0); + epath.addLast(TARGETING::TYPE_MEMBUF,4); + TARGETING::Target* fsi_target = + TARGETING::targetService().toTarget(epath); + if( fsi_target == NULL ) + { + TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> Target is NULL" ); + TS_FAIL( "FsiScomTest::test_Error> Target is NULL" ); + } + + // Bad address read + total++; + l_err = DeviceFW::deviceOp( + DeviceFW::READ, + fsi_target, + ®data, + op_size, + DEVICE_FSISCOM_ADDRESS(0x11111111) ); + if( l_err && (l_err->reasonCode() == FSISCOM::RC_READ_ERROR) ) + { + delete l_err; + } + else + { + TRACFCOMP(g_trac_fsiscom, "FsiScomTest::test_Error> No/wrong error for bad address read, RC=%X", ERRL_GETRC_SAFE(l_err) ); + TS_FAIL( "FsiScomTest::test_Error> No/wrong error for bad address read" ); + fails++; + if( l_err ) { errlCommit(l_err,FSISCOM_COMP_ID); } + } + + // Bad address write + total++; + l_err = DeviceFW::deviceOp( + DeviceFW::WRITE, + fsi_target, + ®data, + op_size, + DEVICE_FSISCOM_ADDRESS(0x00222222) ); + if( l_err && (l_err->reasonCode() == FSISCOM::RC_WRITE_ERROR) ) + { + delete l_err; + } + else + { + TRACFCOMP(g_trac_fsiscom, "FsiScomTest::test_Error> No/wrong error for bad address write, RC=%X", ERRL_GETRC_SAFE(l_err) ); + TS_FAIL( "FsiScomTest::test_Error> No/wrong error for bad address write" ); + fails++; + if( l_err ) { errlCommit(l_err,FSISCOM_COMP_ID); } + } + + // Do a good scom to prove things are working again + total++; + l_err = DeviceFW::deviceOp( + DeviceFW::READ, + fsi_target, + ®data, + op_size, + DEVICE_FSISCOM_ADDRESS(0x02011403) ); + if( l_err ) + { + TRACFCOMP(g_trac_fsiscom, "FsiScomTest::test_Error> Error reading 0x02011403, RC=%X", ERRL_GETRC_SAFE(l_err) ); + TS_FAIL( "FsiScomTest::test_Error> Error reading 0x02011403" ); + fails++; + errlCommit(l_err,FSISCOM_COMP_ID); + } + + TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> %d/%d fails", fails, total ); +#endif }; }; diff --git a/src/usr/fsiscom/test/makefile b/src/usr/fsiscom/test/makefile index b6c001ea8..7753f9a1a 100644 --- a/src/usr/fsiscom/test/makefile +++ b/src/usr/fsiscom/test/makefile @@ -1,29 +1,29 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# $Source: src/usr/fsiscom/test/makefile $ +# $Source: src/usr/fsiscom/test/makefile $ # -# IBM CONFIDENTIAL +# IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011 +# COPYRIGHT International Business Machines Corp. 2011,2013 # -# p1 +# p1 # -# Object Code Only (OCO) source materials -# Licensed Internal Code Source Materials -# IBM HostBoot Licensed Internal Code +# 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 other- -# wise divested of its trade secrets, irrespective of what has -# been deposited with the U.S. Copyright Office. +# 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 +# Origin: 30 # -# IBM_PROLOG_END +# IBM_PROLOG_END_TAG ROOTPATH = ../../../.. -#MODULE = testfsiscom Disabled as we don't currently have any tests defined. -#TESTS = *.H +MODULE = testfsiscom +TESTS = *.H include ${ROOTPATH}/config.mk diff --git a/src/usr/ibscom/ibscom.C b/src/usr/ibscom/ibscom.C index 44b34a25d..874f8f98c 100644 --- a/src/usr/ibscom/ibscom.C +++ b/src/usr/ibscom/ibscom.C @@ -39,6 +39,8 @@ #include "ibscom.H" #include <assert.h> #include <limits.h> +#include <errl/errludtarget.H> +#include <xscom/piberror.H> // Easy macro replace for unit testing //#define TRACUCOMP(args...) TRACFCOMP(args) @@ -456,8 +458,8 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, const uint64_t HOST_ERROR_VALID = 0x0000000080000000; const uint64_t PIB_ERROR_STATUS_MASK = 0x0000000070000000; const uint64_t PIB_ERROR_SHIFT = 28; - uint64_t errData = 0; size_t readSize = sizeof(uint64_t); + uint64_t mbsiberr0_data = 0; //Use FSISCOM as workaround for DD1.x centaur chips (HW246298) if(i_target->getAttr<TARGETING::ATTR_EC>() < 0x20) @@ -465,7 +467,7 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, //Need to explicitly use FSI SCOM in DD1X chips l_err = deviceOp( DeviceFW::READ, i_target, - &errData, + &mbsiberr0_data, readSize, DEVICE_FSISCOM_ADDRESS(MBSIBERR0) ); if(l_err) @@ -485,7 +487,7 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, } TRACUCOMP(g_trac_ibscom, "doIBScom: MBSIBERR0(0x%.16x) = 0x%.16X", - MBSIBERR0, errData); + MBSIBERR0, mbsiberr0_data); //attempt to clear the error register so future accesses //will work @@ -502,62 +504,23 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, l_err = NULL; } - - uint64_t pib_code = (errData & PIB_ERROR_STATUS_MASK) - >> PIB_ERROR_SHIFT; - if((errData & HOST_ERROR_VALID) &&//bit 32 - // technically between 0x001 && 0x7, but only 3 - // bits are valid. - (pib_code > 0x000)) - { - //TODO RTC: 35064 - This will be the same as the FSI SCOM - //error handling. - //Look at data to decide if bus is down - //Make smart decisions based on PIB error code. - - //Assume caller provided bad address for now. - TRACFCOMP(g_trac_ibscom, "doIBScom: MBSIBERR0 bit 0 set, caller most likely used a bad address (0x%.8x)", - i_addr); - - /*@ - * @errortype - * @moduleid IBSCOM_DO_IBSCOM - * @reasoncode IBSCOM_INVALID_ADDRESS - * @userdata1[0:31] HUID of Centaur Target - * @userdata1[32:64] SCOM Address - * @userdata2 Contents of MBSIBERR0 register - * @devdesc Operation rejected by HW due to bad - * address. - */ - l_err = - new ErrlEntry(ERRL_SEV_UNRECOVERABLE, - IBSCOM_DO_IBSCOM, - IBSCOM_INVALID_ADDRESS, - TWO_UINT32_TO_UINT64( - get_huid(i_target), - i_addr), - errData); - l_err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE, - HWAS::SRCI_PRIORITY_HIGH); - break; - } - else + //if the MBSIBERR0Q_IB_HOST_ERROR_VALID bit is not set + // then we have a bus failure + if( !(mbsiberr0_data & HOST_ERROR_VALID) ) { //Bus is down busDown = true; } - - } else // >= DD20 { //TODO RTC: 68984: Validate error path on DD2.0 Centaurs l_err = doIBScom(DeviceFW::READ, - i_target, - &errData, - readSize, - MBSIBERR0, - true); + i_target, + &mbsiberr0_data, + readSize, + MBSIBERR0, + true); if(l_err != NULL) { if( IBSCOM_SUE_IN_ERR_PATH == l_err->reasonCode() ) @@ -574,17 +537,6 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, break; } } - else //MBSIBERR0 returned valid data - { - //TODO RTC: 35064 - This will be the same as the FSI SCOM - //error handling. - //Look at data to decide if bus is down - //Make smart decisions based on PIB error code. - - //For now, assume bus is Down - busDown = true; - - } } // >= DD20 if(busDown) @@ -608,7 +560,7 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, TWO_UINT32_TO_UINT64( get_huid(i_target), i_addr), - errData); + mbsiberr0_data); l_err->addHwCallout(i_target, HWAS::SRCI_PRIORITY_HIGH, @@ -631,6 +583,39 @@ errlHndl_t doIBScom(DeviceFW::OperationType i_opType, } break; } + else // bus isn't down, some other kind of error + { + /*@ + * @errortype + * @moduleid IBSCOM_DO_IBSCOM + * @reasoncode IBSCOM_PIB_FAILURE + * @userdata1[0:31] HUID of Centaur Target + * @userdata1[32:64] SCOM Address + * @userdata2 Contents of MBSIBERR0 register + * @devdesc PIB error when attempting to perform + * IBSCOM operation. + */ + l_err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE, + IBSCOM_DO_IBSCOM, + IBSCOM_BUS_FAILURE, + TWO_UINT32_TO_UINT64( + get_huid(i_target), + i_addr), + mbsiberr0_data); + + //Add this target to the FFDC + ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(l_err); + + uint64_t pib_code = + (mbsiberr0_data & PIB_ERROR_STATUS_MASK) >> PIB_ERROR_SHIFT; + + //add callouts based on the PIB error + PIB::addFruCallouts( i_target, + pib_code, + l_err ); + + break; + } } else { diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 4ad92f5cf..a395ca6c3 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -2391,7 +2391,8 @@ sub writeTargetErrlCFile { print $outFile "//------------------------------------------------------------------------------\n"; print $outFile "ErrlUserDetailsTarget::ErrlUserDetailsTarget(\n"; - print $outFile " const Target * i_pTarget)\n"; + print $outFile " const Target * i_pTarget,\n"; + print $outFile " const char* i_label)\n"; print $outFile "{\n"; print $outFile " // Set up ErrlUserDetails instance variables\n"; print $outFile " iv_CompId = ERRL_COMP_ID;\n"; @@ -2400,18 +2401,35 @@ sub writeTargetErrlCFile { print $outFile " // override the default of false\n"; print $outFile " iv_merge = true;\n"; print $outFile "\n"; + print $outFile " uint8_t* label_buf = NULL;\n"; + print $outFile "\n"; print $outFile " if (i_pTarget == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) {\n"; - print $outFile " uint32_t *pBuffer = reinterpret_cast<uint32_t *>(\n"; - print $outFile " reallocUsrBuf(sizeof(uint32_t)));\n"; + print $outFile " label_buf = reallocUsrBuf(sizeof(uint32_t)\n"; + print $outFile " +sizeof(TargetLabel_t));\n"; + print $outFile " uint32_t *pBuffer = reinterpret_cast<uint32_t*>\n"; + print $outFile " (label_buf+sizeof(TargetLabel_t));\n"; print $outFile " // copy 0xFFFFFFFF to indicate MASTER just as gethuid() does\n"; print $outFile " *pBuffer = 0xFFFFFFFF;\n"; print $outFile " } else {\n"; print $outFile " uint32_t bufSize = 0;\n"; print $outFile " uint8_t *pTargetString = i_pTarget->targetFFDC(bufSize);\n"; - print $outFile " uint8_t *pBuffer = reinterpret_cast<uint8_t *>(reallocUsrBuf(bufSize));\n"; + print $outFile " label_buf = reallocUsrBuf(bufSize+sizeof(TargetLabel_t));\n"; + print $outFile " uint8_t* pBuffer = (label_buf+sizeof(TargetLabel_t));\n"; print $outFile " memcpy(pBuffer, pTargetString, bufSize);\n"; print $outFile " free (pTargetString);\n"; print $outFile " }\n"; + print $outFile "\n"; + print $outFile " // Prepend a label\n"; + print $outFile " TargetLabel_t label;\n"; + print $outFile " if( i_label )\n"; + print $outFile " {\n"; + print $outFile " strcpy( label.x, i_label );\n"; + print $outFile " }\n"; + print $outFile " else // no label, put a generic one in there\n"; + print $outFile " {\n"; + print $outFile " strcpy( label.x, \"Target\" );\n"; + print $outFile " }\n"; + print $outFile " memcpy( label_buf, &label, sizeof(label) );\n"; print $outFile "}\n"; print $outFile "\n"; @@ -2435,6 +2453,19 @@ sub writeTargetErrlHFile { print $outFile "#ifndef ERRL_UDTARGET_H\n"; print $outFile "#define ERRL_UDTARGET_H\n"; print $outFile "\n"; + print $outFile "namespace ERRORLOG\n"; + print $outFile "{\n"; + print $outFile "typedef struct TargetLabel_t\n"; + print $outFile "{\n"; + print $outFile " static const uint32_t LABEL_TAG = 0xEEEEEEEE;\n"; + print $outFile " uint32_t tag;\n"; + print $outFile " char x[24]; //space to left of divider\n"; + print $outFile " TargetLabel_t() : tag(0xEEEEEEEE)\n"; + print $outFile " {\n"; + print $outFile " memset(x,'\\0',sizeof(x));\n"; + print $outFile " };\n"; + print $outFile "} TargetLabel_t;\n"; + print $outFile "}\n"; print $outFile "#ifndef PARSER\n"; print $outFile "\n"; print $outFile "#include <errl/errluserdetails.H>\n"; @@ -2447,7 +2478,8 @@ sub writeTargetErrlHFile { print $outFile "class ErrlUserDetailsTarget : public ErrlUserDetails {\n"; print $outFile "public:\n"; print $outFile "\n"; - print $outFile " ErrlUserDetailsTarget(const TARGETING::Target * i_pTarget);\n"; + print $outFile " ErrlUserDetailsTarget(const TARGETING::Target * i_pTarget,\n"; + print $outFile " const char* i_label = NULL);\n"; print $outFile " virtual ~ErrlUserDetailsTarget();\n"; print $outFile "\n"; print $outFile "private:\n"; @@ -2546,6 +2578,8 @@ sub writeTargetErrlHFile { print $outFile " const uint32_t i_buflen) const\n"; print $outFile " {\n"; print $outFile " const char *attrData;\n"; + print $outFile " char l_label[24];\n"; + print $outFile " sprintf(l_label,\"Target\");\n"; print $outFile " uint32_t *l_ptr32 = reinterpret_cast<uint32_t *>(i_pBuffer);\n"; print $outFile " // while there is still at least 1 word of data left\n"; print $outFile " for (; (l_ptr32 + 1) <= (uint32_t *)((uint8_t*)i_pBuffer + i_buflen); )\n"; @@ -2553,11 +2587,15 @@ sub writeTargetErrlHFile { print $outFile " if (*l_ptr32 == 0xFFFFFFFF) { // special - master\n"; print $outFile " i_parser.PrintString(\"Target\", \"MASTER_PROCESSOR_CHIP_TARGET_SENTINEL\");\n"; print $outFile " l_ptr32++; // past the marker\n"; + print $outFile " } else if (*l_ptr32 == TargetLabel_t::LABEL_TAG) {\n"; + print $outFile " TargetLabel_t* tmp_label = reinterpret_cast<TargetLabel_t*>(l_ptr32);\n"; + print $outFile " memcpy( l_label, tmp_label->x, sizeof(l_label)-1 );\n"; + print $outFile " l_ptr32 += (sizeof(TargetLabel_t)/sizeof(uint32_t));\n"; print $outFile " } else { \n"; print $outFile " // first 4 are always the same\n"; print $outFile " if ((l_ptr32 + 4) <= (uint32_t *)((uint8_t*)i_pBuffer + i_buflen)) {\n"; - print $outFile " i_parser.PrintNumber( \"Target\", \"HUID = 0x%08X\", ntohl(*l_ptr32) );\n"; + print $outFile " i_parser.PrintNumber( l_label, \"HUID = 0x%08X\", ntohl(*l_ptr32) );\n"; print $outFile " l_ptr32++;\n"; # find CLASS diff --git a/src/usr/xscom/piberror.C b/src/usr/xscom/piberror.C index e36a37f78..366fd2579 100644 --- a/src/usr/xscom/piberror.C +++ b/src/usr/xscom/piberror.C @@ -57,8 +57,8 @@ void addFruCallouts(TARGETING::Target* i_target, case PIB::PIB_INVALID_ADDRESS: io_errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE, HWAS::SRCI_PRIORITY_HIGH); - break; + case PIB::PIB_PARITY_ERROR: case PIB::PIB_TIMEOUT: io_errl->addHwCallout( i_target, @@ -66,6 +66,7 @@ void addFruCallouts(TARGETING::Target* i_target, HWAS::NO_DECONFIG, HWAS::GARD_NULL ); break; + case PIB::PIB_CLOCK_ERROR: if (i_target->getAttr<TARGETING::ATTR_TYPE>() == TARGETING::TYPE_PROC) diff --git a/src/usr/xscom/xscom.C b/src/usr/xscom/xscom.C index 8e39ea29d..a900c8c8f 100644 --- a/src/usr/xscom/xscom.C +++ b/src/usr/xscom/xscom.C @@ -212,8 +212,6 @@ uint8_t getMaxChipsPerNode() uint8_t l_numOfChips = 0; ProcessorCoreType l_coreType = cpu_core_type(); - //@todo - Need to verify if this number is correct - // for both Murano and Venice switch (l_coreType) { case CORE_POWER8_MURANO: |