diff --git a/src/occ_405/occbuildname.c b/src/occ_405/occbuildname.c index 2d923d8f..ef4de9c9 100755 --- a/src/occ_405/occbuildname.c +++ b/src/occ_405/occbuildname.c @@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = #else -volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /**/ "op_occ_190910a\0" /**/ ; +volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /**/ "op_occ_191023a\0" /**/ ; #endif diff --git a/src/occ_gpe0/firdata/ast_mboxdd.c b/src/occ_gpe0/firdata/ast_mboxdd.c index a9d2c24d..2de26fce 100644 --- a/src/occ_gpe0/firdata/ast_mboxdd.c +++ b/src/occ_gpe0/firdata/ast_mboxdd.c @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ_405/firdata/ast_mboxdd.c $ */ +/* $Source: src/occ_gpe0/firdata/ast_mboxdd.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017 */ +/* Contributors Listed Below - COPYRIGHT 2017,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/occ_gpe0/firdata/mboxOverIpmi.C b/src/occ_gpe0/firdata/mboxOverIpmi.C index d3bc3130..61ab87a8 100644 --- a/src/occ_gpe0/firdata/mboxOverIpmi.C +++ b/src/occ_gpe0/firdata/mboxOverIpmi.C @@ -86,13 +86,14 @@ int ipmi_sendCommand(mboxMessage_t *io_msg, int i_arg_size) // It's not clear if the PK trace can be extracted w/o Cronus. if(i == IPMI_MAX_TRIES) { - PK_TRACE("ipmi_sendCommand: cmd 0x%x TIMEOUT waiting to send", - io_msg->iv_cmd); rc = RC_IPMIDD_TIMEOUT; } if( rc ) { + PK_TRACE("ipmi_sendCommand: send of PNOR_CMD failed (cmd 0x%02X, seq=0x%02X, " + "data_size=%d, rc=0x%08X)", + io_msg->iv_cmd, io_msg->iv_seq, l_data_size, rc); break; } diff --git a/src/occ_gpe0/firdata/pnor_mboxdd.c b/src/occ_gpe0/firdata/pnor_mboxdd.c index 3961f7ce..735d150a 100644 --- a/src/occ_gpe0/firdata/pnor_mboxdd.c +++ b/src/occ_gpe0/firdata/pnor_mboxdd.c @@ -67,6 +67,7 @@ errorHndl_t hwInit(pnorMbox_t* i_pnorMbox) l_getInfoMsg.iv_cmd = MBOX_C_GET_MBOX_INFO; put8(&l_getInfoMsg, 0, 2); l_arg_size = 1; + TRAC_IMP("hwInit: sending GET_MBOX_INFO"); l_err = doMessage(&i_pnorMbox->iv_mbox, &l_getInfoMsg, l_arg_size); if (l_err) { @@ -92,6 +93,7 @@ errorHndl_t hwInit(pnorMbox_t* i_pnorMbox) mboxMessage_t l_getSizeMsg; l_getSizeMsg.iv_cmd = MBOX_C_GET_FLASH_INFO; l_arg_size = 0; + TRAC_IMP("hwInit: sending GET_FLASH_INFO"); l_err = doMessage(&i_pnorMbox->iv_mbox, &l_getSizeMsg, l_arg_size); if (l_err) { diff --git a/src/occ_gpe0/firdata/pnor_util.c b/src/occ_gpe0/firdata/pnor_util.c index d5b86f0e..eef69b63 100644 --- a/src/occ_gpe0/firdata/pnor_util.c +++ b/src/occ_gpe0/firdata/pnor_util.c @@ -54,7 +54,7 @@ int32_t pnor_write_8B( uint64_t i_data ) // ensure current index is within range if (g_write_cache_index > PAGE_PROGRAM_BYTES) { - TRAC_ERR("pnor_write_8B: ERROR - g_write_cache_index > PAGE_PROGRAM_BYTES!"); + TRAC_ERR("pnor_write_8B: ERROR - g_write_cache_index (0x%08X) > PAGE_PROGRAM_BYTES!", g_write_cache_index); g_write_cache_index = 0; g_next_byte = 0xFFFFFFFF; } @@ -62,8 +62,8 @@ int32_t pnor_write_8B( uint64_t i_data ) if ( (g_next_byte == 0xFFFFFFFF) || /* initialized data */ ((g_next_byte + g_pnor_size) < (g_next_byte + 9)) ) /* make sure there is room */ { - PK_TRACE("FAILURE: pnor_write_8B> g_next_byte=%.8X, g_pnor_size=%.8X", - g_next_byte,g_pnor_size); + PK_TRACE("pnor_write_8B: Invalid data - g_next_byte=0x%08X, g_pnor_size=0x%08X", + g_next_byte, g_pnor_size); /* must have been some error in the prep */ return FAIL; } @@ -189,7 +189,8 @@ int32_t PNOR_writeFirData( HOMER_PnorInfo_t i_pnorInfo, rc = pnor_write_8B( dataChunk ); if ( SUCCESS != rc ) { - TRAC_ERR( "pnor_write_8B() failed during FIR write" ); + TRAC_ERR("pnor_write_8B() failed during FIR write (rc=0x%08X, idx=%d of %d)", + rc, idx, i_bufSize); break; } } diff --git a/src/occ_gpe0/firdata/sbe_fifo.c b/src/occ_gpe0/firdata/sbe_fifo.c index f3eb0bfe..087dd0fa 100644 --- a/src/occ_gpe0/firdata/sbe_fifo.c +++ b/src/occ_gpe0/firdata/sbe_fifo.c @@ -37,6 +37,7 @@ enum RC_RESP_MAGIC_WORD_INVALID = 1004, RC_RESP_UNEXPECTED_CMD = 1005, RC_RESP_UNEXPECTED_DATA_SIZE = 1006, + RC_RESP_DN_FIFO_READY_TIMEDOUT = 1007, RC_RESP_SCOM_ERROR = 1010, @@ -313,6 +314,42 @@ uint32_t readResponse( SCOM_Trgt_t* i_target, FifoCmd_t* i_fifoReqCmd, uint32_t readBuffer[READ_BUFFER_SIZE]; uint32_t wordsReceived = 0; + uint32_t delayTicks = 0; + uint32_t fifoNotReady = 1; + + do + { + // Wait to read data or EOT from the FIFO. + uint32_t l_status = 0; + l_rc = waitDnFifoReady( i_target, &l_status ); + if ( SUCCESS != l_rc ) + { + TRAC_ERR("readResponse: waitDnFifoReady failed, rc=%d, status=%d", l_rc, l_status); + return l_rc; + } + + // Check if DN Stram Fifo is Ready to be read + if( l_status & DNFIFO_STATUS_FIFO_EMPTY ) + { + // This means that Down stream buffer is not ready yet..wait for + // some more time + delayTicks++; + if(delayTicks < TimeoutForStartOfTrx) + { + continue; + } + else + { + TRAC_ERR("readResponse: Down Stream Fifo Not Ready yet to " + "receive Data, Status Reg [0x%08X]", l_status); + return RC_RESP_DN_FIFO_READY_TIMEDOUT; + } + } + else + { + fifoNotReady = 0; // This will break out of the waiting loop + } + }while(fifoNotReady); // Waiting loop for start of the transfer do { diff --git a/src/occ_gpe0/firdata/sbe_fifo.h b/src/occ_gpe0/firdata/sbe_fifo.h index 1464700e..de7bd989 100644 --- a/src/occ_gpe0/firdata/sbe_fifo.h +++ b/src/occ_gpe0/firdata/sbe_fifo.h @@ -52,12 +52,14 @@ #define NS_PER_MSEC (1000000ull) #define MAX_UP_FIFO_TIMEOUT_NS 10*NS_PER_MSEC // READ_BUFFER_SIZE is number of words when reading scom via SBE -// (2 words of scom data + 3 words of header) -#define READ_BUFFER_SIZE 5 +// (minimum 6: 2 words of scom data + 3 words of header + 1 EOT) +#define READ_BUFFER_SIZE 8 #define FIFO_STATUS_MAGIC 0xC0DE #define SBE_PRI_OPERATION_SUCCESSFUL 0x00 #define SBE_SEC_OPERATION_SUCCESSFUL 0x00 +#define TimeoutForStartOfTrx 0x1000 + typedef union { struct