summaryrefslogtreecommitdiffstats
path: root/src/occ/amec
diff options
context:
space:
mode:
authorGuillermo J Silva <guilsilv@us.ibm.com>2014-12-17 14:28:48 -0600
committerGuillermo J. Silva <guilsilv@us.ibm.com>2014-12-17 15:00:52 -0600
commit7d74758c1ccb09a86510821cf8f6ed94a17c4ec3 (patch)
treec5c05551c1aeef05354fae2f1166f23bd4fd2948 /src/occ/amec
parent6a2a3dd2c8f2484b920bf6f1f25003bd3d428557 (diff)
downloadtalos-occ-7d74758c1ccb09a86510821cf8f6ed94a17c4ec3.tar.gz
talos-occ-7d74758c1ccb09a86510821cf8f6ed94a17c4ec3.zip
Fix issues with state machine handler
Change-Id: I6cc2af8530aa106d7c231ce2c45dd5c7e7576885 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14958 Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: Guillermo J. Silva <guilsilv@us.ibm.com> Tested-by: Guillermo J. Silva <guilsilv@us.ibm.com>
Diffstat (limited to 'src/occ/amec')
-rwxr-xr-xsrc/occ/amec/amec_analytics.c46
-rwxr-xr-xsrc/occ/amec/amec_health.c9
-rwxr-xr-xsrc/occ/amec/amec_tasks.c8
3 files changed, 23 insertions, 40 deletions
diff --git a/src/occ/amec/amec_analytics.c b/src/occ/amec/amec_analytics.c
index 70c4c3e..77f6582 100755
--- a/src/occ/amec/amec_analytics.c
+++ b/src/occ/amec/amec_analytics.c
@@ -162,14 +162,19 @@ void amec_analytics_main(void)
/* Code */
/*------------------------------------------------------------------------*/
+ // This functions is disabled by default. Need to enable analytics via
+ // Amester.
+ if (g_amec->stream_vector_rate == 0xFF)
+ {
+ return;
+ }
+
g_amec->packednapsleep[0] = (g_amec->proc[0].winkcnt2ms.sample<<8) +
g_amec->proc[0].sleepcnt2ms.sample;
- g_amec->packednapsleep[1] = (g_amec->proc[1].winkcnt2ms.sample<<8) +
- g_amec->proc[1].sleepcnt2ms.sample;
- g_amec->packednapsleep[2] = (g_amec->proc[2].winkcnt2ms.sample<<8) +
- g_amec->proc[2].sleepcnt2ms.sample;
- g_amec->packednapsleep[3] = (g_amec->proc[3].winkcnt2ms.sample<<8) +
- g_amec->proc[3].sleepcnt2ms.sample;
+ // There are no other elements in proc[] array other than element 0
+ g_amec->packednapsleep[1] = 0;
+ g_amec->packednapsleep[2] = 0;
+ g_amec->packednapsleep[3] = 0;
switch (g_amec->analytics_group)
{
@@ -442,33 +447,8 @@ void amec_analytics_main(void)
tempaccum = g_amec->proc[0].pwr250usmem.accumulator - tempaccum; // total accumulation over 2msec
tempaccum = tempaccum >> g_amec->stream_vector_rate;
- tempreg = ((UINT16)tempaccum) << 8; // upper byte
-
- tempaccum = g_amec->proc[1].pwr250usmem.src_accum_snapshot; // load accumulator from last 2msec
- g_amec->proc[1].pwr250usmem.src_accum_snapshot = g_amec->proc[1].pwr250usmem.accumulator; // save current accum state for next 2msec
- tempaccum = g_amec->proc[1].pwr250usmem.accumulator - tempaccum; // total accumulation over 2msec
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
- tempaccum = 0; // force to 0 until master OCC collects
-
- tempreg = tempreg | (0xff & ((UINT16)tempaccum));
- g_amec->analytics_array[7] = tempreg;
-
- tempaccum = g_amec->proc[2].pwr250usmem.src_accum_snapshot; // load accumulator from last 2msec
- g_amec->proc[2].pwr250usmem.src_accum_snapshot = g_amec->proc[2].pwr250usmem.accumulator; // save current accum state for next 2msec
- tempaccum = g_amec->proc[2].pwr250usmem.accumulator - tempaccum; // total accumulation over 2msec
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
- tempaccum = 0; // force to 0 until master OCC collects
-
- tempreg = ((UINT16)tempaccum) << 8; // upper byte
-
- tempaccum = g_amec->proc[3].pwr250usmem.src_accum_snapshot; // load accumulator from last 2msec
- g_amec->proc[3].pwr250usmem.src_accum_snapshot = g_amec->proc[3].pwr250usmem.accumulator; // save current accum state for next 2msec
- tempaccum = g_amec->proc[3].pwr250usmem.accumulator - tempaccum; // total accumulation over 2msec
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
- tempaccum = 0; // force to 0 until master OCC collects
-
- tempreg = tempreg | (0xff & ((UINT16)tempaccum));
- g_amec->analytics_array[8] = tempreg;
+ g_amec->analytics_array[7] = (UINT16)tempaccum;
+ g_amec->analytics_array[8] = 0;
// Now begins the per processor unique data
tempreg = (g_amec->analytics_total_chips) << 8; // upper byte
diff --git a/src/occ/amec/amec_health.c b/src/occ/amec/amec_health.c
index 21c3828..75a3b2b 100755
--- a/src/occ/amec/amec_health.c
+++ b/src/occ/amec/amec_health.c
@@ -914,9 +914,12 @@ void amec_health_check_proc_timeout()
TRAC_ERR("OHA_Status_Reg[0x%08X] PM_State_Hist_Reg[0x%08X]",
l_core_data_ptr->oha.oha_ro_status_reg.words.low_order,
l_core_data_ptr->pcb_slave.pm_history.words.high_order);
- TRAC_ERR("SensorV0[0x%016X] SensorV1[0x%016X]",
- l_core_data_ptr->dts_cpm.sensors_v0.value,
- l_core_data_ptr->dts_cpm.sensors_v1.value);
+
+ TRAC_ERR("SensorV0[0x%08X%08X] SensorV1[0x%08X%08X]",
+ (uint32_t)(l_core_data_ptr->dts_cpm.sensors_v0.value >> 32),
+ (uint32_t)(l_core_data_ptr->dts_cpm.sensors_v0.value & 0x00000000ffffffffull),
+ (uint32_t)(l_core_data_ptr->dts_cpm.sensors_v1.value >> 32),
+ (uint32_t)(l_core_data_ptr->dts_cpm.sensors_v1.value & 0x00000000ffffffffull));
/* @
* @errortype
diff --git a/src/occ/amec/amec_tasks.c b/src/occ/amec/amec_tasks.c
index 3181771..096fd0b 100755
--- a/src/occ/amec/amec_tasks.c
+++ b/src/occ/amec/amec_tasks.c
@@ -201,16 +201,16 @@ void amec_generic_smh(const smh_tbl_t * i_smh_tbl,
// Increment the state(s) of the AMEC State Machine
// ------------------------------------------------------
- // Bump the states as final undertaking before task ends
- i_smh_state->state = AMEC_STATE_NEXT(i_smh_state);
+ // Bump the state as final undertaking before task ends
+ AMEC_STATE_NEXT(i_smh_state);
if(AMEC_INITIAL_STATE == i_smh_state->state)
{
// Only bump the substate when "state" has wrapped
- i_smh_state->substate = AMEC_SUBSTATE_NEXT(i_smh_state);
+ AMEC_SUBSTATE_NEXT(i_smh_state);
if(AMEC_INITIAL_STATE == i_smh_state->substate)
{
// Only bump the substate when "state" & "substate" have wrapped
- i_smh_state->sub_substate = AMEC_SUB_SUBSTATE_NEXT(i_smh_state);
+ AMEC_SUB_SUBSTATE_NEXT(i_smh_state);
}
}
OpenPOWER on IntegriCloud