Skip to content

Commit

Permalink
Ensure sbefifo is clean on slave chips before starting
Browse files Browse the repository at this point in the history
Change-Id: I440d6f5bd6aa1c3c72b3d8df581262b01765214c
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35447
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
sannerd authored and dcrowell77 committed Feb 7, 2017
1 parent 6066591 commit eb217e5
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 5 deletions.
18 changes: 17 additions & 1 deletion src/include/usr/sbeio/sbeioif.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -112,6 +112,22 @@ namespace SBEIO
uint64_t i_data,
uint64_t i_mask);

/**
* @brief Issue Reset to SBE FIFO. Note this can ONLY be
* done on slave processors on FSI SBE FIFO path
* never on the master chip. This function is
* only intended to be used to cleanup the FIFO
* on IPLs -- as it doesn't follow the protocol
* with a running SBE
*
*
* @param[in] i_target Target to access
*
* @return errlHndl_t Error log handle on failure.
*
*/
errlHndl_t sendFifoReset(TARGETING::Target * i_target);

} //end namespace SBEIO

#endif /* _SBEIOIF_H */
17 changes: 16 additions & 1 deletion src/usr/isteps/istep08/call_host_cbs_start.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -44,6 +44,7 @@
#include <sys/time.h>
#include <devicefw/userif.H>
#include <i2c/i2cif.H>
#include <sbeio/sbeioif.H>

// targeting support
#include <targeting/common/commontargeting.H>
Expand Down Expand Up @@ -96,6 +97,20 @@ void* call_host_cbs_start(void *io_pArgs)
{
if (l_cpu_target != l_pMasterProcTarget)
{
//Before starting the CBS (and thus the SBE) on slave procs
//Make sure the SBE FIFO is clean by doing a full reset of
//the fifo
l_errl = SBEIO::sendFifoReset(l_cpu_target);
if (l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : call sendFifoReset, "
"PLID=0x%x", l_errl->plid() );
l_stepError.addErrorDetails(l_errl);
errlCommit(l_errl, ISTEP_COMP_ID);
continue; //Don't continue on this chip if failed
}

const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
l_fapi2_proc_target (l_cpu_target);

Expand Down
26 changes: 25 additions & 1 deletion src/usr/sbeio/sbe_fifodd.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -157,6 +157,30 @@ errlHndl_t SbeFifo::performFifoChipOp(TARGETING::Target * i_target,
}


/**
* @brief perform SBE FIFO Reset
*/
errlHndl_t SbeFifo::performFifoReset(TARGETING::Target * i_target)
{
errlHndl_t errl = NULL;
static mutex_t l_fifoOpMux = MUTEX_INITIALIZER;

SBE_TRACF(ENTER_MRK "sending FSI SBEFIFO Reset to HUID 0x%x",
TARGETING::get_huid(i_target));

//Serialize access to the FIFO
mutex_lock(&l_fifoOpMux);

// Perform a write to the DNFIFO Reset to cleanup the fifo
uint32_t l_dummy = 0xDEAD;
errl = writeFsi(i_target,SBE_FIFO_DNFIFO_RESET,&l_dummy);

mutex_unlock(&l_fifoOpMux);

return errl;
}


/**
* @brief write FIFO request message
*/
Expand Down
13 changes: 12 additions & 1 deletion src/usr/sbeio/sbe_fifodd.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -250,6 +250,17 @@ class SbeFifo
uint32_t * i_pFifoResponse,
uint32_t i_responseSize);

/**
* @Brief perform SBE FIFO reset
*
* NOT to be used on running SBE -- only for IPL
*
* @param[in] i_target Target to access
*
* @return errlHndl_t Error log handle on failure.
*/
errlHndl_t performFifoReset(TARGETING::Target * i_target);


protected:

Expand Down
24 changes: 23 additions & 1 deletion src/usr/sbeio/sbe_scomAccess.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -254,5 +254,27 @@ errlHndl_t putFifoScomUnderMask(TARGETING::Target * i_target,
return errl;
};

// Reset FSI SBE FIFO
errlHndl_t sendFifoReset(TARGETING::Target * i_target)
{
errlHndl_t errl = NULL;

SBE_TRACD(ENTER_MRK "sendFifoReset");

do
{
// error check input parameters
errl = fifoScomInterfaceChecks(i_target, 0x0);
if (errl) break;

errl = SbeFifo::getTheInstance().performFifoReset(i_target);
}
while (0);

SBE_TRACD(EXIT_MRK "sendFifoReset");

return errl;
};

} //end namespace SBEIO

0 comments on commit eb217e5

Please sign in to comment.