diff options
author | Chris Cain <cjcain@us.ibm.com> | 2016-10-13 16:11:32 -0500 |
---|---|---|
committer | Christopher J. Cain <cjcain@us.ibm.com> | 2016-10-14 17:14:58 -0400 |
commit | 5cca3dd9adc644ef8cb7bb251f6b43e85ba9f780 (patch) | |
tree | 078f81c18618ea0bb01d4e91a77a2db17dbb1123 /src/occ_405/dcom | |
parent | 609700b4ae20895c3d0713c8cfcb4717915b2bcd (diff) | |
download | talos-occ-5cca3dd9adc644ef8cb7bb251f6b43e85ba9f780.tar.gz talos-occ-5cca3dd9adc644ef8cb7bb251f6b43e85ba9f780.zip |
OCC Active state changes required for Simics
Change-Id: Ic6e65bcddaefd5213042707feffcf1272133e532
RTC: 161266
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31190
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src/occ_405/dcom')
-rw-r--r-- | src/occ_405/dcom/dcomMasterTx.c | 17 | ||||
-rw-r--r-- | src/occ_405/dcom/dcomSlaveRx.c | 13 | ||||
-rwxr-xr-x | src/occ_405/dcom/dcom_thread.c | 14 |
3 files changed, 26 insertions, 18 deletions
diff --git a/src/occ_405/dcom/dcomMasterTx.c b/src/occ_405/dcom/dcomMasterTx.c index 58af809..08edef8 100644 --- a/src/occ_405/dcom/dcomMasterTx.c +++ b/src/occ_405/dcom/dcomMasterTx.c @@ -58,6 +58,11 @@ uint32_t G_pbax_packet = 0xffffffff; // Used to keep count of number of APSS data collection fails. uint16_t G_apss_fail_updown_count = 0x0000; +#ifdef DEBUG_APSS_SEQ +// used to keep track of the APSS complete sequence number +extern uint32_t G_savedCompleteSeq; +#endif + // Function Specification // // Name: dcom_build_slv_inbox @@ -258,10 +263,15 @@ void task_dcom_tx_slv_inbox( task_t *i_self) // Did APSS power complete? if( l_pwr_meas == TRUE ) { -#ifdef DCOM_DEBUG +#if !defined(DEBUG_APSS_SEQ) && defined(DCOM_DEBUG) uint64_t l_end = ssx_timebase_get(); DCOM_DBG("Got APSS after waiting %d us\n",(int)( (l_end-l_start) / ( SSX_TIMEBASE_FREQUENCY_HZ / 1000000 ) )); #endif +#if defined(DEBUG_APSS_SEQ) && !defined(DCOM_DEBUG) + uint64_t l_end = ssx_timebase_get(); + DCOM_DBG("Got APSS after waiting %d us (complete seq %d)\n", + (int)( (l_end-l_start) / ( SSX_TIMEBASE_FREQUENCY_HZ / 1000000 ) ), G_savedCompleteSeq); +#endif APSS_SUCCESS(); @@ -371,6 +381,7 @@ void task_dcom_tx_slv_inbox( task_t *i_self) // Request created at least once L_bce_slv_inbox_tx_request_created_once = TRUE; + DCOM_DBG("4.1.1 Scheduling G_slv_inbox_tx_pba_request"); l_ssxrc = bce_request_schedule(&G_slv_inbox_tx_pba_request); // Actual copying if(l_ssxrc != SSX_OK) @@ -397,9 +408,7 @@ void task_dcom_tx_slv_inbox( task_t *i_self) else { // check time and break out if we reached limit - // TODO: shrink this later depending on how much - // work we are doing in RTL - if ((ssx_timebase_get() - l_start) < SSX_MICROSECONDS(150)) + if ((ssx_timebase_get() - l_start) < SSX_MICROSECONDS(DCOM_TX_APSS_WAIT_TIME)) { continue; } diff --git a/src/occ_405/dcom/dcomSlaveRx.c b/src/occ_405/dcom/dcomSlaveRx.c index f608291..3c93a89 100644 --- a/src/occ_405/dcom/dcomSlaveRx.c +++ b/src/occ_405/dcom/dcomSlaveRx.c @@ -122,7 +122,7 @@ void task_dcom_rx_slv_inbox( task_t *i_self) #ifdef DCOM_DEBUG uint64_t l_end = ssx_timebase_get(); - DCOM_DBG("Got Doorbell from Master after waiting %d us\n",(int)( (l_end-l_start) / ( SSX_TIMEBASE_FREQUENCY_HZ / 1000000 ) )); + DCOM_DBG("1.1 Got Doorbell from Master after waiting %d us\n",(int)( (l_end-l_start) / ( SSX_TIMEBASE_FREQUENCY_HZ / 1000000 ) )); #endif G_dcomTime.slave.doorbellStopWaitRx = ssx_timebase_get(); uint64_t l_delta = G_dcomTime.slave.doorbellStopWaitRx - G_dcomTime.slave.doorbellStartWaitRx; @@ -288,8 +288,9 @@ void task_dcom_rx_slv_inbox( task_t *i_self) { TRAC_INFO("Only got %d bytes from master",l_bytes); } + // Check time and break out if we reached limit - if ((ssx_timebase_get() - l_start) < SSX_MICROSECONDS(100)) // TODO: Shrink this down + if ((ssx_timebase_get() - l_start) < SSX_MICROSECONDS(100)) { continue; } @@ -352,7 +353,7 @@ uint32_t dcom_rx_slv_inbox_doorbell( void ) &l_read ); - DCOM_DBG("Doorbell (Multicast) Read: %d bytes\n",l_read); + DCOM_DBG("1.0.1 Doorbell (Multicast) Read: %d bytes\n",l_read); // We got an error reading from the PBAX, return to caller if ( l_pbarc != 0 ) @@ -374,9 +375,11 @@ uint32_t dcom_rx_slv_inbox_doorbell( void ) { if(l_bytes_so_far){ G_dcomTime.slave.doorbellErrorFlags.incomplete = 1; + DCOM_DBG("dcom_rx_slv_inbox_doorbell: incomplete data"); } else{ G_dcomTime.slave.doorbellErrorFlags.timeout = 1; + DCOM_DBG("dcom_rx_slv_inbox_doorbell: timeout"); } break; } @@ -484,7 +487,7 @@ void task_dcom_wait_for_master( task_t *i_self) { if (L_first_doorbell_rcvd) { - // We didn't get a doorbell from the Master, increment our + // We didn't get a doorbell from the Master, increment our // counter L_no_master_doorbell_cnt++; @@ -547,7 +550,7 @@ void task_dcom_wait_for_master( task_t *i_self) } } - if (L_no_master_doorbell_cnt == APSS_DATA_FAIL_MAX) + if (L_no_master_doorbell_cnt == APSS_DATA_FAIL_MAX) { // If we still don't get a doorbell from the Master for this // long, we will request a reset diff --git a/src/occ_405/dcom/dcom_thread.c b/src/occ_405/dcom/dcom_thread.c index f6eda92..93da66b 100755 --- a/src/occ_405/dcom/dcom_thread.c +++ b/src/occ_405/dcom/dcom_thread.c @@ -53,9 +53,6 @@ SsxSemaphore G_dcomThreadWakeupSem; // happen more often than the 1-second that other threads run // at. // -// This thread currently runs ~1ms, based on the RTL loop of -// 250us. -// // FWIW -- It is pointless to set this thread to run any more // often than the length of the RTL loop, since it is acting // on data passed back and forth via that loop. @@ -68,16 +65,15 @@ void Dcom_thread_routine(void *arg) SsxTimer l_timeout_timer; errlHndl_t l_errlHndl = NULL; // -------------------------------------------------- - // Create a timer that pops every 10 seconds to wake up + // Create a timer that pops every 7 seconds to wake up // this thread, in case a semaphore never gets posted. - // TODO: Is this really needed? // -------------------------------------------------- ssx_timer_create(&l_timeout_timer, (SsxTimerCallback) ssx_semaphore_post, (void *) &G_dcomThreadWakeupSem); ssx_timer_schedule(&l_timeout_timer, - SSX_SECONDS(10), - SSX_SECONDS(10)); + SSX_SECONDS(7), + SSX_SECONDS(7)); DCOM_TRAC_INFO("DCOM Thread Started"); for(;;) @@ -168,9 +164,9 @@ void Dcom_thread_routine(void *arg) // SSX Sleep // -------------------------------------------------- // Even if semaphores are continually posted, there is no reason - // for us to run this thread any more often than once every 250us + // for us to run this thread any more often than once every tick // so we don't starve any other thread - ssx_sleep(SSX_MICROSECONDS(250)); + ssx_sleep(SSX_MICROSECONDS(MICS_PER_TICK)); } } |