summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/gpe_24x7_structs.h46
-rw-r--r--src/common/ipc_func_ids.h5
-rw-r--r--src/occ_405/occ_service_codes.h3
-rwxr-xr-xsrc/occ_405/proc/proc_data.c117
-rwxr-xr-xsrc/occ_405/proc/proc_data.h6
-rwxr-xr-xsrc/occ_405/proc/proc_data_service_codes.h3
-rwxr-xr-xsrc/occ_405/rtls/rtls.h3
-rwxr-xr-xsrc/occ_405/rtls/rtls_tables.c24
-rw-r--r--src/occ_gpe1/gpe1_24x7.c113
-rw-r--r--src/occ_gpe1/ipc_func_tables.c14
-rw-r--r--src/occ_gpe1/topfiles.mk6
11 files changed, 324 insertions, 16 deletions
diff --git a/src/common/gpe_24x7_structs.h b/src/common/gpe_24x7_structs.h
new file mode 100644
index 0000000..9b8716a
--- /dev/null
+++ b/src/common/gpe_24x7_structs.h
@@ -0,0 +1,46 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/common/gpe_24x7_structs.h $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* [+] 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 header file is used by both occ_405 and occ_gpe1. */
+/* Contains common structures and globals. */
+
+#ifndef _GPE_24X7_STRUCTS_H
+#define _GPE_24X7_STRUCTS_H
+
+#include <gpe_export.h>
+#include "gpe_err.h"
+
+
+// 24x7 collection arguments (GPE1)
+typedef struct
+{
+ GpeErrorStruct error;
+ uint8_t numTicksPassed;
+} gpe_24x7_args_t;
+
+// Number of "states" 24x7 collection code is broken up into
+#define MAX_24x7_STATES 16
+
+#endif // _GPE_24X7_STRUCTS_H
diff --git a/src/common/ipc_func_ids.h b/src/common/ipc_func_ids.h
index da2285e..6d732d8 100644
--- a/src/common/ipc_func_ids.h
+++ b/src/common/ipc_func_ids.h
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/ipc_func_ids.h $ */
+/* $Source: src/common/ipc_func_ids.h $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -68,6 +68,7 @@ IPC_FUNCIDS_TABLE_START
IPC_FUNC_ID(IPC_ST_DIMM_CONTROL_FUNCID)
IPC_FUNC_ID(IPC_ST_GPE1_NOP)
IPC_FUNC_ID(IPC_ST_RESET_MEM_DEADMAN)
+ IPC_FUNC_ID(IPC_ST_24_X_7_FUNCID)
IPC_FUNCIDS_ST_END(OCCHW_INST_ID_GPE1)
//Functions that are only supported by GPE2 should be defined here
diff --git a/src/occ_405/occ_service_codes.h b/src/occ_405/occ_service_codes.h
index 0750cf1..4be6758 100644
--- a/src/occ_405/occ_service_codes.h
+++ b/src/occ_405/occ_service_codes.h
@@ -244,6 +244,9 @@ enum occExtReasonCode
ERC_PGPE_PPMR_OPPB_SIZE_MISMATCH = 0x00B8,
ERC_WOF_QUAD_COUNT_FAILURE = 0x00C0,
+
+ ERC_24X7_GPE_CREATE_FAILURE = 0x00D0,
+ ERC_24X7_GPE_SCHEDULE_FAILURE = 0x00D1,
};
// Error log Module Ids
diff --git a/src/occ_405/proc/proc_data.c b/src/occ_405/proc/proc_data.c
index 4de6925..f4810eb 100755
--- a/src/occ_405/proc/proc_data.c
+++ b/src/occ_405/proc/proc_data.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,6 +38,8 @@
#include "pgpe_interface.h"
#include "cmdh_fsp.h"
#include "sensor.h"
+#include "gpe_24x7_structs.h"
+
//Global array of core data buffers
GPE_BUFFER(CoreData G_core_data[MAX_NUM_FW_CORES+NUM_CORE_DATA_DOUBLE_BUF+NUM_CORE_DATA_EMPTY_BUF]) = {{{0}}};
@@ -53,6 +55,11 @@ GPE_BUFFER(ipc_scom_op_t G_core_stat_scom_op);
GPE_BUFFER(ipc_core_data_parms_t G_low_cores_data_parms);
GPE_BUFFER(ipc_core_data_parms_t G_high_cores_data_parms);
+//Globals for 24x7 collection
+GPE_BUFFER(gpe_24x7_args_t G_24x7_parms);
+GpeRequest G_24x7_request;
+bool G_24x7_disabled = FALSE;
+
// IPC Gpe request structure for gathering nest dts temps
GpeRequest G_nest_dts_gpe_req;
@@ -405,6 +412,45 @@ void proc_core_init( void )
break;
}
+ //Initialize 24x7 data collection GpeRequest object
+ l_rc = gpe_request_create(&G_24x7_request, // GpeRequest for the task
+ &G_async_gpe_queue1, // Queue for GPE1
+ IPC_ST_24_X_7_FUNCID, // Function ID
+ &G_24x7_parms, // Task parameters
+ SSX_WAIT_FOREVER, // Timeout (none)
+ NULL, // Callback
+ NULL, // Callback arguments
+ ASYNC_CALLBACK_IMMEDIATE); // Options
+
+ if( l_rc )
+ {
+ // If we failed to create the GpeRequest then there is a serious problem.
+ MAIN_TRAC_ERR("proc_core_init: Failure creating 24x7 GpeRequest. [RC=0x%08x]", l_rc );
+
+ /*
+ * @errortype
+ * @moduleid PROC_CORE_INIT_MOD
+ * @reasoncode SSX_GENERIC_FAILURE
+ * @userdata1 gpe_request_create return code
+ * @userdata4 ERC_24X7_GPE_CREATE_FAILURE
+ * @devdesc Failure to create 24x7 GpeRequest object
+ */
+ l_err = createErrl(
+ PROC_CORE_INIT_MOD, //ModId
+ SSX_GENERIC_FAILURE, //Reasoncode
+ ERC_24X7_GPE_CREATE_FAILURE, //Extended reason code
+ ERRL_SEV_PREDICTIVE, //Severity
+ l_trace, //Trace Buf
+ DEFAULT_TRACE_SIZE, //Trace Size
+ l_rc, //Userdata1
+ 0 //Userdata2
+ );
+
+ CHECKPOINT_FAIL_AND_HALT(l_err);
+ break;
+ }
+
+
} while(0);
// Initialize the core data control at the same time
@@ -605,6 +651,75 @@ void nest_dts_init(void)
}
}
+// Function Specification
+//
+// Name: task_24x7
+//
+// Description: Called every tick while active/obs state to do 24x7 data collection
+//
+// End Function Specification
+void task_24x7(task_t * i_task)
+{
+ static uint8_t L_numTicks = 0x00; // never called since OCC started
+
+ if (!G_24x7_disabled)
+ {
+ // Schedule 24x7 task if idle
+ if (!async_request_is_idle(&G_24x7_request.request))
+ {
+ INTR_TRAC_ERR("task_24x7: request not idle");
+ L_numTicks++;
+ }
+ else
+ {
+ // Clear errors and init parameters for GPE task
+ G_24x7_parms.error.error = 0;
+ G_24x7_parms.numTicksPassed = L_numTicks;
+
+ int l_rc = gpe_request_schedule(&G_24x7_request);
+ if (0 == l_rc)
+ {
+ L_numTicks = 1; // next time called will be 1 tick later
+ }
+ else
+ {
+ errlHndl_t l_err = NULL;
+ INTR_TRAC_ERR("task_24x7: schedule failed w/rc=0x%08X (%d us)",
+ l_rc, (int) ((ssx_timebase_get())/(SSX_TIMEBASE_FREQUENCY_HZ/1000000)));
+ /*
+ * @errortype
+ * @moduleid PROC_24X7_MOD
+ * @reasoncode SSX_GENERIC_FAILURE
+ * @userdata1 gpe_request_schedule return code
+ * @userdata4 ERC_24X7_GPE_SCHEDULE_FAILURE
+ * @devdesc Failure to schedule 24x7 GpeRequest
+ */
+ l_err = createErrl(
+ PROC_24X7_MOD, //ModId
+ SSX_GENERIC_FAILURE, //Reasoncode
+ ERC_24X7_GPE_SCHEDULE_FAILURE, //Extended reason code
+ ERRL_SEV_PREDICTIVE, //Severity
+ NULL, //Trace Buf
+ DEFAULT_TRACE_SIZE, //Trace Size
+ l_rc, //Userdata1
+ 0 //Userdata2
+ );
+
+ // Request reset since this should never happen.
+ REQUEST_RESET(l_err);
+ }
+ }
+ } // !G_24x7_disabled
+ else
+ {
+ // 24x7 is disabled INC number ticks so 24x7 knows how many ticks it was disabled for
+ L_numTicks++;
+ }
+
+ return;
+} // end task_24x7()
+
+
#ifdef PROC_DEBUG
// Function Specification
//
diff --git a/src/occ_405/proc/proc_data.h b/src/occ_405/proc/proc_data.h
index 796ed9b..ebef6d0 100755
--- a/src/occ_405/proc/proc_data.h
+++ b/src/occ_405/proc/proc_data.h
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -136,4 +136,8 @@ void nest_dts_init( void ) INIT_SECTION;
//associated with the specified OCC core id.
CoreData * proc_get_bulk_core_data_ptr( const uint8_t i_occ_core_id );
+// 24x7 data collection
+void task_24x7( task_t * i_task );
+
+
#endif //_PROC_DATA_H
diff --git a/src/occ_405/proc/proc_data_service_codes.h b/src/occ_405/proc/proc_data_service_codes.h
index b9e0806..7e0ab19 100755
--- a/src/occ_405/proc/proc_data_service_codes.h
+++ b/src/occ_405/proc/proc_data_service_codes.h
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,6 +38,7 @@ enum procModuleId
PROC_PSTATE_KVM_SETUP_MOD = PROC_COMP_ID | 0x05,
PROC_TASK_NEST_DTS_MOD = PROC_COMP_ID | 0x06,
PROC_NEST_DTS_INIT_MOD = PROC_COMP_ID | 0x07,
+ PROC_24X7_MOD = PROC_COMP_ID | 0x08,
};
#endif /* #ifndef _PROC_DATA_SERVICE_CODES_H_ */
diff --git a/src/occ_405/rtls/rtls.h b/src/occ_405/rtls/rtls.h
index 8babaab..d7eaf5f 100755
--- a/src/occ_405/rtls/rtls.h
+++ b/src/occ_405/rtls/rtls.h
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -60,6 +60,7 @@ typedef enum {
TASK_ID_DIMM_SM, // DIMM State Machine
TASK_ID_MEMORY_CONTROL, // Memory (centaur/dimm) control task
TASK_ID_NEST_DTS,
+ TASK_ID_24X7, // 24x7 data collection task
TASK_END // This must always be the last enum in this list,
// so that TASK_END always equals the last task ID + 1.
} task_id_t;
diff --git a/src/occ_405/rtls/rtls_tables.c b/src/occ_405/rtls/rtls_tables.c
index fdcce40..b25eea6 100755
--- a/src/occ_405/rtls/rtls_tables.c
+++ b/src/occ_405/rtls/rtls_tables.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -61,6 +61,9 @@
#define FLAGS_AMEC_SLAVE RTL_FLAG_MSTR | RTL_FLAG_NOTMSTR | RTL_FLAG_OBS | RTL_FLAG_ACTIVE | RTL_FLAG_MSTR_READY | RTL_FLAG_NO_APSS | RTL_FLAG_RUN | RTL_FLAG_APSS_NOT_INITD
#define FLAGS_AMEC_MASTER RTL_FLAG_MSTR | RTL_FLAG_OBS | RTL_FLAG_ACTIVE | RTL_FLAG_MSTR_READY | RTL_FLAG_NO_APSS | RTL_FLAG_RUN | RTL_FLAG_APSS_NOT_INITD
+#define FLAGS_24X7 RTL_FLAG_MSTR | RTL_FLAG_NOTMSTR | RTL_FLAG_OBS | RTL_FLAG_ACTIVE | RTL_FLAG_MSTR_READY | RTL_FLAG_NO_APSS | RTL_FLAG_RUN | RTL_FLAG_APSS_NOT_INITD
+
+
#define FLAGS_APSS_START_MEAS APSS_TASK_FLAGS
#define FLAGS_APSS_CONT_MEAS APSS_TASK_FLAGS
#define FLAGS_APSS_DONE_MEAS APSS_TASK_FLAGS
@@ -117,8 +120,9 @@ task_t G_task_table[TASK_END] = {
// TODO RTC: 133824 - New GPU interface via main memory and SMBUS
// { FLAGS_GPU_SM, task_gpu_sm, NULL }, // TASK_ID_GPU_SM
{ FLAGS_MEMORY_DATA, task_dimm_sm, NULL }, // TASK_ID_DIMM_SM
- { FLAGS_MEMORY_CONTROL, task_memory_control, (void *) &G_memory_control_task }, // TASK_ID_MEMORY_CONTROL
+ { FLAGS_MEMORY_CONTROL, task_memory_control, (void *) &G_memory_control_task }, // TASK_ID_MEMORY_CONTROL
{ FLAGS_NEST_DTS, task_nest_dts, NULL },
+ { FLAGS_24X7, task_24x7, NULL }, // TASK_ID_24X7
};
const uint8_t G_tick0_seq[] = {
@@ -130,6 +134,7 @@ const uint8_t G_tick0_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -149,6 +154,7 @@ const uint8_t G_tick1_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -170,6 +176,7 @@ const uint8_t G_tick2_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -190,6 +197,7 @@ const uint8_t G_tick3_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -210,6 +218,7 @@ const uint8_t G_tick4_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -229,6 +238,7 @@ const uint8_t G_tick5_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -249,6 +259,7 @@ const uint8_t G_tick6_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -268,6 +279,7 @@ const uint8_t G_tick7_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -288,6 +300,7 @@ const uint8_t G_tick8_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -307,6 +320,7 @@ const uint8_t G_tick9_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -328,6 +342,7 @@ const uint8_t G_tick10_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -347,6 +362,7 @@ const uint8_t G_tick11_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -367,6 +383,7 @@ const uint8_t G_tick12_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -386,6 +403,7 @@ const uint8_t G_tick13_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -406,6 +424,7 @@ const uint8_t G_tick14_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
@@ -425,6 +444,7 @@ const uint8_t G_tick15_seq[] = {
TASK_ID_APSS_DONE,
TASK_ID_MEMORY_CONTROL,
TASK_ID_CORE_DATA_CONTROL,
+ TASK_ID_24X7,
TASK_ID_DCOM_WAIT_4_MSTR,
TASK_ID_DCOM_RX_INBX,
TASK_ID_DCOM_RX_OUTBX,
diff --git a/src/occ_gpe1/gpe1_24x7.c b/src/occ_gpe1/gpe1_24x7.c
new file mode 100644
index 0000000..eb9d25f
--- /dev/null
+++ b/src/occ_gpe1/gpe1_24x7.c
@@ -0,0 +1,113 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/occ_gpe1/gpe1_24x7.c $ */
+/* */
+/* OpenPOWER OnChipController Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* [+] 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 */
+
+#include "pk.h"
+#include "ppe42_scom.h"
+#include "ipc_api.h"
+#include "ipc_async_cmd.h"
+#include "gpe_util.h"
+#include "gpe_24x7_structs.h"
+
+/*
+ * Function Specifications:
+ *
+ * Name: gpe_24x7
+ *
+ * Description: 24x7 code on the GPE. Owned by the performance team
+ *
+ * Inputs: cmd is a pointer to IPC msg's cmd and cmd_data struct
+ *
+ * Outputs: error: sets rc, address, and ffdc in the cmd_data's
+ * GpeErrorStruct
+ *
+ * End Function Specification
+ */
+
+void gpe_24x7(ipc_msg_t* cmd, void* arg)
+{
+ // Note: arg was set to 0 in ipc func table (ipc_func_tables.c), so don't use it.
+ // the ipc arguments passed through the ipc_msg_t structure, has a pointer
+ // to the gpe_24x7_args_t struct.
+
+ int rc = 0;
+ ipc_async_cmd_t *async_cmd = (ipc_async_cmd_t*)cmd;
+ gpe_24x7_args_t *args = (gpe_24x7_args_t*)async_cmd->cmd_data;
+
+ uint8_t ticks = args->numTicksPassed; // number of 250us ticks since last call
+ static uint8_t L_current_state = 1; // 24x7 collection "state" to execute when called
+
+ args->error.error = 0; // default success
+ args->error.ffdc = 0;
+
+ if(ticks == 0) // First time 24x7 called since OCC started?
+ {
+ PK_TRACE("gpe_24x7: First call since OCC started");
+ }
+ else if(ticks > 1) // longer than 250us since last call?
+ {
+ // It has been ticks*250us since last call
+ PK_TRACE("gpe_24x7: It has been 0x%02X ticks since last call", ticks);
+ }
+
+ switch(L_current_state)
+ {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ break;
+
+ default:
+ PK_TRACE("gpe_24x7: Invalid collection state: 0x%02X", L_current_state);
+ break;
+ }
+
+ // Setup state to run on next call
+ if(L_current_state == MAX_24x7_STATES)
+ L_current_state = 1;
+ else
+ L_current_state++;
+
+ // send back a response, IPC success even if ffdc/rc are non zeros
+ rc = ipc_send_rsp(cmd, IPC_RC_SUCCESS);
+ if(rc)
+ {
+ PK_TRACE("gpe_24x7: Failed to send response back. Halting GPE1");
+ gpe_set_ffdc(&(args->error), 0x00, GPE_RC_IPC_SEND_FAILED, rc);
+ pk_halt();
+ }
+}
diff --git a/src/occ_gpe1/ipc_func_tables.c b/src/occ_gpe1/ipc_func_tables.c
index 7cc9927..c2740e9 100644
--- a/src/occ_gpe1/ipc_func_tables.c
+++ b/src/occ_gpe1/ipc_func_tables.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -28,6 +28,8 @@
void gpe_dimm_control(ipc_msg_t* cmd, void* arg);
void gpe1_nop(ipc_msg_t* cmd, void* arg);
void gpe_reset_mem_deadman(ipc_msg_t* cmd, void* arg);
+void gpe_24x7(ipc_msg_t* cmd, void* arg);
+
// Function table for multi target (common) functions
IPC_MT_FUNC_TABLE_START
@@ -43,11 +45,11 @@ IPC_MT_FUNC_TABLE_END
// Function table for single target (processor-specific) functions
IPC_ST_FUNC_TABLE_START
-IPC_HANDLER(gpe_dimm_sm, 0) // 0 - IPC_ST_DIMM_SM_FUNCID
-IPC_HANDLER(gpe_dimm_control, 0) // 1 - IPC_ST_DIMM_CONTROL_FUNCID
-IPC_HANDLER(gpe1_nop, 0) // 2 - IPC_ST_GPE1_NOP
-IPC_HANDLER(gpe_reset_mem_deadman, 0) // 3 - IPC_ST_RESET_MEM_DEADMAN
-IPC_HANDLER_DEFAULT // 4
+IPC_HANDLER(gpe_dimm_sm, 0) // 0 - IPC_ST_DIMM_SM_FUNCID
+IPC_HANDLER(gpe_dimm_control, 0) // 1 - IPC_ST_DIMM_CONTROL_FUNCID
+IPC_HANDLER(gpe1_nop, 0) // 2 - IPC_ST_GPE1_NOP
+IPC_HANDLER(gpe_reset_mem_deadman, 0) // 3 - IPC_ST_RESET_MEM_DEADMAN
+IPC_HANDLER(gpe_24x7, 0) // 4 - IPC_ST_24_X_7_FUNCID
IPC_HANDLER_DEFAULT // 5
IPC_HANDLER_DEFAULT // 6
IPC_HANDLER_DEFAULT // 7
diff --git a/src/occ_gpe1/topfiles.mk b/src/occ_gpe1/topfiles.mk
index 75a8fbc..9983f69 100644
--- a/src/occ_gpe1/topfiles.mk
+++ b/src/occ_gpe1/topfiles.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER OnChipController Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2016
+# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
@@ -24,7 +24,9 @@
# IBM_PROLOG_END_TAG
TOP-C-SOURCES = gpe1_main.c gpe1_dimm_read.c gpe1_dimm_reset.c nop.c \
- pk_app_irq_table.c ipc_func_tables.c gpe1_dimm_control.c
+ pk_app_irq_table.c ipc_func_tables.c gpe1_dimm_control.c \
+ gpe1_24x7.c
+
TOP-S-SOURCES =
TOP_OBJECTS = $(TOP-C-SOURCES:.c=.o) $(TOP-S-SOURCES:.S=.o)
OpenPOWER on IntegriCloud