summaryrefslogtreecommitdiffstats
path: root/src/occ_405/amec
diff options
context:
space:
mode:
authorAndres Lugo-Reyes <aalugore@us.ibm.com>2017-08-02 12:55:35 -0500
committerWilliam A. Bryan <wilbryan@us.ibm.com>2017-08-04 15:58:07 -0400
commitff487313bea8ccd3c0a9a523860a6fe406d925bb (patch)
treed1ab384df91b936a53e7da086fd664fdcf5fd781 /src/occ_405/amec
parentd65050138474c8450121127683ee9657ac979246 (diff)
downloadtalos-occ-ff487313bea8ccd3c0a9a523860a6fe406d925bb.tar.gz
talos-occ-ff487313bea8ccd3c0a9a523860a6fe406d925bb.zip
24x7 enable/disable counters
Change-Id: Ic6c4f85af0f7f6a51e30ce3d92e957d3ad216644 RTC:167812 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44132 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/amec')
-rw-r--r--src/occ_405/amec/amec_sensors_fw.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/occ_405/amec/amec_sensors_fw.c b/src/occ_405/amec/amec_sensors_fw.c
index fb3b9fe..daf9fd7 100644
--- a/src/occ_405/amec/amec_sensors_fw.c
+++ b/src/occ_405/amec/amec_sensors_fw.c
@@ -48,6 +48,7 @@
/******************************************************************************/
/* Globals */
/******************************************************************************/
+extern bool G_24x7_disabled;
//*************************************************************************
// Code
@@ -97,8 +98,12 @@ void task_gpe_timings(task_t * i_task)
errlHndl_t l_err = NULL;
int rc = 0;
int rc2 = 0;
+ static uint8_t L_idleTicks = 0;
+ static uint8_t L_busyTicks = 0;
static bool L_first_call = TRUE;
- bool l_gpe0_idle, l_gpe1_idle;
+ bool l_gpe0_idle = TRUE;
+ bool l_gpe1_idle = TRUE;
+
static uint8_t L_consec_trace_count[2] = {0};
gpe_gpenxiramdbg_t xsr_sprg0 = {0};
gpe_gpenxiramedr_t ir_edr = {0};
@@ -241,6 +246,39 @@ void task_gpe_timings(task_t * i_task)
commitErrl( &l_err );
}
+ // Process GPEs timings and determine whether to disable/enable 24x7
+ if(l_gpe0_idle && l_gpe1_idle)
+ {
+ // Reset how many consecutive ticks we were busy for.
+ L_busyTicks = 0;
+
+ // If we were idle for at least 16 consecutive ticks, enable 24x7
+ if( L_idleTicks >= 15 )
+ {
+ G_24x7_disabled = FALSE;
+ }
+ else
+ {
+ L_idleTicks++;
+ }
+ }
+ else
+ {
+ // Reset how many consecutive ticks we were idle for
+ L_idleTicks = 0;
+
+ // If we were busy for at least 2 consecutive ticks, disable 24x7
+ if( L_busyTicks >= 1 )
+ {
+ G_24x7_disabled = TRUE;
+ INCREMENT_ERR_HISTORY(ERRH_24X7_DISABLED);
+ }
+ else
+ {
+ L_busyTicks++;
+ }
+ }
+
L_first_call = FALSE;
}
OpenPOWER on IntegriCloud