diff options
author | mbroyles <mbroyles@us.ibm.com> | 2017-02-07 11:48:21 -0600 |
---|---|---|
committer | Martha Broyles <mbroyles@us.ibm.com> | 2017-02-14 12:39:40 -0500 |
commit | 3efbd9ee6aa3547e856c72f37f7e734000c89b56 (patch) | |
tree | 101938b2af86a88db62508d825bd545e261073c4 /src/occ_gpe1 | |
parent | 5f3814b53d0262bf5be162b89f7aaca3b014dcec (diff) | |
download | talos-occ-3efbd9ee6aa3547e856c72f37f7e734000c89b56.tar.gz talos-occ-3efbd9ee6aa3547e856c72f37f7e734000c89b56.zip |
Infrastructure for 24x7 data collection
Change-Id: I16277d8290f65ba489da1421783f3705be7281f4
RTC: 168729
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36043
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Diffstat (limited to 'src/occ_gpe1')
-rw-r--r-- | src/occ_gpe1/gpe1_24x7.c | 113 | ||||
-rw-r--r-- | src/occ_gpe1/ipc_func_tables.c | 14 | ||||
-rw-r--r-- | src/occ_gpe1/topfiles.mk | 6 |
3 files changed, 125 insertions, 8 deletions
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) |