diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2014-06-10 07:54:09 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-06-23 18:14:03 -0500 |
commit | 880549f8e6e341dbe6261cedff9c0acce4813527 (patch) | |
tree | 2b2ba8a50e8c9b42abaa20801cf164f685786bab /src/usr/hwpf/hwp/slave_sbe | |
parent | 743f25e1fef314f59f0ad9476a128e1cd2eea30a (diff) | |
download | talos-hostboot-880549f8e6e341dbe6261cedff9c0acce4813527.tar.gz talos-hostboot-880549f8e6e341dbe6261cedff9c0acce4813527.zip |
Fine grain timeout on checking slave SBE status
Change-Id: Ib87895cdbcde95071384d78cc7baadda435a456d
RTC: 87845
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11527
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/slave_sbe')
3 files changed, 22 insertions, 38 deletions
diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C index ec9c00156..191054c83 100644 --- a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C +++ b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C @@ -59,7 +59,7 @@ const uint8_t SBE_EXIT_SUCCESS_0xF = 0xF; const uint64_t NS_TO_FINISH = 10000000; //(10 ms) const uint64_t MS_TO_FINISH = NS_TO_FINISH/1000000; const uint64_t SIM_CYCLES_TO_FINISH = 10000000; -//Should really be 19.6*NS_TO_FINISH, but sim runs at about 11 hours per +//Should really be 19.6*NS_TO_FINISH, but sim runs at about 11 hours per //simulated second which is longer than we want to wait in error cases @@ -240,7 +240,7 @@ extern "C" do { //Check if the SBE is still running. Loop until stopped - //or loop time is exceeded. + //or loop time is exceeded. bool still_running = true; size_t loop_time = 0; rc = proc_check_slave_sbe_seeprom_complete_check_running( @@ -325,7 +325,7 @@ extern "C" if( halt_code != SBE_EXIT_SUCCESS_0xF ) { FAPI_ERR( - "SBE halted with error %i (istep 0x%X, substep %i)", + "SBE halted with error %i (istep 0x%X, substep %i)", halt_code, istep_num, substep_num); @@ -341,7 +341,7 @@ extern "C" ( istep_num != PROC_SBE_EX_HOST_RUNTIME_SCOM_MAGIC_ISTEP_NUM )) { FAPI_ERR( - "SBE halted in wrong istep (istep 0x%X, substep %i)", + "SBE halted in wrong istep (istep 0x%X, substep %i)", istep_num, substep_num); const fapi::Target & CHIP_IN_ERROR = i_target; @@ -360,7 +360,7 @@ extern "C" ( substep_num != SUBSTEP_ENABLE_PNOR_SLAVE_CHIP ))) { FAPI_ERR( - "SBE halted in wrong substep (istep 0x%X, substep %i)", + "SBE halted in wrong substep (istep 0x%X, substep %i)", istep_num, substep_num); const fapi::Target & CHIP_IN_ERROR = i_target; diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_spless_sbe_startWA/proc_spless_sbe_startWA.C b/src/usr/hwpf/hwp/slave_sbe/proc_spless_sbe_startWA/proc_spless_sbe_startWA.C index c02edc5ce..87b93ad57 100644 --- a/src/usr/hwpf/hwp/slave_sbe/proc_spless_sbe_startWA/proc_spless_sbe_startWA.C +++ b/src/usr/hwpf/hwp/slave_sbe/proc_spless_sbe_startWA/proc_spless_sbe_startWA.C @@ -67,27 +67,9 @@ fapi::ReturnCode proc_spless_sbe_startWA(const fapi::Target & i_target) fapi::ReturnCode rc; uint32_t l_set_data; ecmdDataBufferBase set_data(32); - uint8_t l_needSbeStartWA = 0; do { - // ---- check if workaround is needed - rc = FAPI_ATTR_GET(ATTR_CHIP_EC_FEATURE_CFAM_RESET_SBE_START_WA, - &i_target, - l_needSbeStartWA); - if(rc) - { - FAPI_ERR("Error querying Chip EC feature: " - "ATTR_CHIP_EC_FEATURE_CFAM_RESET_SBE_START_WA"); - break; - } - - if(!l_needSbeStartWA) - { - //Workaround not needed -- break - break; - } - // ----------------------------------------------------------- //Need to set the I2C speed based in the mailbox reg //Since not all 1.x part have the correctly programmed OTPROM @@ -118,7 +100,7 @@ fapi::ReturnCode proc_spless_sbe_startWA(const fapi::Target & i_target) // ------------------------------------------------ // Now toggle Warmstart bit to circumvent HW254584 // write it to mbox scratch2 - rc_ecmd |= set_data.setWord( 0, 0x10000000 ); + rc_ecmd |= set_data.setWord( 0, 0x30000000 ); rc = fapiPutCfamRegister( i_target, @@ -131,7 +113,7 @@ fapi::ReturnCode proc_spless_sbe_startWA(const fapi::Target & i_target) break; } - rc_ecmd |= set_data.setWord( 0, 0x90000000 ); + rc_ecmd |= set_data.setWord( 0, 0xB0000000 ); rc = fapiPutCfamRegister( i_target, diff --git a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C index 0cc5fa630..cbe30c928 100644 --- a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C +++ b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C @@ -63,6 +63,9 @@ #include "proc_spless_sbe_startWA.H" #include <sbe/sbeif.H> +const uint64_t MS_TO_WAIT_FIRST = 2500; //(2.5 s) +const uint64_t MS_TO_WAIT_OTHERS= 100; //(100 ms) + using namespace ISTEP; using namespace ISTEP_ERROR; using namespace ERRORLOG; @@ -152,7 +155,6 @@ void* call_host_sbe_start( void *io_pArgs ) { errlHndl_t l_errl = NULL; IStepError l_stepError; - bool l_needDelay = false; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_sbe_start entry" ); @@ -201,8 +203,6 @@ void* call_host_sbe_start( void *io_pArgs ) FAPI_INVOKE_HWP(l_errl, proc_spless_sbe_startWA, l_fapiProcTarget); - - l_needDelay = true; } else { @@ -235,15 +235,6 @@ void* call_host_sbe_start( void *io_pArgs ) } } // endfor - //TODO RTC 87845 Should really move this delay to - // check_slave_sbe_seeprom_complete to delay/poll instead - // of one big delay here. For now if we started the slaves - // delay ~2.5 sec for them to complete - if(l_needDelay) - { - nanosleep( 2, 500000000 ); //sleep for 2.5 seconds - } - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_sbe_start exit" ); // end task, returning any errorlogs to IStepDisp @@ -260,10 +251,18 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) IStepError l_stepError; void* sbeImgPtr = NULL; size_t sbeImgSize = 0; + size_t l_wait_time = MS_TO_WAIT_OTHERS; + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_check_slave_sbe_seeprom_complete entry" ); + //If in FSPless environment -- give time for SBE to complete on first chip + if (!INITSERVICE::spBaseServicesEnabled()) + { + l_wait_time = MS_TO_WAIT_FIRST; + } + // // get the master Proc target, we want to IGNORE this one. // @@ -314,7 +313,7 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) // Invoke the HWP FAPI_INVOKE_HWP(l_errl, proc_check_slave_sbe_seeprom_complete, - l_fapiProcTarget, sbeImgPtr); + l_fapiProcTarget, sbeImgPtr, l_wait_time); if (l_errl) { @@ -338,6 +337,9 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) "completed ok"); } + + //after first one default to quick check time + l_wait_time = MS_TO_WAIT_OTHERS; } // endfor |