summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbroyles <mbroyles@us.ibm.com>2019-03-07 12:16:34 -0600
committerMartha Broyles <mbroyles@us.ibm.com>2019-03-14 08:35:09 -0500
commitf8e8d60e453c5e3c1c6ea4aa4e62e8b3186521c6 (patch)
tree2f67944ba9d5cb8376d77209e777a0a1f718f19b
parentd10b665d0f1b5c8b779bcd88dbf71077fe105256 (diff)
downloadtalos-occ-f8e8d60e453c5e3c1c6ea4aa4e62e8b3186521c6.tar.gz
talos-occ-f8e8d60e453c5e3c1c6ea4aa4e62e8b3186521c6.zip
Delete un-used Amester functions
Change-Id: I45024c5a87bbcc828b68141048cd1564a98a3b64 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73022 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sheldon Bailey <baileysh@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
-rwxr-xr-xsrc/occ_405/amec/amec_amester.c118
-rw-r--r--src/occ_405/amec/amec_amester.h6
-rwxr-xr-xsrc/occ_405/amec/amec_analytics.c585
-rwxr-xr-xsrc/occ_405/amec/amec_analytics.h47
-rw-r--r--src/occ_405/amec/amec_init.c23
-rwxr-xr-xsrc/occ_405/amec/amec_slave_smh.c3
-rwxr-xr-xsrc/occ_405/amec/amec_sys.h31
-rw-r--r--src/occ_405/topfiles.mk5
8 files changed, 8 insertions, 810 deletions
diff --git a/src/occ_405/amec/amec_amester.c b/src/occ_405/amec/amec_amester.c
index 55a9cca..21e5265 100755
--- a/src/occ_405/amec/amec_amester.c
+++ b/src/occ_405/amec/amec_amester.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -706,9 +706,7 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
/* Local variables */
/*------------------------------------------------------------------------*/
uint8_t l_rc,temp1,temp2;
- uint16_t l_resp_length = *io_resp_length;
uint16_t i,j,cc,idx,temp16;
- uint16_t k;
uint32_t temp32a;
uint32_t *temp32;
/*------------------------------------------------------------------------*/
@@ -717,38 +715,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
switch (i_msg->au8CmdData_ptr[0])
{
- case 0x03: // CPU(s) Present Bit Mask
- // The CPU Present Bit Mask is now being generated by the
- // PROC component of OCC.
-
- // Check length
- if(l_resp_length < 2)
- {
- l_rc = COMPCODE_PARAM_OUT_OF_RANGE;
- break;
- }
-
- o_resp[0] = CONVERT_UINT32_UINT8_UPPER_HIGH( G_present_hw_cores);
- o_resp[1] = CONVERT_UINT32_UINT8_UPPER_LOW( G_present_hw_cores);
- *io_resp_length = 2;
- l_rc = COMPCODE_NORMAL;
- break;
-
- case 0x04: // Get last throttle value sent to CPU 0. DEPRECATED.
- *io_resp_length = 0;
- l_rc = COMPCODE_PARAM_OUT_OF_RANGE;
- break;
-
- case 0x05: // Get AME enable/disable flag (old style interface...do not use), no support
- *io_resp_length = 0;
- l_rc = COMPCODE_PARAM_OUT_OF_RANGE;
- break;
-
- case 0x06: // Get new PTVR (Power Threshold Vector Request), no support
- *io_resp_length = 0;
- l_rc = COMPCODE_PARAM_OUT_OF_RANGE;
- break;
-
case 0x07: // Write individual AME parameters
switch (i_msg->au8CmdData_ptr[1])
{
@@ -784,33 +750,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
break;
};
- case 22: // parameter 22: Analytics parameters
- {
- g_amec->analytics_group=i_msg->au8CmdData_ptr[2]; // Set group
- g_amec->analytics_chip=i_msg->au8CmdData_ptr[3]; // Select which chip to analyze
- g_amec->analytics_option=i_msg->au8CmdData_ptr[4]; // Select which option
- g_amec->analytics_total_chips=i_msg->au8CmdData_ptr[5]; // Select total number of chips
- g_amec->analytics_slot=i_msg->au8CmdData_ptr[6]; // Select time slot to read data
- o_resp[0]=i_msg->au8CmdData_ptr[2];
- o_resp[1]=i_msg->au8CmdData_ptr[3];
- o_resp[2]=i_msg->au8CmdData_ptr[4];
- o_resp[3]=i_msg->au8CmdData_ptr[5];
- o_resp[4]=i_msg->au8CmdData_ptr[6];
- *io_resp_length=5;
- l_rc = COMPCODE_NORMAL;
- break;
- }
-
- case 23: // parameter 23: CPM calibration parameters
- {
- // g_amec->cpms_enabled=i_msg->au8CmdData_ptr[2]; // Enable CPMs
- o_resp[0]=i_msg->au8CmdData_ptr[2];
- *io_resp_length=1;
- l_rc = COMPCODE_NORMAL;
- break;
- }
-
-
case 29: // parameter 29: Control vector recording modes and stream rates.
{
g_amec->stream_vector_rate=255; // First step is to set an invalid rate so no recording done at all
@@ -820,24 +759,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
g_amec->stream_vector_delay=(uint32_t)CONVERT_UINT8_ARRAY_UINT16(i_msg->au8CmdData_ptr[7],i_msg->au8CmdData_ptr[8]);
g_amec->stream_vector_mode=i_msg->au8CmdData_ptr[2]; // Choose mode
- switch (g_amec->stream_vector_group)
- {
- case 45: //group 45 decimal (amec_analytics support)
- g_amec->stream_vector_map[0]=0; // Leave space for 250usec time stamp
- k = 1;
- for (i=0; i<=(STREAM_VECTOR_SIZE_EX-2); i++)
- {
- g_amec->stream_vector_map[k++] = &g_amec->analytics_array[i];
- }
- //gpEMP->stream_vector_map[64]=(void *) 0xffffffff; // Termination of partial vector
- g_amec->analytics_group=45;
- g_amec->analytics_bad_output_count=2; // drop first 2 frames of output
- break;
-
- default:
- break;
- }
-
// Final step is to set a valid rate to begin recording at
g_amec->stream_vector_rate=i_msg->au8CmdData_ptr[3]; // Choose stream rate
g_amec->recordflag=1; // Recording is now valid
@@ -846,15 +767,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
break;
}
- case 64: // support for THREADMODE group 44 recording
- g_amec->analytics_threadmode=i_msg->au8CmdData_ptr[2];
- g_amec->analytics_threadcountmax=i_msg->au8CmdData_ptr[3];
- o_resp[0]=i_msg->au8CmdData_ptr[2];
- o_resp[1]=i_msg->au8CmdData_ptr[3];
- *io_resp_length=2;
- l_rc = COMPCODE_NORMAL;
- break;
-
default:
*io_resp_length = 0;
l_rc = COMPCODE_PARAM_OUT_OF_RANGE;
@@ -897,27 +809,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
break;
};
- case 22: // parameter 22: Analytics parameters
- o_resp[0]=g_amec->analytics_group;
- o_resp[1]=g_amec->analytics_chip;
- o_resp[2]=g_amec->analytics_option;
- o_resp[3]=g_amec->analytics_total_chips;
- o_resp[4]=g_amec->analytics_slot;
- *io_resp_length=5;
- l_rc = COMPCODE_NORMAL;
- break;
-
- case 23: // parameter 23: CPM parameters
- // o_resp[0]=g_amec->cpms_enabled;
- // o_resp[1]=g_amec->cpm_active_core;
- // o_resp[2]=g_amec->cpm_cal_state;
- // o_resp[3]=g_amec->cpm_core_state;
- // o_resp[4]=g_amec->cpm_measure_state;
- // o_resp[5]=g_amec->cpm_cal_count;
- *io_resp_length=6;
- l_rc = COMPCODE_NORMAL;
- break;
-
case 29: // parameter 29: Stream recording control parameters
o_resp[0]=(uint8_t)(g_amec->stream_vector_mode);
o_resp[1]=(uint8_t)(g_amec->stream_vector_rate);
@@ -995,13 +886,6 @@ uint8_t amester_manual_throttle( const IPMIMsg_t * i_msg,
l_rc = COMPCODE_NORMAL;
break;
- case 64: // support for THREADMODE group 45 recording
- o_resp[0]=(uint8_t)(g_amec->analytics_threadmode);
- o_resp[1]=(uint8_t)(g_amec->analytics_threadcountmax);
- *io_resp_length=2;
- l_rc=COMPCODE_NORMAL;
- break;
-
default:
*io_resp_length = 0;
l_rc = COMPCODE_PARAM_OUT_OF_RANGE;
diff --git a/src/occ_405/amec/amec_amester.h b/src/occ_405/amec/amec_amester.h
index b71782a..53bcac2 100644
--- a/src/occ_405/amec/amec_amester.h
+++ b/src/occ_405/amec/amec_amester.h
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/occ/amec/amec_amester.h $ */
+/* $Source: src/occ_405/amec/amec_amester.h $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -108,8 +108,6 @@
#define INJECTION_BUFFER_SIZE 32 // Size of injection buffer (must be a power of 2)
#define STREAM_VECTOR_SIZE_EX 74 // # of 16 bit elements in a stream vector
#define STREAM_BUFFER_SIZE (40*1*STREAM_VECTOR_SIZE_EX) // Stream buffer size in 16 bit samples for recording real time data to stream to Amester
-#define MAX_SENSORS_ANALYTICS 134 // Maximum sensors making up the analytics group 45 (includes all Centaur data & L4 data & supports 12 cores)
-#define MSA MAX_SENSORS_ANALYTICS
#define OCA_MAX_ENTRIES 0 // no POWER7 OCA on POWER8
#define AMEC_TB_SENSORS_MAX 40
diff --git a/src/occ_405/amec/amec_analytics.c b/src/occ_405/amec/amec_analytics.c
deleted file mode 100755
index d715a72..0000000
--- a/src/occ_405/amec/amec_analytics.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/occ_405/amec/amec_analytics.c $ */
-/* */
-/* OpenPOWER OnChipController Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-
-//*************************************************************************
-// Includes
-//*************************************************************************
-#include <amec_amester.h>
-#include <amec_sys.h>
-#include <proc_data.h>
-#include <ssx.h>
-
-//*************************************************************************
-// Externs
-//*************************************************************************
-
-//*************************************************************************
-// Macros
-//*************************************************************************
-
-//*************************************************************************
-// Defines/Enums
-//*************************************************************************
-
-//*************************************************************************
-// Structures
-//*************************************************************************
-
-//*************************************************************************
-// Globals
-//*************************************************************************
-extern uint8_t G_occ_interrupt_type;
-
-//*************************************************************************
-// Function Prototypes
-//*************************************************************************
-
-//*************************************************************************
-// Functions
-//*************************************************************************
-
-void amec_analytics_sb_recording(void)
-{
- /*------------------------------------------------------------------------*/
- /* Local Variables */
- /*------------------------------------------------------------------------*/
- uint16_t temp16 = 0;
- uint8_t k = 0;
-
- /*------------------------------------------------------------------------*/
- /* Code */
- /*------------------------------------------------------------------------*/
-
- // Increment the internal counter here per 250us tick
- g_amec->r_cnt++;
-
- // Need to have reached modulo time interval to record output and also just
- // after the analytics_slot was reached.
- temp16 = g_amec->r_cnt - g_amec->analytics_slot;
- temp16 = ((1<<g_amec->stream_vector_rate)-1) & temp16;
-
- if ((temp16 == 0) && (g_amec->recordflag == 1))
- {
- if (g_amec->stream_vector_mode == 0) // If zero, see if timer running prior to beginning a capture
- {
- if (g_amec->stream_vector_delay > 1)
- {
- g_amec->stream_vector_delay = g_amec->stream_vector_delay - 1;
- } else
- {
- if (g_amec->stream_vector_delay == 1)
- {
- g_amec->stream_vector_mode = 1; // Turn on 1 shot recording
- g_amec->write_stream_index = 0; // Reset to start of buffer
- g_amec->stream_vector_delay = 0; // Disable any further delays
-
- // support L4 state machine and tracing being synchronized
- if (g_amec->reset_prep != 0)
- {
- g_amec->cent_l4_state[g_amec->probe_l4_centaur] = 0; // Start with L4 state machine set to first state (L4_S0)
- g_amec->cent_l4_ipl_state[g_amec->probe_l4_centaur] = 0; // Start with L4 IPL state machine set to first state (IPL_L4_S0)
- g_amec->reset_prep = 0; // Turn off indicator of TMGT wanting to reset the OCC, which will start L4 state machine
- g_amec->l4_powerdown_requestm = 1; // Raise indicator that the master OCC wants to carry out an L4 power down
- }
- }
- }
- } else
- {
- // Check is discarding initial frames due to analytics data getting averaged
- if (g_amec->analytics_bad_output_count == 0)
- {
- // Stream buffer recording function done every 250usec * 2^(stream_vector_rate)
- g_amec->ptr_stream_buffer[g_amec->write_stream_index] = (uint16_t)g_amec->r_cnt;
- g_amec->write_stream_index++;
- // WARNING -> The size of the vector recorded must be a precise multiple
- // of the size of the entire stream buffer.
- for (k = 1; k < STREAM_VECTOR_SIZE_EX; k++)
- {
- if (g_amec->stream_vector_map[k] == (void *)0xffffffff)
- {
- k = STREAM_VECTOR_SIZE_EX; // Terminate as partial vector complete
- } else
- {
- temp16 = *((uint16_t * )(g_amec->stream_vector_map[k]));
- g_amec->ptr_stream_buffer[g_amec->write_stream_index] = (uint16_t)temp16;
- g_amec->write_stream_index++;
- }
- }
- if (g_amec->write_stream_index >= STREAM_BUFFER_SIZE)
- {
- g_amec->write_stream_index = 0; // Reset to start of buffer
- if (g_amec->stream_vector_mode == 1)
- {
- // If single shot, just rotate write ptr in last record
- g_amec->write_stream_index = STREAM_BUFFER_SIZE - STREAM_VECTOR_SIZE_EX;
- }
- }
- } else
- {
- g_amec->analytics_bad_output_count--; // decrement bad output counter
- }
- }
- }
-}
-
-/*
- Implementation note:
-
- amec_analytics_main is called every 2 ms from an AMEC task.
-
- This routine uses the sensor accumulator to compute average values
- over 2ms. Normally, the sensor accumulator is 64-bit, but it is
- enough to save and use just 32-bit for the purposes of computing the
- 2 ms average, since there is no danger of wrapping the accumulator
- for 16-bit sensor values. The key is that unsigned subtraction
- between any two accumulator values, gives you a valid change in the
- accumulator, even when the accumulator overflows and wraps back to
- 0, as long as the total change is small enough to fit in the
- accumulators range (32-bit). 8 updates (in 2 ms) * 2^16-1 < 2^32-1,
- so in 2ms, the accumulator's range of values cannot be exceeded.
-
- The code below uses cast from 64-bit to 32-bit to make clear the intention.
-
- */
-void amec_analytics_main(void)
-{
- /*------------------------------------------------------------------------*/
- /* Local Variables */
- /*------------------------------------------------------------------------*/
- uint8_t i = 0;
- uint8_t j = 0;
- uint8_t k = 0;
- uint8_t l = 0;
- uint8_t m = 0;
- uint16_t temp16 = 0;
- uint16_t tempreg = 0;
- uint32_t temp32 = 0;
- uint32_t tempaccum = 0;
-
- /*------------------------------------------------------------------------*/
- /* Code */
- /*------------------------------------------------------------------------*/
-
- // This functions is disabled by default. Need to enable analytics via
- // Amester.
- if (g_amec->stream_vector_rate == 0xFF)
- {
- return;
- }
-
- switch (g_amec->analytics_group)
- {
- case 45: // Group 45
-
- // Every 2msec (250usec * 2^stream_rate, default stream_rate=3), perform averaging of sensors.
- // Averaging is required because many sensors are updated every
- // 2msec and if they aren't properly averaged, those updates
- // are lost in the final analytics output.
- // The analytics group should be a correct average of the higher
- // frequency sensor updates.
- // (wait until OCC master collects all chips data)
- for (i=0; i<1; i++)
- {
- g_amec->g44_avg[(i*MSA)+0] = (UINT32)g_amec->sys.todclock0.sample; // ptr to high 16 bits of 48bit TOD clock
- g_amec->g44_avg[(i*MSA)+2] = (UINT32)g_amec->sys.todclock1.sample; // ptr to middle 16 bits of 48 bit TOD clock
- g_amec->g44_avg[(i*MSA)+4] = (UINT32)g_amec->sys.todclock2.sample; // ptr to low 16 bits of 48 bit TOD clock
-
- // load pwrsys accum from last 2msec
- tempaccum = g_amec->sys.pwrsys.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->sys.pwrsys.src_accum_snapshot =
- (uint32_t)g_amec->sys.pwrsys.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->sys.pwrsys.accumulator
- - tempaccum;
- tempaccum = tempaccum>>3; // divide by 8
- g_amec->g44_avg[(i*MSA)+6] = g_amec->g44_avg[(i*MSA)+6] +
- tempaccum;
-
- // load pwr250usgpu accum from last 2msec
- tempaccum = g_amec->sys.pwr250usgpu.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->sys.pwr250usgpu.src_accum_snapshot =
- (uint32_t)g_amec->sys.pwr250usgpu.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->sys.pwr250usgpu.accumulator
- - tempaccum;
- tempaccum = tempaccum>>3; // divide by 8
- g_amec->g44_avg[(i*MSA)+8] = g_amec->g44_avg[(i*MSA)+8] +
- tempaccum;
-
- // load accumulator from last 2msec
- tempaccum = g_amec->proc[i].pwrproc.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->proc[i].pwrproc.src_accum_snapshot =
- (uint32_t)g_amec->proc[i].pwrproc.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->proc[i].pwrproc.accumulator
- - tempaccum;
- tempaccum = tempaccum>>3; // divide by 8
- g_amec->g44_avg[(i*MSA)+10] = g_amec->g44_avg[(i*MSA)+10] +
- tempaccum;
-
- // load accumulator from last 2msec
- tempaccum = g_amec->proc[i].pwr250usvdd.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->proc[i].pwr250usvdd.src_accum_snapshot =
- (uint32_t)g_amec->proc[i].pwr250usvdd.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->proc[i].pwr250usvdd.accumulator
- - tempaccum;
- tempaccum = tempaccum>>3;
- g_amec->g44_avg[(i*MSA)+11] = g_amec->g44_avg[(i*MSA)+11] +
- tempaccum;
-
- // load accumulator from last 2msec
- tempaccum = g_amec->proc[i].vrm[0].volt250us.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->proc[i].vrm[0].volt250us.src_accum_snapshot =
- (uint32_t)g_amec->proc[i].vrm[0].volt250us.accumulator;
- // total accumulation over 2msec
- tempaccum =
- (uint32_t)g_amec->proc[i].vrm[0].volt250us.accumulator
- - tempaccum;
- temp32 = tempaccum<<3; // Pi, Vdd
- tempreg = 4000;
- // Convert voltage from 100uV resolution to 6.25mV resolution
- tempreg = (UINT16)(UTIL_DIV32(temp32, tempreg));
- g_amec->g44_avg[(i*MSA)+12] = g_amec->g44_avg[(i*MSA)+12]
- + (UINT32)tempreg;
-
- // load accumulator from last 2msec
- tempaccum = g_amec->proc[i].vrm[1].volt250us.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->proc[i].vrm[1].volt250us.src_accum_snapshot =
- (uint32_t)g_amec->proc[i].vrm[1].volt250us.accumulator;
- // total accumulation over 2msec
- tempaccum =
- (uint32_t)g_amec->proc[i].vrm[1].volt250us.accumulator
- - tempaccum;
- temp32 = tempaccum<<3; // Pi, Vcs
- tempreg = 4000;
- // Convert voltage from 100uV resolution to 6.25mV resolution
- tempreg = (UINT16)(UTIL_DIV32(temp32, tempreg));
- g_amec->g44_avg[(i*MSA)+13] = g_amec->g44_avg[(i*MSA)+13] +
- (UINT32)tempreg;
-
- // load accumulator from last 2msec
- tempaccum = g_amec->proc[i].curvdd.src_accum_snapshot;
- // save current accum state for next 2msec
- g_amec->proc[i].curvdd.src_accum_snapshot =
- (uint32_t)g_amec->proc[i].curvdd.accumulator;
- tempaccum = (uint32_t)g_amec->proc[i].curvdd.accumulator
- - tempaccum; // total accumulation over 2msec
- tempaccum = tempaccum>>3;
- g_amec->g44_avg[(i*MSA)+14] = g_amec->g44_avg[(i*MSA)+14] +
- tempaccum/100;
- // hottest processor core temperature (average)
- g_amec->g44_avg[(i*MSA)+15] = g_amec->g44_avg[(i*MSA)+15] +
- (UINT32)g_amec->proc[i].tempprocavg.sample;
-
-// major changes below to accommodate Group 45
-
- l=16; // l = index offset
- for (j=0; j<8; j++) // Group 45 supports all 8 Centaurs per OCC
- {
- g_amec->g44_avg[(i*MSA)+l] = g_amec->g44_avg[(i*MSA)+l] +
- (UINT32)(g_amec->proc[i].memctl[j].mrd.sample/78); // memory read bandwidth
- l=l+1;
- }
- for (j=0; j<8; j++) // Group 45 supports all 8 Centaurs per OCC
- {
- g_amec->g44_avg[(i*MSA)+l] = g_amec->g44_avg[(i*MSA)+l] +
- (UINT32)(g_amec->proc[i].memctl[j].mwr.sample/78); // memory write bandwidth
- l=l+1;
- }
-
- for (j=0; j<8; j++) // Group 45 supports all 8 L4 caches per OCC
- {
- temp16 = g_amec->proc[i].memctl[j].centaur.portpair[0].perf.l4rd2ms;
- temp16 = temp16 + g_amec->proc[i].memctl[j].centaur.portpair[1].perf.l4rd2ms;
- g_amec->g44_avg[(i*MSA)+l] = g_amec->g44_avg[(i*MSA)+l] +
- (UINT32)(temp16/156); // L4 read bandwidth (/156 because two portpairs added together)
- l=l+1;
- }
-
- for (j=0; j<8; j++) // Group 45 supports all 8 L4 caches per OCC
- {
- temp16 = g_amec->proc[i].memctl[j].centaur.portpair[0].perf.l4wr2ms;
- temp16 = temp16 + g_amec->proc[i].memctl[j].centaur.portpair[1].perf.l4wr2ms;
- g_amec->g44_avg[(i*MSA)+l] = g_amec->g44_avg[(i*MSA)+l] +
- (UINT32)(temp16/156); // L4 write bandwidth (/156 because two portpairs added together)
- l=l+1;
- }
-
- m=0; // counter for actual configured # of cores - 1.
- for (j=0; j<12; j++) // Group 45 supports up to 12 cores to be configured per OCC chip
- {
- if (CORE_PRESENT(j))
- {
- //average frequency for this core (apply rounding for frequency for maximum 8 bit resolution): 20MHz resolution (Power8 is actually 33.25MHz steps)
- temp32 = (UINT32)g_amec->proc[i].core[j].freqa.sample/10; // 10MHz resolution
- temp16 = (UINT16)temp32;
- temp32 = temp32 >>1; // convert to 20MHz resolution
- if (temp16 & 1) temp32 = temp32+1; // if LSBit of 10MHz resolution value is a 1, then round the 20MHz resolution value up by 1
-
- g_amec->g44_avg[(i*MSA)+50+m] = g_amec->g44_avg[(i*MSA)+50+m] + temp32;
-
- m++; // increment configured core counter
- if (m > 11) j=12; // safeguard in case more than 12 configured cores.
- }
- }
-
- m=0; // counter for actual configured # of cores - 1.
- for (j=0; j<12; j++) // Group 45 supports up to 12 cores to be configured per OCC chip
- {
- if (CORE_PRESENT(j))
- {
- tempreg = 0; // keeps track of maximum thread utilization for this core
- temp32 = 0; // keeps track of average thread utilization for this core for non-zero threads (threadmode=0) or all threads (threadmode=1) or no average (threadmode=2)
- temp16 = 0; // keeps track of non-zero threads
- for (k=0; k < g_amec->analytics_threadcountmax; k++)
- {
- if (tempreg < g_amec->proc[i].core[j].thread[k].util4ms_thread)
- {
- tempreg = g_amec->proc[i].core[j].thread[k].util4ms_thread;
- }
- if ((0 < g_amec->proc[i].core[j].thread[k].util4ms_thread) ||
- (g_amec->analytics_threadmode != 0))
- {
- // accumulate for computing average
- temp32 = temp32 + g_amec->proc[i].core[j].thread[k].util4ms_thread;
- // increment counter of threads
- temp16 = temp16 + 1;
- }
- }
- g_amec->g44_avg[(i*MSA)+62+m] = g_amec->g44_avg[(i*MSA)+62+m] +
- (UINT32)(g_amec->proc[i].core[j].util.sample/50); // accumulate util sensor that feeds IPS and DPS algorithms for this core
-
- if (g_amec->analytics_threadmode == 2)
- {
- temp16 = tempreg; // Store maximum of all the threads on this core
- }
- if (g_amec->analytics_threadmode < 2)
- {
- if (temp16 > 0)
- {
- temp16 = (UINT16)(UTIL_DIV32(temp32, temp16)); // compute average utilization of all non-zero threads (threadmode=0) or all threads (threadmode=1)
- }
- }
- if (g_amec->analytics_threadmode == 3)
- {
- // accumulate average finish latency counter for this core
- temp16 = ((g_amec->proc[i].core[j].mcpifi4ms.sample) >>1);
- }
-
- temp32 = (UINT32)(temp16/25); // 0.25% utilization resolution
- temp32 = temp32 >>1; // convert to 0.5% utilization resolution
- if (temp16 & 1) temp32 = temp32+1; // if LSBit of 0.25% utilization resolution value is a 1, then round the 0.5% utilization resolution value up by 1
- g_amec->g44_avg[(i * MSA) + 74 + m] = g_amec->g44_avg[(i * MSA) + 74 + m] +
- (UINT32)(temp32); // accumulate average utilization or individual threads for this core or finish latency counter
- g_amec->g44_avg[(i * MSA) + 86 + m] = g_amec->g44_avg[(i * MSA) + 86 + m] +
- (UINT32)(g_amec->proc[i].core[j].ips4ms.sample / 50); // accumulate average MIPS for this core
- g_amec->g44_avg[(i * MSA) + 98 + m] = g_amec->g44_avg[(i * MSA) + 98 + m] +
- (UINT32)g_amec->proc[i].core[j].tempprocthermal.sample; // accumulate average temperature for this core
- g_amec->g44_avg[(i * MSA) + 110 + m] = 0; // No longer supported (was memory bandwidth)
- temp16 = ((g_amec->proc[i].core[j].mcpifd4ms.sample) / 100); // accumulate average busy latency counter for this core
- g_amec->g44_avg[(i * MSA) + 122 + m] = g_amec->g44_avg[(i * MSA) + 122 + m] + (UINT32)temp16;
- m++; // increment configured core counter
- if (m > 11) j = 12; // safeguard in case more than 12 configured cores.
- }
- } // End loop processing each core
- } // End loop processing each chip
-
- // Determine when to update final analytics_array
- temp16 = g_amec->r_cnt - g_amec->analytics_slot;
- temp16 = ((1<<g_amec->stream_vector_rate)-1) & temp16;
-
- // Have we completed this interval so that we can output?
- if (temp16 == 0)
- {
- // Now, update Group 45 analytics packed array
- switch (g_amec->analytics_thermal_offset)
- {
- case 1:
- if (g_amec->mst_ips_parms.active == 0)
- {
- tempreg = 0; // If not in IPS mode, return 0
- }
- else
- {
- tempreg = 127; // If in IPS, return constant indicating in IPS mode
- }
- if (tempreg > 127) tempreg = 127; // Saturate at 7 bit limit (508 seconds)
- tempreg = (tempreg) << 8; // upper byte
- break;
-
- case 2:
- tempreg=(g_amec->mst_ips_parms.active)<<8; // upper byte
- break;
-
- case 4:
- tempreg = (g_amec->proc[0].tempdimmthrm.sample) << 8; // upper byte
- break;
-
- case 5:
- tempreg = (g_amec->proc[0].temp2mscent.sample) << 8; // upper byte
- break;
-
- case 6:
- // tempreg=(g_amec->proc[2].tempdimmthrm.sample)<<8; // upper byte
- tempreg = 0;
- break;
-
- case 7:
- // tempreg=(g_amec->proc[2].temp2mscent.sample)<<8; // upper byte
- tempreg = 0;
- break;
-
- default:
- break;
-
- }
- g_amec->analytics_thermal_offset = 0x7 &
- (g_amec->analytics_thermal_offset + 1); // modulo 8
-
- tempaccum = g_amec->fan.pwr250usfan.src_accum_snapshot; // load accumulator from last 2msec
- // save current accum state for next 2msec
- g_amec->fan.pwr250usfan.src_accum_snapshot =
- (uint32_t)g_amec->fan.pwr250usfan.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->fan.pwr250usfan.accumulator
- - tempaccum;
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
-
- tempreg = tempreg | (0xff & ((UINT16)tempaccum));
- g_amec->analytics_array[5] = tempreg;
-
- tempaccum = g_amec->io.pwr250usio.src_accum_snapshot; // load accumulator from last 2msec
- // save current accum state for next 2msec
- g_amec->io.pwr250usio.src_accum_snapshot =
- (uint32_t)g_amec->io.pwr250usio.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->io.pwr250usio.accumulator
- - tempaccum;
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
-
- tempreg = ((UINT16)tempaccum) << 8; // upper byte
-
- tempaccum = g_amec->storage.pwr250usstore.src_accum_snapshot; // load accumulator from last 2msec
- // save current accum state for next 2msec
- g_amec->storage.pwr250usstore.src_accum_snapshot =
- (uint32_t)g_amec->storage.pwr250usstore.accumulator;
- tempaccum = (uint32_t)g_amec->storage.pwr250usstore.accumulator
- - tempaccum; // total accumulation over 2msec
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
-
- tempreg = tempreg | (0xff & ((UINT16)tempaccum));
- g_amec->analytics_array[6] = tempreg;
-
- tempaccum = g_amec->proc[0].pwr250usmem.src_accum_snapshot; // load accumulator from last 2msec
- // save current accum state for next 2msec
- g_amec->proc[0].pwr250usmem.src_accum_snapshot =
- (uint32_t)g_amec->proc[0].pwr250usmem.accumulator;
- // total accumulation over 2msec
- tempaccum = (uint32_t)g_amec->proc[0].pwr250usmem.accumulator
- - tempaccum;
- tempaccum = tempaccum >> g_amec->stream_vector_rate;
-
- tempreg = ((UINT16)tempaccum) << 8; // upper byte
- g_amec->analytics_array[7] = tempreg;
- g_amec->analytics_array[8] = 0;
-
- // Now begins the per processor unique data
- tempreg = (g_amec->analytics_total_chips) << 8; // upper byte
- tempreg = tempreg | (0xff & (g_amec->analytics_chip)); // which chip is outputting this interval?
- g_amec->analytics_array[9] = tempreg;
- j = g_amec->analytics_chip; // select which chip to process
-
- if (g_amec->analytics_option == 0)
- {
- k = 0; // Default to no shift, if user didn't enter analytics_total_chips (set to 0)
- if (g_amec->analytics_total_chips == 1) k = g_amec->stream_vector_rate - 3; // (2msec * 2^k) is shift for averaging interval (16msec)
- if (g_amec->analytics_total_chips == 2) k = g_amec->stream_vector_rate - 2; // (2msec * 2^k) is shift for averaging interval (32msec)
- if (g_amec->analytics_total_chips == 4) k = g_amec->stream_vector_rate - 1; // (2msec * 2^k) is shift for averaging interval (64msec)
- if (g_amec->analytics_total_chips == 8) k = g_amec->stream_vector_rate; // (2msec * 2^k) is shift for averaging interval (128msec)
- }
- if (g_amec->analytics_option == 1)
- {
- k = g_amec->stream_vector_rate - 3; // (2msec * 2^k) is shift for averaging interval (16msec)
- }
-
- l = 12; // index offset
-
- g_amec->analytics_array[0] = (UINT16)g_amec->g44_avg[(j * MSA) + 0]; // todclock1 (hi 16 bits, no averaging)
- g_amec->analytics_array[1] = (UINT16)g_amec->g44_avg[(j * MSA) + 2]; // todclock1 (medium 16 bits, no averaging)
- g_amec->analytics_array[2] = (UINT16)g_amec->g44_avg[(j * MSA) + 4]; // todclock1 (lo 16 bits, no averaging)
-
- g_amec->analytics_array[3] = (UINT16)(g_amec->g44_avg[(j * MSA) + 6] >> k); // the first two averages are 16 bits
- g_amec->g44_avg[(j * MSA) + 6] = 0; // reset average for this sensor to 0
- g_amec->analytics_array[4] = (UINT16)(g_amec->g44_avg[(j * MSA) + 8] >> k); // the first two averages are 16 bits
- g_amec->g44_avg[(j * MSA) + 8] = 0; // reset average for this sensor to 0
- g_amec->analytics_array[10] = (UINT16)(g_amec->g44_avg[(j * MSA) + 10] >> k); // the first two averages are 16 bits
- g_amec->g44_avg[(j * MSA) + 10] = 0; // reset average for this sensor to 0
- g_amec->analytics_array[11] = (UINT16)(g_amec->g44_avg[(j * MSA) + 11] >> k); // the first two averages are 16 bits
- g_amec->g44_avg[(j * MSA) + 11] = 0; // reset average for this sensor to 0
-
- for (i = 12; i <= 72; i++)
- {
- temp16 = (UINT16)(g_amec->g44_avg[(j * MSA) + l] >> k);
- tempreg = temp16 << 8; // upper byte
- temp16 = (UINT16)(g_amec->g44_avg[(j * MSA) + l + 1] >> k);
- tempreg = tempreg | (0xff & temp16);
- g_amec->analytics_array[i] = tempreg;
- g_amec->g44_avg[(j * MSA) + l] = 0; // Reset average for this sensor to 0
- g_amec->g44_avg[(j * MSA) + l + 1] = 0; // Reset average for this sensor to 0
-
- l = l + 2;
- }
-
- // Final processing for Group 45: determine if cycling through all
- // chips or just monitoring one chip
- if (g_amec->analytics_option == 0)
- {
- g_amec->analytics_chip++;
-
- if (g_amec->analytics_chip >= g_amec->analytics_total_chips)
- {
- g_amec->analytics_chip = 0; // loop back to chip 0 again
- }
- }
-
- }
- break;
-
- default:
- break;
- }
-}
-
-/*----------------------------------------------------------------------------*/
-/* End */
-/*----------------------------------------------------------------------------*/
diff --git a/src/occ_405/amec/amec_analytics.h b/src/occ_405/amec/amec_analytics.h
deleted file mode 100755
index b6a344e..0000000
--- a/src/occ_405/amec/amec_analytics.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/occ_405/amec/amec_analytics.h $ */
-/* */
-/* OpenPOWER OnChipController Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-#ifndef _AMEC_ANALYTICS_H
-#define _AMEC_ANALYTICS_H
-
-/*----------------------------------------------------------------------------*/
-/* Includes */
-/*----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------*/
-/* Defines/Constants */
-/*----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------*/
-/* Function Declarations */
-/*----------------------------------------------------------------------------*/
-
-// Function that enables stream buffer recording
-void amec_analytics_sb_recording(void);
-
-// Function that is called by AMEC State Machine for analytics
-void amec_analytics_main(void);
-
-#endif // _AMEC_ANALYTICS_H
diff --git a/src/occ_405/amec/amec_init.c b/src/occ_405/amec/amec_init.c
index 75e9d4d..8d16fb0 100644
--- a/src/occ_405/amec/amec_init.c
+++ b/src/occ_405/amec/amec_init.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -299,19 +299,6 @@ void amec_init_gamec_struct(void)
g_amec->stream_vector_delay=0; // Delay in msec before recording can begin
g_amec->stream_vector_rate=0xff; // Invalid setting: requires IPMI command to select initial rate
- //Initialize analytics parameters
- g_amec->analytics_group=45; // Default to analytics Group 45
- g_amec->analytics_chip=0; // Default to which chip to perform analytics on
- g_amec->analytics_bad_output_count=0; // Number of frames to discard before recording analytics output
- g_amec->analytics_total_chips=MAX_NUM_CHIP_MODULES; // Default to do all chips in the system
- g_amec->analytics_threadmode=1; // Default is average of all N threads (may be altered with IPMI command)
- g_amec->analytics_threadcountmax=8;// Default is 8 threads per core (may be altered with IPMI command)
- g_amec->analytics_total_chips=4; // For Tuleta force to only 2 DCM sockets, 4 chips
- g_amec->analytics_option=1; // =0 means cycle through all chips, =1 means only work with analytics_chip
- g_amec->analytics_thermal_offset=0;// Reset offset to 0 for thermal output group
- g_amec->analytics_slot=4; // Time slot associated with when the amec_analytics function is called (out of 8 slots)
- // Set entire averaging buffer to zero
- memset (&g_amec->g44_avg, 0, 4*(MAX_SENSORS_ANALYTICS*MAX_NUM_CHIP_MODULES));
for(l_idx=0; l_idx<NUM_AMEC_FW_PROBES; l_idx++)
{
g_amec->ptr_probe250us[l_idx] = &g_amec->sys.pwrsys.sample;
@@ -319,18 +306,10 @@ void amec_init_gamec_struct(void)
g_amec->index_probe250us[l_idx] = 0; // Initialize all offsets to 0 (used only if size > 2)
}
-// g_amec->ptr_probe250us[2] = &g_amec->g44_avg[(0*MSA)+49];
-// g_amec->ptr_probe250us[2] = g_amec->ptr_probe250us[2]+2; // Point to low 16 bits of g44_avg
-// g_amec->ptr_probe250us[3] = &g_amec->proc[0].core[0].thread[0].util2ms_thread;
g_amec->ptr_probe250us[1] = &g_amec->sys.pwrsys.sample;
g_amec->ptr_probe250us[2] = &g_amec->r_cnt;
g_amec->ptr_probe250us[2] = g_amec->ptr_probe250us[2]+2; // Point to low 16 bits of r_cnt
g_amec->ptr_probe250us[3] = &g_amec->r_cnt;
-// g_amec->ptr_probe250us[4] = &g_amec->testscom1;
-// g_amec->ptr_probe250us[5] = &g_amec->traffic_delay; // holds loop delay for holding up memory traffic
-// g_amec->ptr_probe250us[6] = &g_amec->testscom1;
-// g_amec->ptr_probe250us[6] = g_amec->ptr_probe250us[6]+2; // Point to low 16 bits of testscom1
-// g_amec->ptr_probe250us[7] = &g_amec->task_centaur_data_count;
// Initialize the current_mem_pwr_ctl to indicate that memory power control is not supported
// update memory control registers only if new ips/default memory power control is different
diff --git a/src/occ_405/amec/amec_slave_smh.c b/src/occ_405/amec/amec_slave_smh.c
index f60eba9..8c34a8a 100755
--- a/src/occ_405/amec/amec_slave_smh.c
+++ b/src/occ_405/amec/amec_slave_smh.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,7 +53,6 @@
#include <amec_amester.h>
#include <amec_oversub.h>
#include <amec_health.h>
-#include <amec_analytics.h>
#include <common.h>
#include <occhw_async.h>
#include <wof.h>
diff --git a/src/occ_405/amec/amec_sys.h b/src/occ_405/amec/amec_sys.h
index 0d69ca0..ffb392d 100755
--- a/src/occ_405/amec/amec_sys.h
+++ b/src/occ_405/amec/amec_sys.h
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -724,15 +724,8 @@ typedef struct
// WOF sensors
amec_wof_sensors_t wof_sensors;
- //---------------------------------------------------------
- //
- // Parameters for analytics function
- //
- //---------------------------------------------------------
// 32 bit counter of 250usec ticks
uint32_t r_cnt;
- // array holding sensor ptrs for writing to stream vector
- void *stream_vector_map[STREAM_VECTOR_SIZE_EX];
void * ptr_probe250us[NUM_AMEC_FW_PROBES]; // array holding ptrs to data that is read by probe250us sensors
// 32-bit ptr to streaming buffer which contains 16 bit elements
uint16_t *ptr_stream_buffer;
@@ -766,28 +759,6 @@ typedef struct
uint8_t l4_powerdown_requestm;
// indicates which of the L4 Centaurs is being monitored by probe.
uint16_t probe_l4_centaur;
- uint32_t g44_avg[MAX_NUM_CHIP_MODULES*MAX_SENSORS_ANALYTICS];
- // parameter driven selection of analytics group
- uint16_t analytics_group;
- // parameter to select which chip to monitor analytics on
- uint8_t analytics_chip;
- // parameter to select which analytics options (=0 just selected chip)
- uint8_t analytics_option;
- // 8-bit value used to throw away frames until good output has been averaged in amec_analytics buffer outputs
- uint8_t analytics_bad_output_count;
- // Total number of chips used in analytics sensor capture
- uint8_t analytics_total_chips;
- // Current offset in cyclic thermal group output (8 in cycle)
- uint8_t analytics_thermal_offset;
- // Selects which type of Group 44 averaging is done on per thread data:
- // default=0 (average of non-zero thread utilizations), =1 (average of N), =2 (max of N)
- uint8_t analytics_threadmode;
- // Has the maximum number of threads per core for this processor architecture or for SMT modes. Default=4 on P7+.
- uint8_t analytics_threadcountmax;
- // Which of 8 time slots that amec_analytics is called in
- uint8_t analytics_slot;
- // Used to hold selected analytics group
- uint16_t analytics_array[STREAM_VECTOR_SIZE_EX];
// holds the sum of all the memory power sensors (32msec)
uint16_t total_memory_power;
uint16_t probetemp[NUM_AMEC_FW_PROBES]; // array holding temporary probe data
diff --git a/src/occ_405/topfiles.mk b/src/occ_405/topfiles.mk
index 78a7c3a..7d98dbc 100644
--- a/src/occ_405/topfiles.mk
+++ b/src/occ_405/topfiles.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER OnChipController Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2017
+# Contributors Listed Below - COPYRIGHT 2015,2019
# [+] International Business Machines Corp.
#
#
@@ -22,8 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-TOP-C-SOURCES = amec/amec_analytics.c \
- amec/amec_controller.c \
+TOP-C-SOURCES = amec/amec_controller.c \
amec/amec_data.c \
amec/amec_dps.c \
amec/amec_freq.c \
OpenPOWER on IntegriCloud