summaryrefslogtreecommitdiffstats
path: root/src/occ/amec
diff options
context:
space:
mode:
authorGuillermo J Silva <guilsilv@us.ibm.com>2014-12-09 16:27:10 -0600
committerStephan Broyles <sbroyles@us.ibm.com>2014-12-09 16:59:46 -0600
commit2b14d2c9b577b8ee683353841bd3881239cfb164 (patch)
tree550db34752a069ae5c03c51c21ccc35add2dfb02 /src/occ/amec
parentad21682d4de1b83453f7847fdc9d2a24419e81e3 (diff)
downloadtalos-occ-2b14d2c9b577b8ee683353841bd3881239cfb164.tar.gz
talos-occ-2b14d2c9b577b8ee683353841bd3881239cfb164.zip
Clean up of occ/amec - Part 2
Change-Id: I72aec72b97b27798b1975c440b677a4c1ae7ba27 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14819 Reviewed-by: Stephan Broyles <sbroyles@us.ibm.com> Tested-by: Stephan Broyles <sbroyles@us.ibm.com>
Diffstat (limited to 'src/occ/amec')
-rwxr-xr-xsrc/occ/amec/amec_parm.c386
-rwxr-xr-xsrc/occ/amec/amec_parm.h79
-rwxr-xr-xsrc/occ/amec/amec_parm_table.c104
-rwxr-xr-xsrc/occ/amec/amec_part.c103
-rwxr-xr-xsrc/occ/amec/amec_part.h112
-rwxr-xr-xsrc/occ/amec/amec_pcap.c224
-rwxr-xr-xsrc/occ/amec/amec_pcap.h45
-rwxr-xr-xsrc/occ/amec/amec_perfcount.c50
-rwxr-xr-xsrc/occ/amec/amec_perfcount.h59
-rw-r--r--src/occ/amec/amec_sensors_centaur.c235
-rw-r--r--src/occ/amec/amec_sensors_centaur.h43
11 files changed, 678 insertions, 762 deletions
diff --git a/src/occ/amec/amec_parm.c b/src/occ/amec/amec_parm.c
index 0235cf5..ff927cc 100755
--- a/src/occ/amec/amec_parm.c
+++ b/src/occ/amec/amec_parm.c
@@ -1,21 +1,27 @@
-/******************************************************************************
-// @file amec_parm.c
-// @brief OCC Amester parameter interface.
-*/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section amec_parm_c amec_parm.c
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @cl002 903552 lefurgy 08/02/2013 Created
- * @gs027 918066 gjsilva 03/12/2014 Misc functions from ARL
- *
- * @endverbatim
- *
- *///*************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_parm.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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
@@ -51,37 +57,36 @@ extern amec_parm_t g_amec_parm_list[];
//*************************************************************************
void amec_parm_get_number(const IPMIMsg_t *i_psMsg,
- UINT8 *o_pu8Resp,
- UINT16 *o_pu16RespLength,
- UINT8 *o_retval)
+ UINT8 *o_pu8Resp,
+ UINT16 *o_pu16RespLength,
+ UINT8 *o_retval)
{
/*------------------------------------------------------------------------*/
/* Local Variables */
/*------------------------------------------------------------------------*/
-
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
-
o_pu8Resp[0] = (UINT8)(AMEC_PARM_NUMBER_OF_PARAMETERS>>8);
o_pu8Resp[1] = (UINT8)(AMEC_PARM_NUMBER_OF_PARAMETERS);
-
+
*o_pu16RespLength=2;
*o_retval=COMPCODE_NORMAL;
-
+
return;
}
void amec_parm_get_config(const IPMIMsg_t *i_psMsg,
- UINT8 *o_pu8Resp,
- UINT16 *o_pu16RespLength,
- UINT8 *o_retval)
+ UINT8 *o_pu8Resp,
+ UINT16 *o_pu16RespLength,
+ UINT8 *o_retval)
{
/*------------------------------------------------------------------------*/
/* Local Variables */
/*------------------------------------------------------------------------*/
- AMEC_PARM_GUID l_id; // parameter id
+ AMEC_PARM_GUID l_id; // parameter id
UINT16 l_j; // index into return message
UINT16 l_length = 0; // response length
CHAR *l_src; //pointer for copying name
@@ -89,48 +94,47 @@ void amec_parm_get_config(const IPMIMsg_t *i_psMsg,
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
-
l_id = (AMEC_PARM_GUID) CONVERT_UINT8_ARRAY_UINT16(
- i_psMsg->au8CmdData_ptr[1],
- i_psMsg->au8CmdData_ptr[2]);
+ i_psMsg->au8CmdData_ptr[1],
+ i_psMsg->au8CmdData_ptr[2]);
l_j = 0; // write index byte for response
-
+
for (; l_id < AMEC_PARM_NUMBER_OF_PARAMETERS; l_id++)
{
- if (l_j + strlen(g_amec_parm_list[l_id].name) + 1 + 10 >= IPMI_MAX_MSG_SIZE)
- {
- // +1 = null terminator in name.
- // +10 = type, mode, vector_length, length (optional)
- break; // hit end of response buffer
- }
-
- // Copy name into output buffer
- l_src = g_amec_parm_list[l_id].name;
- do
- {
- o_pu8Resp[l_j++] = *l_src;
- } while (*l_src++ != 0); /* copy string until \0 */
-
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].type);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].mode);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length>>24);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length>>16);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length>>8);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length);
-
- // If base type is unstructured data or string, send length
- if (g_amec_parm_list[l_id].type == AMEC_PARM_TYPE_STRING ||
- g_amec_parm_list[l_id].type == AMEC_PARM_TYPE_RAW)
- {
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length>>24);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length>>16);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length>>8);
- o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length);
- }
-
- // update length of response parameter just copied
- l_length = l_j;
- }
+ if (l_j + strlen(g_amec_parm_list[l_id].name) + 1 + 10 >= IPMI_MAX_MSG_SIZE)
+ {
+ // +1 = null terminator in name.
+ // +10 = type, mode, vector_length, length (optional)
+ break; // hit end of response buffer
+ }
+
+ // Copy name into output buffer
+ l_src = g_amec_parm_list[l_id].name;
+ do
+ {
+ o_pu8Resp[l_j++] = *l_src;
+ } while (*l_src++ != 0); /* copy string until \0 */
+
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].type);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].mode);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length>>24);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length>>16);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length>>8);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].vector_length);
+
+ // If base type is unstructured data or string, send length
+ if (g_amec_parm_list[l_id].type == AMEC_PARM_TYPE_STRING ||
+ g_amec_parm_list[l_id].type == AMEC_PARM_TYPE_RAW)
+ {
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length>>24);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length>>16);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length>>8);
+ o_pu8Resp[l_j++] = (UINT8)(g_amec_parm_list[l_id].length);
+ }
+
+ // update length of response parameter just copied
+ l_length = l_j;
+ }
*o_pu16RespLength=l_length;
*o_retval=COMPCODE_NORMAL;
return;
@@ -138,9 +142,9 @@ void amec_parm_get_config(const IPMIMsg_t *i_psMsg,
void amec_parm_read(const IPMIMsg_t *const i_psMsg,
- UINT8 *const o_pu8Resp,
- UINT16 *const o_pu16RespLength,
- UINT8 *const o_retval)
+ UINT8 *const o_pu8Resp,
+ UINT16 *const o_pu16RespLength,
+ UINT8 *const o_retval)
{
/*------------------------------------------------------------------------*/
/* Local Variables */
@@ -157,144 +161,144 @@ void amec_parm_read(const IPMIMsg_t *const i_psMsg,
/*------------------------------------------------------------------------*/
do
{
- *o_retval = COMPCODE_NORMAL; /* assume no error */
-
- // Parse input command
- // Get the byte offset
- b = CONVERT_UINT8_ARRAY_UINT32(
- i_psMsg->au8CmdData_ptr[1],
- i_psMsg->au8CmdData_ptr[2],
- i_psMsg->au8CmdData_ptr[3],
- i_psMsg->au8CmdData_ptr[4]);
-
- // Get parameter id
- l_id = CONVERT_UINT8_ARRAY_UINT16(
- i_psMsg->au8CmdData_ptr[5],
- i_psMsg->au8CmdData_ptr[6]);
-
- if (l_id >= AMEC_PARM_NUMBER_OF_PARAMETERS)
- {
- *o_retval = COMPCODE_PARAM_OUT_OF_RANGE;
- *o_pu16RespLength = 0;
- break;
- }
-
- if (g_amec_parm_list[l_id].preread)
- {
- amec_parm_preread(l_id);
- }
-
- // Copy value to output buffer
- // Set src to first byte to send back
- l_src_ptr = g_amec_parm_list[l_id].value_ptr + b;
-
- // Set end pointer 1 beyond last byte to send. It is limited either
- // on the value size, or the IPMI message size.
- l_end_ptr = g_amec_parm_list[l_id].value_ptr
- + (g_amec_parm_list[l_id].vector_length * g_amec_parm_list[l_id].length);
- if (l_src_ptr + l_maxresponse < l_end_ptr)
- {
- l_end_ptr = l_src_ptr + l_maxresponse;
- }
-
- while ((UINT32)l_src_ptr < (UINT32)l_end_ptr)
- {
- //Copy next byte to output
- o_pu8Resp[i++] = (UINT8)*l_src_ptr++;
- }
-
- *o_pu16RespLength = i;
-
- } while (FALSE);
+ *o_retval = COMPCODE_NORMAL; /* assume no error */
+
+ // Parse input command
+ // Get the byte offset
+ b = CONVERT_UINT8_ARRAY_UINT32(
+ i_psMsg->au8CmdData_ptr[1],
+ i_psMsg->au8CmdData_ptr[2],
+ i_psMsg->au8CmdData_ptr[3],
+ i_psMsg->au8CmdData_ptr[4]);
+
+ // Get parameter id
+ l_id = CONVERT_UINT8_ARRAY_UINT16(
+ i_psMsg->au8CmdData_ptr[5],
+ i_psMsg->au8CmdData_ptr[6]);
+
+ if (l_id >= AMEC_PARM_NUMBER_OF_PARAMETERS)
+ {
+ *o_retval = COMPCODE_PARAM_OUT_OF_RANGE;
+ *o_pu16RespLength = 0;
+ break;
+ }
+
+ if (g_amec_parm_list[l_id].preread)
+ {
+ amec_parm_preread(l_id);
+ }
+
+ // Copy value to output buffer
+ // Set src to first byte to send back
+ l_src_ptr = g_amec_parm_list[l_id].value_ptr + b;
+
+ // Set end pointer 1 beyond last byte to send. It is limited either
+ // on the value size, or the IPMI message size.
+ l_end_ptr = g_amec_parm_list[l_id].value_ptr
+ + (g_amec_parm_list[l_id].vector_length * g_amec_parm_list[l_id].length);
+ if (l_src_ptr + l_maxresponse < l_end_ptr)
+ {
+ l_end_ptr = l_src_ptr + l_maxresponse;
+ }
+
+ while ((UINT32)l_src_ptr < (UINT32)l_end_ptr)
+ {
+ //Copy next byte to output
+ o_pu8Resp[i++] = (UINT8)*l_src_ptr++;
+ }
+
+ *o_pu16RespLength = i;
+
+ } while (FALSE);
}
void amec_parm_write(const IPMIMsg_t *const i_psMsg,
- UINT8 *const o_pu8Resp,
- UINT16 *const o_pu16RespLength,
- UINT8 *const o_retval)
+ UINT8 *const o_pu8Resp,
+ UINT16 *const o_pu16RespLength,
+ UINT8 *const o_retval)
{
/*------------------------------------------------------------------------*/
/* Local Variables */
/*------------------------------------------------------------------------*/
AMEC_PARM_GUID l_id;
UINT16 i=0; // output index
- UINT8 *l_dest_ptr = NULL; // malloc(sizeof(l_dest_ptr)); // pointer to first byte of data
+ UINT8 *l_dest_ptr = NULL; // pointer to first byte of data
UINT8 *l_start_ptr; // mark end of data
- UINT8 *l_end_ptr = NULL;//malloc(sizeof(l_end_ptr)); // mark end of data
+ UINT8 *l_end_ptr = NULL; // mark end of data
UINT32 b; // start byte
UINT32 l_bytes = 0; // number of bytes written
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
- do
- {
- *o_retval = COMPCODE_NORMAL; /* assume no error */
-
- // Parse input command
- // Get parameter id
- l_id = CONVERT_UINT8_ARRAY_UINT16(
- i_psMsg->au8CmdData_ptr[1],
- i_psMsg->au8CmdData_ptr[2]);
-
- // Get the starting byte of element
- b = CONVERT_UINT8_ARRAY_UINT32(
- i_psMsg->au8CmdData_ptr[3],
- i_psMsg->au8CmdData_ptr[4],
- i_psMsg->au8CmdData_ptr[5],
- i_psMsg->au8CmdData_ptr[6]);
-
- if (l_id >= AMEC_PARM_NUMBER_OF_PARAMETERS)
- {
- *o_retval = COMPCODE_PARAM_OUT_OF_RANGE;
- *o_pu16RespLength = 0;
- break;
- }
-
- i = 7; // start of data to write in input buffer
-
- // Check if read-only
- if (g_amec_parm_list[l_id].mode & AMEC_PARM_MODE_READONLY)
- {
- *o_retval = COMPCODE_WRONG_PRIV;
- *o_pu16RespLength = 0;
- break;
- }
-
- l_start_ptr = g_amec_parm_list[l_id].value_ptr + b;
- l_dest_ptr = l_start_ptr;
- // Set end pointer 1 beyond last byte to send. It is limited either
- // on the value size, or the IPMI message size.
- l_end_ptr = g_amec_parm_list[l_id].value_ptr
- + (g_amec_parm_list[l_id].vector_length * g_amec_parm_list[l_id].length);
-
- // Copy value from input buffer
- while ((UINT32)l_dest_ptr < (UINT32)l_end_ptr
- && i < i_psMsg->u8CmdDataLen)
- {
- *l_dest_ptr++ = i_psMsg->au8CmdData_ptr[i++];
- }
-
- l_bytes = l_dest_ptr - l_start_ptr;
-
- // Return number of bytes written
- *o_pu16RespLength = 4;
- o_pu8Resp[0] = (UINT8)(l_bytes >> 24);
- o_pu8Resp[1] = (UINT8)(l_bytes >> 16);
- o_pu8Resp[2] = (UINT8)(l_bytes >> 8);
- o_pu8Resp[3] = (UINT8)(l_bytes);
-
- // Run post-write routine only if last byte of parameter was written
- // Some long parameters require multiple write calls due to IPMI
- // message limits, so we only call the postwrite routine when the
- // last byte of the parameter is written.
- if (l_dest_ptr == l_end_ptr && g_amec_parm_list[l_id].postwrite)
- {
- amec_parm_postwrite(l_id);
- }
-
- } while (FALSE);
+ do
+ {
+ *o_retval = COMPCODE_NORMAL; /* assume no error */
+
+ // Parse input command
+ // Get parameter id
+ l_id = CONVERT_UINT8_ARRAY_UINT16(
+ i_psMsg->au8CmdData_ptr[1],
+ i_psMsg->au8CmdData_ptr[2]);
+
+ // Get the starting byte of element
+ b = CONVERT_UINT8_ARRAY_UINT32(
+ i_psMsg->au8CmdData_ptr[3],
+ i_psMsg->au8CmdData_ptr[4],
+ i_psMsg->au8CmdData_ptr[5],
+ i_psMsg->au8CmdData_ptr[6]);
+
+ if (l_id >= AMEC_PARM_NUMBER_OF_PARAMETERS)
+ {
+ *o_retval = COMPCODE_PARAM_OUT_OF_RANGE;
+ *o_pu16RespLength = 0;
+ break;
+ }
+
+ i = 7; // start of data to write in input buffer
+
+ // Check if read-only
+ if (g_amec_parm_list[l_id].mode & AMEC_PARM_MODE_READONLY)
+ {
+ *o_retval = COMPCODE_WRONG_PRIV;
+ *o_pu16RespLength = 0;
+ break;
+ }
+
+ l_start_ptr = g_amec_parm_list[l_id].value_ptr + b;
+ l_dest_ptr = l_start_ptr;
+ // Set end pointer 1 beyond last byte to send. It is limited either
+ // on the value size, or the IPMI message size.
+ l_end_ptr = g_amec_parm_list[l_id].value_ptr
+ + (g_amec_parm_list[l_id].vector_length * g_amec_parm_list[l_id].length);
+
+ // Copy value from input buffer
+ while ((UINT32)l_dest_ptr < (UINT32)l_end_ptr
+ && i < i_psMsg->u8CmdDataLen)
+ {
+ *l_dest_ptr++ = i_psMsg->au8CmdData_ptr[i++];
+ }
+
+ l_bytes = l_dest_ptr - l_start_ptr;
+
+ // Return number of bytes written
+ *o_pu16RespLength = 4;
+ o_pu8Resp[0] = (UINT8)(l_bytes >> 24);
+ o_pu8Resp[1] = (UINT8)(l_bytes >> 16);
+ o_pu8Resp[2] = (UINT8)(l_bytes >> 8);
+ o_pu8Resp[3] = (UINT8)(l_bytes);
+
+ // Run post-write routine only if last byte of parameter was written
+ // Some long parameters require multiple write calls due to IPMI
+ // message limits, so we only call the postwrite routine when the
+ // last byte of the parameter is written.
+ if (l_dest_ptr == l_end_ptr && g_amec_parm_list[l_id].postwrite)
+ {
+ amec_parm_postwrite(l_id);
+ }
+
+ } while (FALSE);
}
/*----------------------------------------------------------------------------*/
diff --git a/src/occ/amec/amec_parm.h b/src/occ/amec/amec_parm.h
index 8c5aa86..a6ef1fd 100755
--- a/src/occ/amec/amec_parm.h
+++ b/src/occ/amec/amec_parm.h
@@ -1,22 +1,27 @@
-/**
- * @file amec_parm.h
- * @brief Header file for AMEC Parameter interface.
- *
- *
-*/
-/**
- * @page ChangeLogs Change Logs
- * @section _amec_parm_h amec_parm.h
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * -------- ---------- -------- --------- ----------------------------------
- * @cl002 903552 lefurgy 08/02/2013 Created
- * @gs018 907196 gjsilva 11/20/2013 Base support for soft frequency boundaries
- * @gs027 918066 gjsilva 03/12/2014 Misc functions from ARL
- *
- * @endverbatim
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_parm.h $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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 */
/*
This interface takes named memory objects (such as global variables)
@@ -117,13 +122,7 @@ extern amec_parm_t g_amec_parm_list[];
/*******************************************************************/
/**
- * @brief Get number of parameters
- * @param i_psMsg IPMI command
- * @param o_pu8Resp Response string
- * @param o_pu8RespLength Response string length
- * @param o_retval Command response error code (=0 pass)
- *
- * Return number of parameters tracked by TPMD
+ * Get number of parameters tracked by OCC
*
*/
void amec_parm_get_number(const IPMIMsg_t *i_psMsg,
@@ -132,13 +131,7 @@ void amec_parm_get_number(const IPMIMsg_t *i_psMsg,
UINT8 *o_retval);
/**
- * @brief Get parameter configuration (names, types, size, etc.)
- * @param i_psMsg IPMI command
- * @param o_pu8Resp Response string
- * @param o_pu8RespLength Response string length
- * @param o_retval Command response error code (=0 pass)
- *
- * Get the configuration of the parameters (names, size, type, etc.)
+ * Get parameter configuration (names, types, size, etc.)
*
*/
void amec_parm_get_config(const IPMIMsg_t *i_psMsg,
@@ -147,13 +140,7 @@ void amec_parm_get_config(const IPMIMsg_t *i_psMsg,
UINT8 *o_retval);
/**
- * @brief Get parameter value
- * @param i_psMsg IPMI command
- * @param o_pu8Resp Response string
- * @param o_pu8RespLength Response string length
- * @param o_retval Command response error code (=0 pass)
- *
- * Read a parameter value
+ * Read a parameter value
*
*/
void amec_parm_read(const IPMIMsg_t *const i_psMsg,
@@ -162,12 +149,6 @@ void amec_parm_read(const IPMIMsg_t *const i_psMsg,
UINT8 *const o_retval);
/**
- * @brief Set a parameter value
- * @param i_psMsg IPMI command
- * @param o_pu8Resp Response string
- * @param o_pu8RespLength Response string length
- * @param o_retval Command response error code (=0 pass)
- *
* Write a value to a parameter
*
*/
@@ -177,8 +158,7 @@ void amec_parm_write(const IPMIMsg_t *const i_psMsg,
UINT8 *const o_retval);
/**
- * @brief Update parameter value before reading
- * @param i_parm_guid The parameter number
+ * Update parameter value before reading
*
* Some parameters need to be updated before reading.
* For example, a parameter that points to double-buffered
@@ -190,8 +170,7 @@ void amec_parm_write(const IPMIMsg_t *const i_psMsg,
void amec_parm_preread(AMEC_PARM_GUID i_parm_guid);
/**
- * @brief Update parameter value before reading
- * @param i_parm_guid The parameter number
+ * Update parameter value after writing
*
* Some parameters trigger actions after writing.
* This routine only needs to be called when the parameter
diff --git a/src/occ/amec/amec_parm_table.c b/src/occ/amec/amec_parm_table.c
index 042e222..03c239f 100755
--- a/src/occ/amec/amec_parm_table.c
+++ b/src/occ/amec/amec_parm_table.c
@@ -1,22 +1,27 @@
-/******************************************************************************
-// @file amec_parm_table.c
-// @brief OCC Amester parameter table.
-*/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section amec_parm_table_c amec_parm_table.c
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @cl002 903552 lefurgy 08/02/2013 Created
- * @gs018 907196 gjsilva 11/20/2013 Base support for soft frequency boundaries
- * @gs027 918066 gjsilva 03/12/2014 Misc functions from ARL
- *
- * @endverbatim
- *
- *///*************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_parm_table.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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
@@ -36,56 +41,55 @@
// Macros for parameters based on simple variables (read-write, not vectors)
/**
- * @brief Create or update a parameter
+ * Create or update a parameter
*
- * @param i_name Name of parameter. If this name is the name of an
- * existing parameter, then the existing parameter fields
- * will be updated
- * @param i_vaule A pointer to the bytes representing the value of the parameter
- * @param i_length The length in bytes of the parameter value
- * @param n The number of elements if this parameter is a vector, otherwise = 1.
+ * i_name: Name of parameter. If this name is the name of an existing
+ * parameter, then the existing parameter fields will be updated
+ * i_value: A pointer to the bytes representing the value of the parameter
+ * i_length: The length in bytes of the parameter value
+ * n: The number of elements if this parameter is a vector, otherwise = 1.
*/
-#define AMEC_PARM_UINT8(i_num, i_name, i_value) \
+#define AMEC_PARM_UINT8(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,1,1,AMEC_PARM_TYPE_UINT8,0}
-#define AMEC_PARM_UINT16(i_num, i_name, i_value) \
+#define AMEC_PARM_UINT16(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,2,1,AMEC_PARM_TYPE_UINT16,0}
-#define AMEC_PARM_UINT32(i_num, i_name, i_value) \
+#define AMEC_PARM_UINT32(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,4,1,AMEC_PARM_TYPE_UINT32,0}
-#define AMEC_PARM_UINT64(i_num, i_name, i_value) \
+#define AMEC_PARM_UINT64(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,8,1,AMEC_PARM_TYPE_UINT64,0}
-#define AMEC_PARM_INT8(i_num, i_name, i_value) \
+#define AMEC_PARM_INT8(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,1,1,AMEC_PARM_TYPE_INT8,0}
-#define AMEC_PARM_INT16(i_num, i_name, i_value) \
+#define AMEC_PARM_INT16(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,2,1,AMEC_PARM_TYPE_INT16,0}
-#define AMEC_PARM_INT32(i_num, i_name, i_value) \
+#define AMEC_PARM_INT32(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,4,1,AMEC_PARM_TYPE_INT32,0}
-#define AMEC_PARM_INT64(i_num, i_name, i_value) \
+#define AMEC_PARM_INT64(i_num, i_name, i_value) \
[i_num] = {i_name,(void*)i_value,8,1,AMEC_PARM_TYPE_IN64,0}
-#define AMEC_PARM_STRING(i_num, i_name, i_value, i_length) \
+#define AMEC_PARM_STRING(i_num, i_name, i_value, i_length) \
[i_num] = {i_name,(void*)i_value,i_length,1,AMEC_PARM_TYPE_STRING,0}
-#define AMEC_PARM_RAW(i_num, i_name, i_value, i_length) \
+#define AMEC_PARM_RAW(i_num, i_name, i_value, i_length) \
[i_num] = {i_name,(void*)i_value,i_length,1,AMEC_PARM_TYPE_RAW,0}
-//Use these macros when the parameter is an array of values.
-#define AMEC_PARM_UINT8_ARRAY(i_num, i_name, i_value, n) \
+//Use these macros when the parameter is an array of values.
+#define AMEC_PARM_UINT8_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,1,n,AMEC_PARM_TYPE_UINT8,0}
-#define AMEC_PARM_UINT16_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_UINT16_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,2,n,AMEC_PARM_TYPE_UINT16,0}
-#define AMEC_PARM_UINT32_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_UINT32_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,4,n,AMEC_PARM_TYPE_UINT32,0}
-#define AMEC_PARM_UINT64_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_UINT64_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,8,n,AMEC_PARM_TYPE_UINT64,0}
-#define AMEC_PARM_INT8_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_INT8_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,1,n,AMEC_PARM_TYPE_INT8,0}
-#define AMEC_PARM_INT16_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_INT16_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,2,n,AMEC_PARM_TYPE_INT16,0}
-#define AMEC_PARM_INT32_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_INT32_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,4,n,AMEC_PARM_TYPE_INT32,0}
-#define AMEC_PARM_INT64_ARRAY(i_num, i_name, i_value, n) \
+#define AMEC_PARM_INT64_ARRAY(i_num, i_name, i_value, n) \
[i_num] = {i_name,(void*)i_value,8,n,AMEC_PARM_TYPE_IN64,0}
-#define AMEC_PARM_STRING_ARRAY(i_num, i_name, i_value, i_length, n) \
+#define AMEC_PARM_STRING_ARRAY(i_num, i_name, i_value, i_length, n) \
[i_num] = {i_name,(void*)i_value,i_length,n,AMEC_PARM_TYPE_STRING,0}
-#define AMEC_PARM_RAW_ARRAY(i_num, i_name, i_value, i_length, n) \
+#define AMEC_PARM_RAW_ARRAY(i_num, i_name, i_value, i_length, n) \
[i_num] = {i_name,(void*)i_value,i_length,n,AMEC_PARM_TYPE_RAW,0}
//*************************************************************************
@@ -105,7 +109,7 @@ extern amec_sys_t g_amec_sys;
// This is the list of all parameters seen by Amester
//
// Note: The parameters must be in the same order as in AMEC_PARM_ENUM
-// in amec_parm.h
+// in amec_parm.h
//
// Future optimization: This table could be placed in main memory, not
// the SRAM tank, since slow access to it is OK.
@@ -158,3 +162,7 @@ void amec_parm_postwrite(AMEC_PARM_GUID i_parm_guid)
break;
}
}
+
+/*----------------------------------------------------------------------------*/
+/* End */
+/*----------------------------------------------------------------------------*/
diff --git a/src/occ/amec/amec_part.c b/src/occ/amec/amec_part.c
index 75ba84c..94c4bc2 100755
--- a/src/occ/amec/amec_part.c
+++ b/src/occ/amec/amec_part.c
@@ -1,27 +1,27 @@
-/******************************************************************************
- * @file amec_part.c
- * @brief Partition Level Power Management
- ******************************************************************************/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section _amec_part_c amec_part.c
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @ly001 853751 lychen 09/17/2012 Initial Revision
- * @ly002 860316 lychen 11/07/2012 Rename adding a core group function
- * @gs008 894661 gjsilva 08/08/2013 Initial support for DPS-FP mode
- * @gs009 897228 gjsilva 08/28/2013 Enablement of DPS-FP Mode
- * @gs017 905990 gjsilva 11/13/2013 Full support for tunable parameters
- * @gs018 907196 gjsilva 11/20/2013 Base support for soft frequency boundaries
- * @gs031 924042 gjsilva 04/21/2014 Support for DPS-FP mode in Brazos
- * @gs037 933716 gjsilva 07/31/2014 Fix alpha_up and alpha_down resolution
- *
- * @endverbatim
- *
- ******************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_part.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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 */
@@ -46,15 +46,11 @@
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
-/* Internal Function Prototypes */
-/*----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------------------*/
// Given partition id, return pointer to existing partition or NULL
-static amec_part_t* amec_part_find_by_id(amec_part_config_t* i_config,
+static amec_part_t* amec_part_find_by_id(amec_part_config_t* i_config,
const uint8_t i_id)
{
/*------------------------------------------------------------------------*/
@@ -62,19 +58,19 @@ static amec_part_t* amec_part_find_by_id(amec_part_config_t* i_config,
/*------------------------------------------------------------------------*/
amec_part_t *l_part = NULL;
uint16_t l_idx = 0;
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
-
for (l_idx=0; l_idx<AMEC_PART_MAX_PART; l_idx++)
{
- if (i_config->part_list[l_idx].id == i_id && i_config->part_list[l_idx].valid)
+ if (i_config->part_list[l_idx].id == i_id && i_config->part_list[l_idx].valid)
{
l_part = &(i_config->part_list[l_idx]);
break;
}
}
-
+
return l_part;
}
@@ -84,8 +80,6 @@ static amec_part_t* amec_part_find_by_id(amec_part_config_t* i_config,
//
// Description: Given a core, return a valid partition that owns it, or NULL.
//
-// Flow: FN= None
-//
// End Function Specification
amec_part_t* amec_part_find_by_core(amec_part_config_t* i_config,
const uint16_t i_core_index)
@@ -99,18 +93,18 @@ amec_part_t* amec_part_find_by_core(amec_part_config_t* i_config,
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
- do
+ do
{
- if (i_core_index >= MAX_NUM_CORES)
+ if (i_core_index >= MAX_NUM_CORES)
{
- break; // illegal core number
+ break; // illegal core number
}
l_part_index = i_config->core2part[i_core_index];
if (l_part_index >= AMEC_PART_MAX_PART)
{
break; // illegal partition number
}
- if (i_config->part_list[l_part_index].valid)
+ if (i_config->part_list[l_part_index].valid)
{
l_part = (amec_part_t*) &(i_config->part_list[l_part_index]);
}
@@ -119,15 +113,12 @@ amec_part_t* amec_part_find_by_core(amec_part_config_t* i_config,
return l_part;
}
-// @ly002c
// Function Specification
//
// Name: amec_part_add
//
// Description: Add a core group.
//
-// Flow: FN= None
-//
// End Function Specification
void amec_part_add(uint8_t i_id)
{
@@ -152,20 +143,20 @@ void amec_part_add(uint8_t i_id)
// Find new slot
for (l_idx=0; l_idx<AMEC_PART_MAX_PART; l_idx++)
{
- if (!g_amec->part_config.part_list[l_idx].valid)
+ if (!g_amec->part_config.part_list[l_idx].valid)
{
l_part = &g_amec->part_config.part_list[l_idx];
break;
}
}
-
+
if (l_part == NULL)
{
// This should never happen, since table should be large enough
// to hold as many partitions as can be created on system.
break;
}
-
+
// Enter new partition into table with default values
l_part->id = i_id;
l_part->valid = 1; //Mark them as valid
@@ -175,7 +166,7 @@ void amec_part_add(uint8_t i_id)
l_part->core_list[l_idx] = AMEC_PART_NUM_CORES;
}
- // TODO: For now, create a single partition with all cores assigned to it
+ // For now, create a single partition with all cores assigned to it
// until we write the interface to talk to PHYP
if (i_id == 0)
{
@@ -189,7 +180,7 @@ void amec_part_add(uint8_t i_id)
// Set default soft frequency boundaries to use full frequency range
l_part->soft_fmin = 0x0000;
l_part->soft_fmax = 0xFFFF;
-
+
// Set default values for DPS parameters (Favor Energy)
l_part->dpsalg.step_up = 8;
l_part->dpsalg.step_down = 8;
@@ -205,7 +196,7 @@ void amec_part_add(uint8_t i_id)
l_part->follow_sysmode = TRUE;
}
while (0);
-
+
return;
}
@@ -219,20 +210,20 @@ void amec_part_init()
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
- // Initial core to partition mapping. Cores point to an invalid core group
- // id.
- // TODO: For now, we assume a single partition (id 0) with all cores
- // assigned to it. Once the PHYP interface has been written, we can remove
- // this assumption.
+ // Initial core to partition mapping. Cores point to an invalid core group
+ // id.
+ // For now, we assume a single partition (id 0) with all cores assigned to
+ // it. Once the PHYP interface has been written, we can remove this
+ // assumption.
for (l_idx=0; l_idx<MAX_NUM_CORES; l_idx++)
{
g_amec->part_config.core2part[l_idx] = 0; // AMEC_PART_INVALID_ID;
}
-
+
for (l_idx=0; l_idx<AMEC_PART_MAX_PART; l_idx++)
{
// Creating all possible partitions
- amec_part_add(l_idx); // @ly002c
+ amec_part_add(l_idx);
g_amec->part_config.part_list[l_idx].dpsalg.util_speed_request = g_amec->sys.fmax;
}
@@ -283,7 +274,7 @@ void amec_part_update_dps_parameters(amec_part_t* io_part)
io_part->dpsalg.alpha_down = 9990;
io_part->dpsalg.type = 41;
- // Check if this is a multi-node system (e.g., Brazos)
+ // Check if this is a multi-node system
if (G_sysConfigData.system_type.single == 0)
{
// These parameter values will result in static turbo frequency
@@ -346,7 +337,7 @@ void amec_part_update_perf_settings(amec_part_t* io_part)
g_amec->proc[0].core[l_core_index % MAX_NUM_CORES]
.core_perf.dps_freq_request = UINT16_MAX;
}
- break;
+ break;
}
}
diff --git a/src/occ/amec/amec_part.h b/src/occ/amec/amec_part.h
index 21b68e1..151569c 100755
--- a/src/occ/amec/amec_part.h
+++ b/src/occ/amec/amec_part.h
@@ -1,26 +1,27 @@
-/******************************************************************************
- * @file amec_parm.h
- * @brief AMEC Parameter Header File
- ******************************************************************************/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section _amec_parm_h amec_parm.h
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @ly001 853751 lychen 09/17/2012 Initial Revision
- * @ly002 860316 lychen 11/07/2012 Rename adding a core group function
- * @gs008 894661 gjsilva 08/08/2013 Initial support for DPS-FP mode
- * @gs009 897228 gjsilva 08/28/2013 Enablement of DPS-FP Mode
- * @gs017 905990 gjsilva 11/13/2013 Full support for tunable parameters
- * @gs018 907196 gjsilva 11/20/2013 Base support for soft frequency boundaries
- * @gs025 913663 gjsilva 01/30/2014 Full fupport for soft frequency boundaries
- *
- * @endverbatim
- *
- ******************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_part.h $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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_PART_H
#define _AMEC_PART_H
@@ -83,15 +84,10 @@ typedef struct amec_part
sensor_t util2msslack;
} amec_part_t;
-/**
- * @struct amec_part_config_t
- * @brief Partition Configuration Structure
- *
- * Main structure that contains the partition configuration for PLPM work.
- */
+// Main structure that contains the partition configuration for PLPM work.
typedef struct amec_part_config
{
- ///Data structure holding core to partition mapping. The value
+ ///Data structure holding core to partition mapping. The value
///AMEC_PART_INVALID_ID means that a core is not mapped to a partition. A
///value less than that means core is mapped to that partition index.
uint16_t core2part[MAX_NUM_CORES];
@@ -105,72 +101,50 @@ typedef struct amec_part_config
/*----------------------------------------------------------------------------*/
/**
- * @brief Given a core, return a valid partition that owns it, or NULL.
- * @param i_config Pointer to partition configuration
- * @param i_core_index The core number 0 to AMEC_PART_NUM_CORES - 1
- *
- * @return Valid pointer to partition that owns core, else NULL.
+ * Given a core, return a valid partition that owns it, or NULL.
+ *
*/
amec_part_t* amec_part_find_by_core(amec_part_config_t* i_config,
const uint16_t i_core_index);
/**
- * @brief Add a core group.
- *
* This function adds a new core group and should only be called within the
* AMEC ISR.
- *
- * @param i_id Core group ID that needs to be added
- *
- * @return void
+ *
*/
-void amec_part_add(uint8_t i_id); // @ly002c
+void amec_part_add(uint8_t i_id);
/**
- * @brief Add a core group.
- *
- * @return void
+ * Add a core group.
+ *
*/
void amec_part_init(void);
/**
- * @brief Update the parameter values depending on the DPS mode
- * that has been selected (Favor Energy or Favor
- * Performance).
- *
- * @param io_part A valid partition descriptor
- *
- * @return void
+ * Update the parameter values depending on the DPS mode that
+ * has been selected (Favor Energy or Favor Performance).
+ *
*/
void amec_part_update_dps_parameter(amec_part_t* io_part);
/**
- * @brief Update the internal performance settings for those
- * cores that belong to the input partition.
- *
- * @param io_part A valid partition descriptor
- *
- * @return void
+ * Update the internal performance settings for those cores that
+ * belong to the input partition.
+ *
*/
void amec_part_update_perf_settings(amec_part_t* io_part);
/**
- * @brief Update the power mode on all core groups that are following the
- * system mode.
- *
- * @param i_occ_internal_mode OCC internal system mode
- *
- * @return void
+ * Update the power mode on all core groups that are following
+ * the system mode.
+ *
*/
void AMEC_part_update_sysmode_policy(OCC_MODE i_occ_internal_mode);
/**
- * @brief Overwrite the tunable parameters used by the DPS algorithms
+ * Overwrite the tunable parameters used by the DPS algorithms
* whenever the Master OCC sends them.
- *
- * @param void
- *
- * @return void
+ *
*/
void AMEC_part_overwrite_dps_parameters(void);
diff --git a/src/occ/amec/amec_pcap.c b/src/occ/amec/amec_pcap.c
index a4d3ee6..c559248 100755
--- a/src/occ/amec/amec_pcap.c
+++ b/src/occ/amec/amec_pcap.c
@@ -1,27 +1,28 @@
-/******************************************************************************
-// @file amec_pcap.c
-// @brief Amec power cap Handling
-*/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section _amec_pcap_c amec_pcap.c
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @fk001 879727 fmkassem 04/16/2013 New file
- * @gm003 879727 milesg 07/01/2013 Changes from review
- * @at016 891144 alvinwan 06/10/2013 OCC Power Cap Testing
- * @gm012 905097 milesg 10/31/2013 Enhanced pcap tracing
- * @rt004 908817 tapiar 12/11/2013 Update valid pcap field for this
- * occ, to be used by master pcap matching
- * @at020 908666 alvinwan 12/16/2013 Oversubscription Error Handling
- *
- * @endverbatim
- *
- *///*************************************************************************/
-
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_pcap.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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
//*************************************************************************
@@ -37,12 +38,11 @@
// Externs
//*************************************************************************
-
-
//*************************************************************************
// Defines/Enums
//*************************************************************************
#define PPB_NOM_DROP_DELAY 4 //ticks
+
//*************************************************************************
// Structures
//*************************************************************************
@@ -53,7 +53,7 @@
//Number of ticks to wait before dropping below nominal frequency
#define PWR_SETTLED_TICKS 4
-//Number of watts power must be below the node power cap before raising
+//Number of watts power must be below the node power cap before raising
//ppb_fmax
#define PDROP_THRESH 0 //TODO: need better value.
//Number of MHz to raise the proc_pcap_vote for every watt of available power
@@ -71,7 +71,8 @@
//Frequency_step_khz (from global pstate table)/1000
uint32_t G_mhz_per_pstate=0; //TODO: Maybe there's a better value to initilize it to.
-uint8_t G_over_pcap_count=0;
+uint8_t G_over_pcap_count=0;
+
//*************************************************************************
// Function Prototypes
//*************************************************************************
@@ -86,13 +87,8 @@ uint8_t G_over_pcap_count=0;
// Name: amec_pmax_clip_controller
//
// Description: Calculate the pmax_clip_freq vote. Initialized to Turbo.
-//
-//
-// Flow: 02/28/13 FN= amec_pmax_clip_controller
//
-// Thread: Real Time Loop
-//
-// Changedby: @fk001a
+// Thread: Real Time Loop
//
// End Function Specification
void amec_pmax_clip_controller(void)
@@ -103,22 +99,22 @@ void amec_pmax_clip_controller(void)
uint16_t l_fturbo = G_sysConfigData.sys_mode_freq.table[OCC_MODE_TURBO];
uint32_t l_pmax_clip_freq = g_amec->proc[0].pwr_votes.pmax_clip_freq;
Pstate l_pstate = 0;
-
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
- //Note: quickPowerDrop interrupts will not preempt the real time loop
+ //Note: quickPowerDrop interrupts will not preempt the real time loop
// interrupt. No locking is needed between the two interrupts.
//Note: quickPowerDropLatchAmec represents the failsafe signal on ITEs and
// oversubscription signal on non-ITEs.
- // @at020c - start
// See the oversub event and control oversub in AMEC
if(AMEC_INTF_GET_OVERSUBSCRIPTION()&&
(g_amec->oversub_status.oversubLatchAmec==FALSE) )
{
- // ISR already did it but still need to do it again here due to l_pmax_clip_freq is incorrect
+ // ISR already did it but still need to do it again here due to
+ // l_pmax_clip_freq is incorrect
l_pmax_clip_freq = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
g_amec->oversub_status.oversubLatchAmec = TRUE;
}
@@ -127,7 +123,6 @@ void amec_pmax_clip_controller(void)
// AMEC doesn't control it and let ISR do it
g_amec->oversub_status.oversubLatchAmec = FALSE;
}
- // @at020c - end
if(l_pmax_clip_freq < l_fturbo)
{
@@ -145,25 +140,17 @@ void amec_pmax_clip_controller(void)
amec_oversub_pmax_clip(l_pstate);
}
-
-
g_amec->proc[0].pwr_votes.pmax_clip_freq = l_pmax_clip_freq;
-
-}
+}
//////////////////////////
// Function Specification
//
// Name: amec_pcap_calc
//
-// Description:
-//
-//
-// Flow: 02/27/13 FN= amec_pcap_calc
-//
-// Thread: Real Time Loop
+// Description: Calculate the node power cap and the processor power cap.
//
-// Changedby: @fk001a
+// Thread: Real Time Loop
//
// End Function Specification
void amec_pcap_calc(void)
@@ -172,19 +159,20 @@ void amec_pcap_calc(void)
/* Local Variables */
/*------------------------------------------------------------------------*/
bool l_failsafe_state = AMEC_INTF_GET_FAILSAFE();
- bool l_oversub_state = 0; // @at016c
+ bool l_oversub_state = 0;
uint16_t l_node_pwr = AMECSENSOR_PTR(PWR250US)->sample;
uint16_t l_p0_pwr = AMECSENSOR_PTR(PWR250USP0)->sample;
int32_t l_avail_power = 0;
uint32_t l_proc_fraction = 0;
- static uint32_t L_prev_node_pcap = 0; //gm003
+ static uint32_t L_prev_node_pcap = 0;
static bool l_apss_error_traced = FALSE;
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
//TRAC_INFO("amec_pcap_calc: Calculate active_node_pcap, and nom_pcap_fmin.");
- l_oversub_state = AMEC_INTF_GET_OVERSUBSCRIPTION(); // @at016a
+ l_oversub_state = AMEC_INTF_GET_OVERSUBSCRIPTION();
//Set the active_node_pcap in g_amec.
if(TRUE == l_failsafe_state)
@@ -201,21 +189,21 @@ void amec_pcap_calc(void)
g_amec->pcap.active_node_pcap = g_amec->pcap.norm_node_pcap;
}
- //Trace whenever the node pcap changes -- gm003
+ //Trace whenever the node pcap changes
if(L_prev_node_pcap != g_amec->pcap.active_node_pcap)
{
- TRAC_IMP("amec_pcap_calc: Node pcap set to %d watts.",
+ TRAC_IMP("amec_pcap_calc: Node pcap set to %d watts.",
g_amec->pcap.active_node_pcap);
L_prev_node_pcap = g_amec->pcap.active_node_pcap;
-
- // set this pcap as valid (needed by master for comparison) @rt004c
+
+ // set this pcap as valid (needed by master for comparison)
g_amec->pcap_valid = 1;
}
l_avail_power = g_amec->pcap.active_node_pcap - l_node_pwr;
if(l_node_pwr != 0)
{
- l_proc_fraction = ((uint32_t)(l_p0_pwr) << 16)/l_node_pwr;
+ l_proc_fraction = ((uint32_t)(l_p0_pwr) << 16)/l_node_pwr;
if(l_apss_error_traced)
{
TRAC_ERR("PCAP: PWR250US sensor is no longer 0.");
@@ -236,8 +224,7 @@ void amec_pcap_calc(void)
//TRAC_INFO("PCAP: calculated active proc pcap: avail_power[0x%X],proc_fraction[0x%X],"
// "active_proc_pcap[0x%X].",l_avail_power,l_proc_fraction,g_amec->pcap.active_proc_pcap);
-
- //NOTE: Power capping will not affect nominal cores unless a customer power cap is set below the
+ //NOTE: Power capping will not affect nominal cores unless a customer power cap is set below the
// max pcap or oversubscription occurs.
// However, nominal cores will drop below nominal if ppb_fmax drops below nominal.
if(g_amec->pcap.active_node_pcap < G_sysConfigData.pcap.max_pcap)
@@ -246,23 +233,18 @@ void amec_pcap_calc(void)
}
else
{
- g_amec->proc[0].pwr_votes.nom_pcap_fmin = G_sysConfigData.sys_mode_freq.table[OCC_MODE_NOMINAL];
+ g_amec->proc[0].pwr_votes.nom_pcap_fmin = G_sysConfigData.sys_mode_freq.table[OCC_MODE_NOMINAL];
}
-}
+}
//////////////////////////
// Function Specification
//
// Name: amec_pcap_controller
//
-// Description:
-//
-//
-// Flow: 02/27/13 FN= amec_pcap_controller
-//
-// Thread: Real Time Loop
+// Description: Execute the processor Pcap control loop.
//
-// Changedby: @fk001a
+// Thread: Real Time Loop
//
// End Function Specification
void amec_pcap_controller(void)
@@ -271,7 +253,8 @@ void amec_pcap_controller(void)
/* Local Variables */
/*------------------------------------------------------------------------*/
int32_t l_power_avail = 0;
- int32_t l_proc_pcap_vote = g_amec->proc[0].pwr_votes.proc_pcap_vote; // @at016c
+ int32_t l_proc_pcap_vote = g_amec->proc[0].pwr_votes.proc_pcap_vote;
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
@@ -292,13 +275,13 @@ void amec_pcap_controller(void)
{
l_proc_pcap_vote = G_sysConfigData.sys_mode_freq.table[OCC_MODE_TURBO];
}
-
+
if(l_proc_pcap_vote < G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY])
{
l_proc_pcap_vote = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
}
-
- //Power capping for nominal cores is not allowed to drop frequency below nom_pcap_fmin
+
+ //Power capping for nominal cores is not allowed to drop frequency below nom_pcap_fmin
if(l_proc_pcap_vote < g_amec->proc[0].pwr_votes.nom_pcap_fmin)
{
g_amec->proc[0].pwr_votes.proc_pcap_nom_vote = g_amec->proc[0].pwr_votes.nom_pcap_fmin;
@@ -307,23 +290,18 @@ void amec_pcap_controller(void)
{
g_amec->proc[0].pwr_votes.proc_pcap_nom_vote = l_proc_pcap_vote;
}
-
+
g_amec->proc[0].pwr_votes.proc_pcap_vote = l_proc_pcap_vote;
-}
+}
//////////////////////////
// Function Specification
//
// Name: amec_ppb_fmax_calc
//
-// Description:
-//
+// Description: Calculate the Performance Preserving Bounds (PPB) vote.
//
-// Flow: 02/27/13 FN= amec_ppb_fmax_calc
-//
-// Thread: Real Time Loop
-//
-// Changedby: @fk001a
+// Thread: Real Time Loop
//
// End Function Specification
void amec_ppb_fmax_calc(void)
@@ -333,6 +311,7 @@ void amec_ppb_fmax_calc(void)
/*------------------------------------------------------------------------*/
int32_t l_power_avail = 0;
bool l_continue = TRUE; //Used to break from code if needed.
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
@@ -345,13 +324,14 @@ void amec_ppb_fmax_calc(void)
//CALCULATION done by MASTER OCC only.
if(OCC_MASTER == G_occ_role)
{
-
//Power available is the ActiveNodePower - PowerDropThreshold - ActualPwr
l_power_avail = g_amec->pcap.active_node_pcap - PDROP_THRESH - AMECSENSOR_PTR(PWR250US)->sample;
- //Note: The PWR250US value is read over the SPI bus, which has no error detection. In order to prevent a
- //single bad SPI transfer from causing OCC to lower nominal core frequencies, we require the power to be over
- //the pcap for PPB_NOM_DROP_DELAY ticks before lowering PPB Fmax below Fnom.
+ //Note: The PWR250US value is read over the SPI bus, which has no error
+ //detection. In order to prevent a single bad SPI transfer from causing
+ //OCC to lower nominal core frequencies, we require the power to be over
+ //the pcap for PPB_NOM_DROP_DELAY ticks before lowering PPB Fmax below
+ //Fnom.
if((g_amec->proc[0].pwr_votes.ppb_fmax == G_sysConfigData.sys_mode_freq.table[OCC_MODE_NOMINAL])
&& (l_power_avail <=0))
{
@@ -366,8 +346,8 @@ void amec_ppb_fmax_calc(void)
G_over_pcap_count = 0;
}
- //Only run once every 4 ticks (1ms) to allow time for power hogging chips
- //to drop power and power starved chips to raise power.
+ //Only run once every 4 ticks (1ms) to allow time for power hogging
+ //chips to drop power and power starved chips to raise power.
if(l_continue && (0 == (G_current_tick & 0x3)))
{
if(l_power_avail <= 0)
@@ -389,9 +369,9 @@ void amec_ppb_fmax_calc(void)
G_sysConfigData.master_ppb_fmax = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
}
}
- }//End of Master code
+ }//End of Master code
+}
-}
//////////////////////////
// Function Specification
//
@@ -401,13 +381,8 @@ void amec_ppb_fmax_calc(void)
// Design uses 2 step procedure when OC is detected.
// 1) Lower all cores to Fnom
// 2) If still asserted after PWR_SETTLED_TICKS, lower all cores to Fmin
-//
-//
-// Flow: 02/28/13 FN= amec_conn_oc_controller
//
-// Thread: Real Time Loop
-//
-// Changedby: @fk001a
+// Thread: Real Time Loop
//
// End Function Specification
void amec_conn_oc_controller(void)
@@ -418,6 +393,7 @@ void amec_conn_oc_controller(void)
errlHndl_t l_err = NULL;
static uint8_t L_asserted_count = 0;
static bool L_error_logged = FALSE;
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
@@ -430,8 +406,7 @@ void amec_conn_oc_controller(void)
else
{
//Check if any of the OC gpio pins are set.
- //TODO:fk001 Not certain which gpio byte and pins are for the oc pins. This is needed for ITEs,
- //therefore set them when packet4 from TMGT is redifined to include oc data.
+ //TODO: G_conn_oc_pins_bitmap should be populated with data sent by TMGT.
if((G_conn_oc_pins_bitmap & ~(G_apss_pwr_meas.gpio[0])) == 0)
{
//Reset counter
@@ -456,15 +431,15 @@ void amec_conn_oc_controller(void)
/* @
* @errortype
* @moduleid AMEC_PCAP_CONN_OC_CONTROLLER
- * @reasoncode CONNECTOR_OC_PINS_WARNING
- * @userdata1 OC pin bitmap
- * @userdata2 APSS power measure gpio state
+ * @reasoncode CONNECTOR_OC_PINS_WARNING
+ * @userdata1 OC pin bitmap
+ * @userdata2 APSS power measure gpio state
* @devdesc The connector overcurrent pins are still asserted.
- *
+ *
*/
-
- //TODO:fk001 ADD ACTION FLAG for manufacturing error to log it as predictive. !!!!!
- if(!L_error_logged) //only log this error once -- gm003
+
+ //TODO: ADD ACTION FLAG for manufacturing error to log it as predictive.
+ if(!L_error_logged) //only log this error once
{
L_error_logged = TRUE;
l_err = createErrl(
@@ -476,7 +451,7 @@ void amec_conn_oc_controller(void)
DEFAULT_TRACE_SIZE, //Trace Size
G_conn_oc_pins_bitmap, //userdata1
G_apss_pwr_meas.gpio[0] //userdata2
- );
+ );
commitErrl( &l_err);
}
@@ -486,18 +461,18 @@ void amec_conn_oc_controller(void)
g_amec->proc[0].pwr_votes.conn_oc_vote = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
if(CURRENT_MODE() == OCC_MODE_NOMINAL)
- {
+ {
//Log a predictive error
TRAC_ERR("Connector overcurrent pins still asserted after max ticks. Logging error.");
/* @
* @errortype
* @moduleid AMEC_PCAP_CONN_OC_CONTROLLER
- * @reasoncode CONNECTOR_OC_PINS_FAILURE
- * @userdata1 OC pin bitmap
- * @userdata2 APSS power measure gpio state
+ * @reasoncode CONNECTOR_OC_PINS_FAILURE
+ * @userdata1 OC pin bitmap
+ * @userdata2 APSS power measure gpio state
* @devdesc The connector overcurrent pins are asserted for too long.
- *
+ *
*/
l_err = createErrl(
@@ -509,36 +484,25 @@ void amec_conn_oc_controller(void)
DEFAULT_TRACE_SIZE, //Trace Size
G_conn_oc_pins_bitmap, //userdata1
G_apss_pwr_meas.gpio[0] //userdata2
- );
+ );
-
commitErrl( &l_err);
//Request safe mode without retries.
- //TODO: add code to request OCC_MODE_SAFE with no retries.
+ //TODO: add code to request safe mode with no retries.
}
}
-
}
-
-
-
-
-}
+}
//////////////////////////
// Function Specification
//
// Name: amec_power_control
//
-// Description:
-//
-//
-// Flow: 02/27/13 FN= amec_power_control
+// Description: Main function for power control loop.
//
-// Thread: Real Time Loop
-//
-// Changedby: @fk001a
+// Thread: Real Time Loop
//
// End Function Specification
void amec_power_control(void)
@@ -555,7 +519,7 @@ void amec_power_control(void)
// and voting box input.
amec_pmax_clip_controller();
- // Calculate the power cap for the processor and the power capping limit
+ // Calculate the power cap for the processor and the power capping limit
// for nominal cores.
amec_pcap_calc();
@@ -567,6 +531,8 @@ void amec_power_control(void)
// Check for connector overcurrent condition and calculate voting box input frequency.
amec_conn_oc_controller();
-
}
+/*----------------------------------------------------------------------------*/
+/* End */
+/*----------------------------------------------------------------------------*/
diff --git a/src/occ/amec/amec_pcap.h b/src/occ/amec/amec_pcap.h
index 3dcb921..213af5d 100755
--- a/src/occ/amec/amec_pcap.h
+++ b/src/occ/amec/amec_pcap.h
@@ -1,21 +1,28 @@
-/******************************************************************************
-// @file amec_pcap.h
-// @brief AMEC power cap header file
-*/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section _amec_pcap_h amec_pcap.h
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @fk001 879727 fmkassem 04/24/2013 New file
- * @rt001 897459 tapiar 08/20/2013 moved PDROP_THRESH to .h
- *
- * @endverbatim
- *
- *///*************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_pcap.h $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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_PCAP_H
#define _AMEC_PCAP_H
@@ -37,7 +44,7 @@
// Defines/Enums
//*************************************************************************
-//Number of watts power must be below the node power cap before raising
+//Number of watts power must be below the node power cap before raising
//ppb_fmax
#define PDROP_THRESH 0 //TODO: need better value.
diff --git a/src/occ/amec/amec_perfcount.c b/src/occ/amec/amec_perfcount.c
index 3f28b29..3a6cc4a 100755
--- a/src/occ/amec/amec_perfcount.c
+++ b/src/occ/amec/amec_perfcount.c
@@ -1,23 +1,27 @@
-/******************************************************************************
- * @file amec_perfcount.c
- * @brief AMEC Performance Counter Code
- *
- * Structure Definition / Helper Functions for Performance Counter Calculations
- *
- ******************************************************************************/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section _amec_perfcount_c amec_perfcount.c
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @ly001 853751 lychen 09/17/2012 Initial Revision
- *
- * @endverbatim
- *
- ******************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_perfcount.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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 */
@@ -51,8 +55,6 @@
//
// Description: Calculate the performance counter for a core.
//
-// Flow: FN= None
-//
// End Function Specification
void amec_calc_dps_util_counters(const uint8_t i_core_id)
{
@@ -98,8 +100,6 @@ void amec_calc_dps_util_counters(const uint8_t i_core_id)
//
// Description: Build the performance counter for a core.
//
-// Flow: FN= None
-//
// End Function Specification
amec_core_perf_counter_t* amec_core_perf_counter_ctor(amec_core_perf_counter_t* i_this_ptr,
const uint8_t i_proc_id,
@@ -108,7 +108,7 @@ amec_core_perf_counter_t* amec_core_perf_counter_ctor(amec_core_perf_counter_t*
/*------------------------------------------------------------------------*/
/* Local Variables */
/*------------------------------------------------------------------------*/
-
+
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
diff --git a/src/occ/amec/amec_perfcount.h b/src/occ/amec/amec_perfcount.h
index 44c8d0e..38a9c7f 100755
--- a/src/occ/amec/amec_perfcount.h
+++ b/src/occ/amec/amec_perfcount.h
@@ -1,23 +1,31 @@
-/******************************************************************************
- * @file amec_perfcount.h
- * @brief AMEC Internal headers / structures
- ******************************************************************************/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section _amec_perfcount_h amec_perfcount.h
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @ly001 853751 lychen 09/17/2012 Initial Revision
- *
- * @endverbatim
- *
- ******************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_perfcount.h $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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_PERFCOUNT_H
#define _AMEC_PERFCOUNT_H
+
/*----------------------------------------------------------------------------*/
/* Includes */
/*----------------------------------------------------------------------------*/
@@ -65,23 +73,14 @@ typedef struct amec_core_perf_counter
/*----------------------------------------------------------------------------*/
/**
- * @brief Calculate the performance counter for a core
- * @param i_core_id Core ID that this struct belongs on
- *
- * @return void
+ * Calculate the performance counter for a core
+ *
*/
void amec_calc_dps_util_counters(const uint8_t i_core_id);
/**
- * @brief Build the performance counter for a core
- * @param this_ptr perf counter we wish to set up. NULL if you
- * wish to allocate one dynamically. A pointer
- * will be returned.
- * @param i_proc_id Processor ID that this struct belongs on
- * @param i_core_id Core ID that this struct belongs on
- *
- * @return amec_core_perf_counter_t* on success, NULL if an
- * error
+ * Build the performance counter for a core
+ *
*/
amec_core_perf_counter_t* amec_core_perf_counter_ctor(amec_core_perf_counter_t* i_this_ptr,
const uint8_t i_proc_id,
diff --git a/src/occ/amec/amec_sensors_centaur.c b/src/occ/amec/amec_sensors_centaur.c
index 7fa6b4d..1e2d3a3 100644
--- a/src/occ/amec/amec_sensors_centaur.c
+++ b/src/occ/amec/amec_sensors_centaur.c
@@ -1,30 +1,33 @@
-/******************************************************************************
-// @file amec_sensors_centaur.c
-// @brief AMEC Centaur Sensor Calculations
-*/
-/**
- * @page ChangeLogs Change Logs
- * @section _amec_sensors_centaur_c amec_sensors_centaur.c
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * -------- ---------- -------- -------- --------------------------------------
- * @th00X thallet 08/15/2012 New file
- * @th026 865074 thallet 12/21/2012 Updated Centaur sensors
- * @gm013 907548 milesg 11/22/2013 Memory therm monitoring support
- * @gm015 907601 milesg 12/06/2013 L4 Bank Delete circumvention and centaur i2c recovery
- * @gm016 909061 milesg 12/10/2013 Support memory throttling due to temperature
- * @gm039 922963 milesg 05/28/2014 Handle centaur nest LFIR 6
- * @mw633 933716 mware 07/29/2014 Increased maintenance command threshold to 12 from 8
- *
- * @endverbatim
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_sensors_centaur.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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 <occ_common.h>
-#include <ssx.h>
+#include <ssx.h>
#include <errl.h> // Error logging
#include "sensor.h"
#include "rtls.h"
@@ -48,72 +51,68 @@ cent_sensor_flags_t G_dimm_temp_updated_bitmap = {0};
uint8_t G_cent_overtemp_bitmap = 0;
uint8_t G_cent_temp_updated_bitmap = 0;
extern uint8_t G_centaur_needs_recovery;
-extern uint8_t G_centaur_nest_lfir6; //gm039
+extern uint8_t G_centaur_nest_lfir6;
/******************************************************************************/
/* Forward Declarations */
/******************************************************************************/
void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur);
void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur);
-void amec_perfcount_getmc( MemData * i_sensor_cache, uint8_t i_centaur); // @th026
-
+void amec_perfcount_getmc( MemData * i_sensor_cache, uint8_t i_centaur);
+/******************************************************************************/
+/* Code */
+/******************************************************************************/
// Function Specification
//
-// Name: amec_update_dimm_dts_sensors
+// Name: amec_update_dimm_dts_sensors
//
-// Description: Updates sensors taht have data grabbed by the fast core data
-//
-// Flow: FN=
+// Description: Updates sensors that have data grabbed by the fast core data
+// task.
//
// Thread: RealTime Loop
//
-// Task Flags:
-//
// End Function Specification
void amec_update_centaur_sensors(uint8_t i_centaur)
{
if(CENTAUR_PRESENT(i_centaur))
{
MemData * l_sensor_cache = cent_get_centaur_data_ptr(i_centaur);
- if(CENTAUR_UPDATED(i_centaur)) //gm016
+ if(CENTAUR_UPDATED(i_centaur))
{
amec_update_dimm_dts_sensors(l_sensor_cache, i_centaur);
amec_update_centaur_dts_sensors(l_sensor_cache, i_centaur);
}
- amec_perfcount_getmc(l_sensor_cache, i_centaur); // @th026
+ amec_perfcount_getmc(l_sensor_cache, i_centaur);
CLEAR_CENTAUR_UPDATED(i_centaur);
}
-
}
// Function Specification
//
-// Name: amec_update_dimm_dts_sensors
+// Name: amec_update_dimm_dts_sensors
//
-// Description: Updates sensors taht have data grabbed by the fast core data
-//
-// Flow: FN=
+// Description: Updates sensors that have data grabbed by the fast core data
+// task.
//
// Thread: RealTime Loop
//
-// Task Flags:
-//
// End Function Specification
void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
{
#define MIN_VALID_DIMM_TEMP 1
#define MAX_VALID_DIMM_TEMP 125 //according to Mike Pardiek
#define MAX_MEM_TEMP_CHANGE 2
+
uint32_t k, l_hottest_dimm_temp;
uint16_t l_dts[NUM_DIMMS_PER_CENTAUR] = {0};
uint32_t l_hottest_dimm_loc = NUM_DIMMS_PER_CENTAUR;
uint32_t l_sens_status;
int32_t l_dimm_temp, l_prev_temp;
static uint8_t L_ran_once[MAX_NUM_CENTAURS] = {FALSE};
-
- // so we will need to convert them before they are used in loop below.
+
+ // Harvest thermal data for all dimms
for(k=0; k < NUM_DIMMS_PER_CENTAUR; k++)
{
if(!CENTAUR_SENSOR_ENABLED(i_centaur, k))
@@ -131,7 +130,7 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
l_prev_temp = l_dimm_temp;
}
- //Check DTS status bits.
+ //Check DTS status bits.
if(l_sens_status == DIMM_SENSOR_STATUS_VALID_NEW)
{
//make sure temperature is within a 'reasonable' range.
@@ -144,7 +143,6 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
}
else
{
-
//don't allow temp to change more than is reasonable for 2ms
if(l_dimm_temp > (l_prev_temp + MAX_MEM_TEMP_CHANGE))
{
@@ -199,7 +197,7 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
//use last temperature
l_dts[k] = l_prev_temp;
- //request recovery (disable and re-enable sensor cache collection) -- gm015
+ //request recovery (disable and re-enable sensor cache collection)
if(l_sens_status == DIMM_SENSOR_STATUS_ERROR)
{
G_centaur_needs_recovery |= CENTAUR0_PRESENT_MASK >> i_centaur;
@@ -212,9 +210,7 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
//Set a bit so that this dimm can be called out by the thermal thread
G_dimm_overtemp_bitmap.bytes[i_centaur] |= 1 << k;
}
-
-
- }
+ }
// Find hottest temperature from all DIMMs for this centaur
for(l_hottest_dimm_temp = 0, k = 0; k < NUM_DIMMS_PER_CENTAUR; k++)
@@ -245,16 +241,12 @@ void amec_update_dimm_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
// Function Specification
//
-// Name: amec_update_centaur_dts_sensors
+// Name: amec_update_centaur_dts_sensors
//
// Description: Updates sensors taht have data grabbed by the fast core data
-//
-// Flow: FN=
//
// Thread: RealTime Loop
//
-// Task Flags:
-//
// End Function Specification
void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur)
{
@@ -288,9 +280,9 @@ void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur
l_prev_temp = l_cent_temp;
}
- //Check DTS status bits and NEST LFIR bit 6 for a valid temperature.
+ //Check DTS status bits and NEST LFIR bit 6 for a valid temperature.
if(l_sens_status == CENT_SENSOR_STATUS_VALID &&
- !(G_centaur_nest_lfir6 & (CENTAUR0_PRESENT_MASK >> i_centaur))) //gm039
+ !(G_centaur_nest_lfir6 & (CENTAUR0_PRESENT_MASK >> i_centaur)))
{
//make sure temperature is within a 'reasonable' range.
if(l_cent_temp < MIN_VALID_CENT_TEMP ||
@@ -302,7 +294,6 @@ void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur
}
else
{
-
//don't allow temp to change more than is reasonable for 2ms
if(l_cent_temp > (l_prev_temp + MAX_MEM_TEMP_CHANGE))
{
@@ -344,14 +335,14 @@ void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur
//Trace the error if we haven't traced it already for this sensor
//and this wasn't only caused by LFIR[6] (which is traced elsewhere).
if(!(l_fru->flags & FRU_SENSOR_STATUS_INVALID) &&
- !(l_sens_status == CENT_SENSOR_STATUS_VALID)) //gm039
+ !(l_sens_status == CENT_SENSOR_STATUS_VALID))
{
- TRAC_INFO("Centaur%d temp invalid. nest_lfir6=0x%02x", i_centaur, G_centaur_nest_lfir6); //gm039
+ TRAC_INFO("Centaur%d temp invalid. nest_lfir6=0x%02x", i_centaur, G_centaur_nest_lfir6);
}
l_fru->flags |= FRU_SENSOR_STATUS_INVALID;
- if(G_centaur_nest_lfir6 & (CENTAUR0_PRESENT_MASK >> i_centaur)) //gm039
+ if(G_centaur_nest_lfir6 & (CENTAUR0_PRESENT_MASK >> i_centaur))
{
l_fru->flags |= FRU_SENSOR_CENT_NEST_FIR6;
}
@@ -372,51 +363,47 @@ void amec_update_centaur_dts_sensors(MemData * i_sensor_cache, uint8_t i_centaur
// Update Interim Data - later this will get picked up to form centaur sensor
g_amec->proc[0].memctl[i_centaur].centaur.centaur_hottest.cur_temp = l_dts;
-
+
AMEC_DBG("Centaur[%d]: HotCentaur=%d\n",i_centaur,l_dts);
}
// Function Specification
//
-// Name: amec_update_centaur_temp_sensors
+// Name: amec_update_centaur_temp_sensors
//
-// Description: Updates sensors that have data grabbed by the centaur
-//
-// Flow: FN=
+// Description: Updates thermal sensors that have data grabbed by the centaur.
//
// Thread: RealTime Loop
//
-// Task Flags:
-//
// End Function Specification
void amec_update_centaur_temp_sensors(void)
{
uint32_t k, l_hot;
- // ------------------------------------------------------
+ // -----------------------------------------------------------
// Find hottest temperature from all centaurs for this P8 chip
- // ------------------------------------------------------
+ // -----------------------------------------------------------
for(l_hot = 0, k=0; k < MAX_NUM_CENTAURS; k++)
{
if(g_amec->proc[0].memctl[k].centaur.centaur_hottest.cur_temp > l_hot)
{
l_hot = g_amec->proc[0].memctl[k].centaur.centaur_hottest.cur_temp;
}
- }
+ }
sensor_update(&g_amec->proc[0].temp2mscent,l_hot);
AMEC_DBG("HotCentaur=%d\n",l_hot);
- // ------------------------------------------------------
+ // --------------------------------------------------------
// Find hottest temperature from all DIMMs for this P8 chip
- // ------------------------------------------------------
+ // --------------------------------------------------------
for(l_hot = 0, k=0; k < MAX_NUM_CENTAURS; k++)
{
if(g_amec->proc[0].memctl[k].centaur.tempdimmax.sample > l_hot)
{
l_hot = g_amec->proc[0].memctl[k].centaur.tempdimmax.sample;
}
- }
+ }
sensor_update(&g_amec->proc[0].temp2msdimm,l_hot);
AMEC_DBG("HotDimm=%d\n",l_hot);
}
@@ -424,16 +411,13 @@ void amec_update_centaur_temp_sensors(void)
// Function Specification
//
-// Name: amec_perfcount_getmc
+// Name: amec_perfcount_getmc
//
-// Description: Updates sensors that have data grabbed by the centaur
-//
-// Flow: FN=
+// Description: Updates performance sensors that have data grabbed by the
+// centaur.
//
// Thread: RealTime Loop
//
-// Task Flags:
-//
// End Function Specification
void amec_perfcount_getmc( MemData * i_sensor_cache,
uint8_t i_centaur)
@@ -470,9 +454,9 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
templ = l_sensor_cache->scache.mba23_wr;
}
- // ----------------------------------------------------
+ // ---------------------------------------------------------------------------
// Interim Calculation: MWR2MSP0Mx (0.01 Mrps) Memory write requests per sec
- // ----------------------------------------------------
+ // ---------------------------------------------------------------------------
// Extract write bandwidth
temp32new = (templ); // left shift into top 20 bits of 32 bits
@@ -481,13 +465,13 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.wr_cnt_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.memwrite2ms = tempreg;
- // ----------------------------------------------------
+ // -------------------------------------------------------------------------
// Interim Calculation: MRD2MSP0Mx (0.01 Mrps) Memory read requests per sec
- // ----------------------------------------------------
+ // -------------------------------------------------------------------------
// Extract read bandwidth
temp32new = (tempu); // left shift into top 20 bits of 32 bits
@@ -496,7 +480,7 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.rd_cnt_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.memread2ms = tempreg;
@@ -512,9 +496,9 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
templ = l_sensor_cache->scache.mba23_powerups;
}
- // ----------------------------------------------------
+ // ----------------------------------------------------------------
// Sensor: MPU2MSP0Mx (0.01 Mrps) Memory power-up requests per sec
- // ----------------------------------------------------
+ // ----------------------------------------------------------------
// Extract power up count
temp32new = (templ); // left shift into top 20 bits of 32 bits
@@ -525,9 +509,9 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.pwrup_cnt=(UINT16)tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(mpu2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // -------------------------------------------------------------------
// Sensor: MAC2MSP0Mx (0.01 Mrps) Memory activation requests per sec
- // ----------------------------------------------------
+ // -------------------------------------------------------------------
// Extract activation count
temp32 = templ;
temp32 += tempu;
@@ -540,9 +524,9 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.act_cnt=(UINT16)tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(mac2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // --------------------------------------------------------------------------
// Sensor: MTS2MS (count) Last received Timestamp (frame count) from Centaur
- // ----------------------------------------------------
+ // --------------------------------------------------------------------------
// Extract framecount (clock is 266.6666666MHz * 0.032 / 4096)=2083.
temp32new = l_sensor_cache->scache.frame_count;
@@ -564,9 +548,9 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
tempu = l_sensor_cache->scache.mba23_cache_hits_rd;
templ = l_sensor_cache->scache.mba23_cache_hits_wr;
}
- // ----------------------------------------------------
+ // ----------------------------------------------------------------------
// Sensor: M4RD2MS (0.01 Mrps) Memory cached (L4) read requests per sec
- // ----------------------------------------------------
+ // ----------------------------------------------------------------------
temp32new = (tempu); // left shift into top 20 bits of 32 bits
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.l4_rd_cnt_accum;
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.l4_rd_cnt_accum = temp32new; // Save latest accumulator away for next time
@@ -574,9 +558,9 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
tempreg = ((temp32*5)/100);
tempreg2 = g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.memread2ms;
- // Firmware workaround for hardware bug: hits - memreads ~= hits @mw565
+ // Firmware workaround for hardware bug: hits - memreads ~= hits
tempreg = tempreg - tempreg2;
- // Deal with maintenance commands or quantization in counters being off by 12 and force to 0 // @mw565 @mw633
+ // Deal with maintenance commands or quantization in counters being off by 12 and force to 0
if ((tempreg > 32767) || (tempreg <= 12))
{
tempreg=0;
@@ -585,20 +569,20 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.l4rd2ms = tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(m4rd2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // -----------------------------------------------------------------------
// Sensor: M4WR2MS (0.01 Mrps) Memory cached (L4) write requests per sec
- // ----------------------------------------------------
+ // -----------------------------------------------------------------------
temp32new = (templ); // left shift into top 20 bits of 32 bits
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.l4_wr_cnt_accum;
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.l4_wr_cnt_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
tempreg2 = g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.memwrite2ms;
- // Firmware workaround for hardware bug: hits - memwrites ~= hits @mw565
+ // Firmware workaround for hardware bug: hits - memwrites ~= hits
tempreg = tempreg - tempreg2;
- // Deal with maintenance commands or quantization in counters being off by 12 and force to 0 // @mw565 @mw633
+ // Deal with maintenance commands or quantization in counters being off by 12 and force to 0
if ((tempreg > 32767) || (tempreg <= 12))
{
tempreg=0;
@@ -607,64 +591,64 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.l4wr2ms = tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(m4wr2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // ------------------------------------------------------------------------------
// Sensor: MIRB2MS (0.01 Mevents/s) Memory Inter-request arrival idle intervals
- // ----------------------------------------------------
+ // ------------------------------------------------------------------------------
temp32new = (i_mc_id == 0) ? l_sensor_cache->scache.mba01_intreq_arr_cnt_base : l_sensor_cache->scache.mba23_intreq_arr_cnt_base;
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_base_accum;
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_base_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.mirb2ms = tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(mirb2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // --------------------------------------------------------------------------------------------------------
// Sensor: MIRL2MS (0.01 Mevents/s) Memory Inter-request arrival idle intervals longer than low threshold
- // ----------------------------------------------------
+ // --------------------------------------------------------------------------------------------------------
temp32new = (i_mc_id == 0) ? l_sensor_cache->scache.mba01_intreq_arr_cnt_low : l_sensor_cache->scache.mba23_intreq_arr_cnt_low;
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_low_accum;
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_low_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.mirl2ms = tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(mirl2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------
// Sensor: MIRM2MS (0.01 Mevents/s) Memory Inter-request arrival idle intervals longer than medium threshold
- // ----------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------
temp32new = (i_mc_id == 0) ? l_sensor_cache->scache.mba01_intreq_arr_cnt_med : l_sensor_cache->scache.mba23_intreq_arr_cnt_med;
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_med_accum;
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_med_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.mirm2ms = tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(mirm2ms,i_centaur,i_mc_id), tempreg);
- // ----------------------------------------------------
+ // ---------------------------------------------------------------------------------------------------------
// Sensor: MIRH2MS (0.01 Mevents/s) Memory Inter-request arrival idle intervals longer than high threshold
- // ----------------------------------------------------
+ // ---------------------------------------------------------------------------------------------------------
temp32new = (i_mc_id == 0) ? l_sensor_cache->scache.mba01_intreq_arr_cnt_high : l_sensor_cache->scache.mba23_intreq_arr_cnt_high;
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_high_accum;
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.intreq_high_accum = temp32new; // Save latest accumulator away for next time
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.portpair[i_mc_id].perf.mirh2ms = tempreg;
sensor_update(AMECSENSOR_PORTPAIR_PTR(mirh2ms,i_centaur,i_mc_id), tempreg);
}
- // ----------------------------------------------------
+ // --------------------------------------------------------------------------------------------------------------
// Sensor: MIRC2MS (0.01 Mevents/s) Memory Inter-request arrival idle interval longer than programmed threshold
- // ----------------------------------------------------
+ // --------------------------------------------------------------------------------------------------------------
temp32new = l_sensor_cache->scache.intreq_arr_cnt_high_latency;
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.perf.intreq_highlatency_accum;
g_amec->proc[0].memctl[i_centaur].centaur.perf.intreq_highlatency_accum = temp32new; // Save latest accumulator away for next time
-
+
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.perf.mirc2ms = tempreg;
sensor_update((&(g_amec->proc[0].memctl[i_centaur].centaur.mirc2ms)), tempreg);
@@ -674,30 +658,29 @@ void amec_perfcount_getmc( MemData * i_sensor_cache,
temp32new = l_sensor_cache->scache.lp2_exits;
temp32 = temp32new - g_amec->proc[0].memctl[i_centaur].centaur.perf.lp2exit_accum;
g_amec->proc[0].memctl[i_centaur].centaur.perf.lp2exit_accum = temp32new; // Save latest accumulator away for next time
-
+
// Read every 2 ms....to convert to 0.01 Mrps = ((2ms read * 500)/10000)
- tempreg = ((temp32*5)/100);
+ tempreg = ((temp32*5)/100);
g_amec->proc[0].memctl[i_centaur].centaur.perf.mlp2_2ms = tempreg;
sensor_update((&(g_amec->proc[0].memctl[i_centaur].centaur.mlp2ms)), tempreg);
- // ----------------------------------------------------
+ // ------------------------------------------------------------
// Sensor: MRD2MSP0Mx (0.01 Mrps) Memory read requests per sec
- // ----------------------------------------------------
- //AMEC_SENSOR_UPDATE(io_mc_ptr->chpair[i_mc_id].memread32ms, tempreg);
+ // ------------------------------------------------------------
tempreg = g_amec->proc[0].memctl[i_centaur].centaur.portpair[0].perf.memread2ms;
tempreg += g_amec->proc[0].memctl[i_centaur].centaur.portpair[1].perf.memread2ms;
sensor_update( (&(g_amec->proc[0].memctl[i_centaur].mrd2ms)), tempreg);
-
- // ----------------------------------------------------
+
+ // -------------------------------------------------------------
// Sensor: MWR2MSP0Mx (0.01 Mrps) Memory write requests per sec
- // ----------------------------------------------------
- //sensor_update(AMECSENSOR_ARRAY_PTR(MRD2MSP0M0,), tempreg )
+ // -------------------------------------------------------------
tempreg = g_amec->proc[0].memctl[i_centaur].centaur.portpair[0].perf.memwrite2ms;
tempreg += g_amec->proc[0].memctl[i_centaur].centaur.portpair[1].perf.memwrite2ms;
sensor_update( (&(g_amec->proc[0].memctl[i_centaur].mwr2ms)), tempreg);
-
return;
}
-
+/*----------------------------------------------------------------------------*/
+/* End */
+/*----------------------------------------------------------------------------*/
diff --git a/src/occ/amec/amec_sensors_centaur.h b/src/occ/amec/amec_sensors_centaur.h
index f24fb68..64db6eb 100644
--- a/src/occ/amec/amec_sensors_centaur.h
+++ b/src/occ/amec/amec_sensors_centaur.h
@@ -1,31 +1,36 @@
-/******************************************************************************
-// @file amec_sensors_centaur.h
-// @brief OCC AMEC Sensors Derived from Centaur
-*/
-/******************************************************************************
- *
- * @page ChangeLogs Change Logs
- * @section amec_sensors_centaur.h AMEC_SENSORS_CENTAUR.H
- * @verbatim
- *
- * Flag Def/Fea Userid Date Description
- * ------- ---------- -------- ---------- ----------------------------------
- * @th018 852950 thallet 09/12/2012 Added Centaur thermal readings
- *
- * @endverbatim
- *
- *///*************************************************************************/
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ/amec/amec_sensors_centaur.h $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* [+] Google Inc. */
+/* [+] 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_SENSORS_CENTAUR_H
#define _AMEC_SENSORS_CENTAUR_H
-
//*************************************************************************
// Function Prototypes
//*************************************************************************
void amec_update_centaur_sensors(uint8_t i_centaur);
void amec_update_centaur_temp_sensors(void);
-
#endif
OpenPOWER on IntegriCloud