Skip to content

Commit

Permalink
Ignore IPMI_SMS_ATN during fir data collection and remove 8k buffer
Browse files Browse the repository at this point in the history
Also, only retry FIFO scoms once

Change-Id: I891efee8214fa4613f955035d07e3f2422afc5b0
CQ: SW464968
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83490
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William A Bryan <wilbryan@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Zane C Shelley <zshelle@us.ibm.com>
Reviewed-by: Christopher J Cain <cjcain@us.ibm.com>
  • Loading branch information
cjcain committed Sep 10, 2019
1 parent 5c32e77 commit e4597ab
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 46 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_190822a\0" /*</BuildName>*/ ;
volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190910a\0" /*</BuildName>*/ ;

#endif
3 changes: 2 additions & 1 deletion src/occ_gpe0/firdata/firData.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -823,6 +823,7 @@ void FirData_addTrgtsToPnor( FirData_t * io_fd )
uint32_t i = 0;
for ( i = 0; i < io_fd->hData->chipCount; i++ )
{
TRAC_IMP("FirData_addTrgtsToPnor: chip %d", i);
// Keep a pointer of the current chip header.
HOMER_Chip_t * chipHdr = (HOMER_Chip_t *) byteIdx;
byteIdx += sizeof(HOMER_Chip_t);
Expand Down
7 changes: 4 additions & 3 deletions src/occ_gpe0/firdata/fsi.c
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -37,6 +37,7 @@

void fsi_recovery()
{
TRAC_IMP(">>fsi_recovery");
int32_t rc = SUCCESS;

/* Clear out OPB error */
Expand All @@ -48,8 +49,8 @@ void fsi_recovery()
/* Check if we have any errors left */
rc |= xscom_read( OPB_REG_STAT, &scom_data );

TRACFCOMP( "PIB2OPB Status after cleanup = %08X%08X (rc=%d)",
(uint32_t)(scom_data >> 32), (uint32_t)scom_data, rc );
TRAC_IMP( "<<fsi_recovery: PIB2OPB Status after cleanup = %08X%08X (rc=%d)",
(uint32_t)(scom_data >> 32), (uint32_t)scom_data, rc );
}

/**
Expand Down
10 changes: 7 additions & 3 deletions src/occ_gpe0/firdata/ipmidd.C
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ_405/firdata/ipmidd.C $ */
/* $Source: src/occ_gpe0/firdata/ipmidd.C $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018 */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -107,7 +107,7 @@ int IpmiDD::writeLPC(const uint32_t i_addr,
*/
int IpmiDD::pollCtrl(void)
{
IPMI_TRAC(">>pollCtrl" );
//IPMI_TRAC(">>pollCtrl" );
int rc = 0;

uint8_t ctrl = 0;
Expand Down Expand Up @@ -237,9 +237,11 @@ int IpmiDD::send(void)
break;
}

#if 0
IPMI_TRAC("I> write %x:%x seq %x len %x",
iv_netfun, iv_cmd, iv_seq,
iv_data_len);
#endif

// If all is well, alert the host we sent bits.
err = writeLPC(REG_CONTROL, CTRL_H2B_ATN);
Expand Down Expand Up @@ -374,11 +376,13 @@ int IpmiDD::receive(void)
}


#if 0
IPMI_TRAC("I> read b2h %x:%x seq %x cc %x",
iv_netfun,
iv_cmd,
iv_seq,
iv_cc);
#endif

return err;
}
Expand Down
8 changes: 4 additions & 4 deletions src/occ_gpe0/firdata/ipmidd.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ_405/firdata/ipmidd.H $ */
/* $Source: src/occ_gpe0/firdata/ipmidd.H $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018 */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -91,8 +91,8 @@ enum {
CTRL_CLR_RD_PTR = (1 << 1),
CTRL_CLR_WR_PTR = (1 << 0),

IDLE_STATE = (CTRL_B_BUSY | CTRL_B2H_ATN |
CTRL_SMS_ATN | CTRL_H2B_ATN),
// Ignore CTRL_SMS_ATN
IDLE_STATE = (CTRL_B_BUSY | CTRL_B2H_ATN | CTRL_H2B_ATN),

// Bit in the INMASK register which signals to the BMC
// to reset it's end of things.
Expand Down
10 changes: 7 additions & 3 deletions src/occ_gpe0/firdata/lpc.c
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ_405/firdata/lpc.c $ */
/* $Source: src/occ_gpe0/firdata/lpc.c $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -241,7 +241,11 @@ errorHndl_t lpc_read( LpcTransType i_type,
/* Poll for completion */
StatusReg_t lpc_status;
l_err = pollComplete( &lpc_cmd, &lpc_status );
if( l_err ) { break; }
if( l_err )
{
TRAC_ERR("lpc_read: pollComplete failed rc=0x%08x", (uint32_t)l_err);
break;
}

// Read data from the LPC_DATA_REG
l_err = SCOM_getScom(l_target, LPC_DATA_REG, &l_ret);
Expand Down
10 changes: 8 additions & 2 deletions src/occ_gpe0/firdata/mboxOverIpmi.C
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ_405/firdata/mboxOverIpmi.C $ */
/* $Source: src/occ_gpe0/firdata/mboxOverIpmi.C $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018 */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -62,11 +62,17 @@ int ipmi_sendCommand(mboxMessage_t *io_msg, int i_arg_size)

do
{
#if 0
rc = l_ipmidd.pollCtrl();
TRAC_ERR("ipmi_sendCommand: DUMMY RECEIVE returned rc=%d", rc);
#endif

for(i = 0; i < IPMI_MAX_TRIES; ++i)
{
rc = l_ipmidd.send();
if(rc != RC_IPMIDD_NOT_IDLE)
{
// command was sent
break;
}
busy_wait(100); // 100 us
Expand Down
6 changes: 3 additions & 3 deletions src/occ_gpe0/firdata/pnor_mboxdd.c
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ_405/firdata/pnor_mboxdd.c $ */
/* $Source: src/occ_gpe0/firdata/pnor_mboxdd.c $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017 */
/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -223,7 +223,7 @@ errorHndl_t writeFlash(pnorMbox_t* i_pnorMbox,
break;
}

//LPC writes are done via LPC scom interface and can only handle 4
//LPC writes are done via LPC scom interface and can only handle 4
//bytes at a time. We write 256 bytes from the previous functions,
// so break up the large write into 4 byte writes
uint32_t l_size_written = 0;
Expand Down
23 changes: 16 additions & 7 deletions src/occ_gpe0/firdata/pnor_util.c
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ_405/firdata/pnor_util.c $ */
/* $Source: src/occ_gpe0/firdata/pnor_util.c $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -51,6 +51,14 @@ int32_t pnor_write_8B( uint64_t i_data )
{
int32_t rc = SUCCESS;

// 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!");
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 */
{
Expand Down Expand Up @@ -92,7 +100,7 @@ int32_t pnor_write_8B( uint64_t i_data )
g_write_cache );
if ( NO_ERROR != tmp )
{
TRACFCOMP("pnor_write_8B> writeFlash failed");
TRAC_IMP("pnor_write_8B> writeFlash failed");
/* hit an error, stop any more writes from happening */
g_next_byte = 0xFFFFFFFF;
g_pnor_size = 0;
Expand Down Expand Up @@ -171,6 +179,7 @@ int32_t PNOR_writeFirData( HOMER_PnorInfo_t i_pnorInfo,
uint64_t dataChunk = 0;
uint32_t sz_dataChunk = sizeof(uint64_t);

TRAC_IMP("PNOR_writeFirData: writing %d bytes (%d byte chunks)", i_bufSize, sz_dataChunk);
/* Add PNOR data 8 bytes at a time. */
for ( idx = 0; idx < i_bufSize; idx += sz_dataChunk )
{
Expand All @@ -180,7 +189,7 @@ int32_t PNOR_writeFirData( HOMER_PnorInfo_t i_pnorInfo,
rc = pnor_write_8B( dataChunk );
if ( SUCCESS != rc )
{
TRACFCOMP( "pnor_write_8B() failed during FIR write" );
TRAC_ERR( "pnor_write_8B() failed during FIR write" );
break;
}
}
Expand All @@ -201,7 +210,7 @@ int32_t PNOR_writeFirData( HOMER_PnorInfo_t i_pnorInfo,
rc = pnor_write_8B( dataChunk );
if ( SUCCESS != rc )
{
TRACFCOMP( "pnor_write_8B() failed during blank fill" );
TRAC_ERR( "pnor_write_8B() failed during blank fill" );
break;
}
}
Expand All @@ -215,14 +224,14 @@ int32_t PNOR_writeFirData( HOMER_PnorInfo_t i_pnorInfo,
rc = pnor_write_8B( dataChunk );
if ( SUCCESS != rc )
{
TRACFCOMP( "pnor_write_8B() failed during ECC fill" );
TRAC_ERR( "pnor_write_8B() failed during ECC fill" );
break;
}
}

} while (0);

TRACFCOMP("<<PNOR_writeFirData");
TRAC_IMP("<<PNOR_writeFirData returning %d", rc);
return rc;
}

0 comments on commit e4597ab

Please sign in to comment.