From 5eee371fba7be9298ed9a3f17170d59660d8a92c Mon Sep 17 00:00:00 2001 From: Josh Rispoli Date: Fri, 14 Nov 2014 14:06:02 -0600 Subject: Add calls to reset I2C buses in isteps Added i2c bus reset (force i2c reset) to isteps 6.3 and 6.12. Change-Id: I35a95b4fdf6c045906f3620262c23ef4ec2baef2 RTC:116374 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14493 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/include/usr/i2c/i2cif.H | 21 ++++++++++++--------- src/usr/hwas/hostbootIstep.C | 26 +++++++++++++++++++++++--- src/usr/hwpf/hwp/slave_sbe/slave_sbe.C | 9 +++++++++ src/usr/i2c/i2c.C | 7 ++----- 4 files changed, 46 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H index ac28686b8..f0eb6d313 100644 --- a/src/include/usr/i2c/i2cif.H +++ b/src/include/usr/i2c/i2cif.H @@ -39,18 +39,21 @@ namespace I2C */ errlHndl_t i2cSetupMasters ( void ); - /** -* @enum i2cResetType -* -* @brief I2C Reset Type specifies what is reset when i2cResetMasters() is called -* @todo RTC 115832 - additional enums will be added -* -*/ + * @enum i2cResetType + * + * @brief I2C Reset Type specifies what is reset when i2cResetMasters() is called + */ enum i2cResetType { - I2C_RESET_INVALID = 0x00, - I2C_RESET_PROC_HOST = 0x01, // Only Host (not FSI) + I2C_RESET_INVALID, + I2C_RESET_ALL, + I2C_RESET_PROC_ALL, + I2C_RESET_PROC_FSI, + I2C_RESET_PROC_HOST, + I2C_RESET_MEMBUF_ALL, + I2C_RESET_MEMBUF_FSI, + I2c_RESET_MEMBUF_HOST }; /** diff --git a/src/usr/hwas/hostbootIstep.C b/src/usr/hwas/hostbootIstep.C index 6c33c0a7c..77759c72a 100644 --- a/src/usr/hwas/hostbootIstep.C +++ b/src/usr/hwas/hostbootIstep.C @@ -47,6 +47,8 @@ #include #include +#include + #include #include @@ -81,13 +83,31 @@ using namespace ISTEP_ERROR; //****************************************************************************** void* host_init_fsi( void *io_pArgs ) { + errlHndl_t l_errl = NULL; + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "host_init_fsi entry" ); + do + { + l_errl = FSI::initializeHardware( ); + if (l_errl) + { + break; + } - errlHndl_t errl = FSI::initializeHardware( ); - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "host_init_fsi exit" ); + //@TODO RTC:116439 + /* + l_errl = I2C::i2cResetMasters(I2C::I2C_RESET_PROC_ALL); + if (l_errl) + { + break; + } + */ - return errl; + } while (0); + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "host_init_fsi exit" ); + return l_errl; } //****************************************************************************** diff --git a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C index 9842d31da..696697345 100644 --- a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C +++ b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C @@ -44,6 +44,7 @@ #include #include #include +#include // targeting support #include @@ -441,6 +442,14 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) } } // endfor + l_errl = I2C::i2cResetMasters(I2C::I2C_RESET_PROC_ALL); + + if (l_errl) + { + // Commit error + errlCommit( l_errl, HWPF_COMP_ID ); + } + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_check_slave_sbe_seeprom_complete exit"); diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C index 13d1b7c1b..50aef65e2 100755 --- a/src/usr/i2c/i2c.C +++ b/src/usr/i2c/i2c.C @@ -2378,9 +2378,8 @@ errlHndl_t i2cResetMasters ( i2cResetType i_resetType ) // Now reset the engine/bus if ( error_found == false ) { - err = i2cReset ( procList[proc], - io_args); - + err = i2cReset ( procList[proc], io_args, + FORCE_UNLOCK_RESET); if( err ) { TRACFCOMP( g_trac_i2c, @@ -2420,8 +2419,6 @@ errlHndl_t i2cResetMasters ( i2cResetType i_resetType ) return err; } - - // ------------------------------------------------------------------ // i2cRegisterOp // ------------------------------------------------------------------ -- cgit v1.2.1