Skip to content

Commit

Permalink
FIR data collection updates
Browse files Browse the repository at this point in the history
- Update read buffer size
- Flush buffer on SBE scom failures
- Additional debug data on IPMI failures

Change-Id: Ia14551925f491352d0d3b7af566c384bca51bfd0
CQ: SW477678
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83561
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C Shelley <zshelle@us.ibm.com>
Reviewed-by: Douglas R Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: William A Bryan <wilbryan@us.ibm.com>
Reviewed-by: Christopher J Cain <cjcain@us.ibm.com>
  • Loading branch information
cjcain committed Oct 23, 2019
1 parent e4597ab commit 3ab2921
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/occ_405/occbuildname.c
Expand Up @@ -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"))) = /*<BuildName>*/ "op_occ_190910a\0" /*</BuildName>*/ ;
volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_191023a\0" /*</BuildName>*/ ;

#endif
4 changes: 2 additions & 2 deletions 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. */
/* */
/* */
Expand Down
5 changes: 3 additions & 2 deletions src/occ_gpe0/firdata/mboxOverIpmi.C
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions src/occ_gpe0/firdata/pnor_mboxdd.c
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
9 changes: 5 additions & 4 deletions src/occ_gpe0/firdata/pnor_util.c
Expand Up @@ -54,16 +54,16 @@ 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;
}

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;
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
37 changes: 37 additions & 0 deletions src/occ_gpe0/firdata/sbe_fifo.c
Expand Up @@ -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,

Expand Down Expand Up @@ -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
{
Expand Down
6 changes: 4 additions & 2 deletions src/occ_gpe0/firdata/sbe_fifo.h
Expand Up @@ -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
Expand Down

0 comments on commit 3ab2921

Please sign in to comment.