diff options
author | Stephan Broyles <sbroyles@us.ibm.com> | 2015-02-24 16:36:44 -0600 |
---|---|---|
committer | Stephan Broyles <sbroyles@us.ibm.com> | 2015-04-13 13:05:36 -0500 |
commit | 8fdf501b07d6eaf715539fae9977372b12673da8 (patch) | |
tree | 89d7b4b51dec8c2e21b081a636e082d008a081de /src/occ/state.c | |
parent | c473df288f702b1803205ac6eda4cc1781fec4f8 (diff) | |
download | talos-occ-8fdf501b07d6eaf715539fae9977372b12673da8.tar.gz talos-occ-8fdf501b07d6eaf715539fae9977372b12673da8.zip |
Adding firdata feature to OCC
Adding the fir data collection code to capture
FIR information to PNOR upon a runtime checkstop.
Change-Id: Ia7d6f9a234ca2c86783f7ac8f51407c15895358e
RTC: 115282
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15970
Reviewed-by: Stephan Broyles <sbroyles@us.ibm.com>
Tested-by: Stephan Broyles <sbroyles@us.ibm.com>
Diffstat (limited to 'src/occ/state.c')
-rwxr-xr-x | src/occ/state.c | 83 |
1 files changed, 45 insertions, 38 deletions
diff --git a/src/occ/state.c b/src/occ/state.c index 7288191..716c10c 100755 --- a/src/occ/state.c +++ b/src/occ/state.c @@ -5,10 +5,10 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2014 */ -/* [+] Google Inc. */ +/* Contributors Listed Below - COPYRIGHT 2011,2015 */ /* [+] International Business Machines Corp. */ /* */ +/* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ @@ -38,7 +38,7 @@ #include "proc_data.h" #include "heartbeat.h" #include "scom.h" - +#include <fir_data_collect.h> extern proc_gpsm_dcm_sync_occfw_t G_proc_dcm_sync_state; extern bool G_mem_monitoring_allowed; @@ -55,7 +55,6 @@ errlHndl_t SMGR_active_to_observation(); errlHndl_t SMGR_active_to_standby(); errlHndl_t SMGR_all_to_safe(); - // State that OCC is currently in OCC_STATE G_occ_internal_state = OCC_STATE_STANDBY; @@ -615,16 +614,15 @@ errlHndl_t SMGR_set_state(OCC_STATE i_new_state) * @userdata4 ERC_RUNNING_SEM_PENDING_FAILURE * @devdesc SSX semaphore related failure */ - l_transResult = createErrl(MAIN_STATE_TRANSITION_MID, //modId - SSX_GENERIC_FAILURE, //reasoncode - ERC_RUNNING_SEM_PENDING_FAILURE, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - NULL, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - 0, //userdata1 - 0); //userdata2 - - // @wb001 -- Callout firmware + l_transResult = createErrl(MAIN_STATE_TRANSITION_MID, //modId + SSX_GENERIC_FAILURE, //reasoncode + ERC_RUNNING_SEM_PENDING_FAILURE, //Extended reason code + ERRL_SEV_UNRECOVERABLE, //Severity + NULL, //Trace Buf + DEFAULT_TRACE_SIZE, //Trace Size + 0, //userdata1 + 0); //userdata2 + addCalloutToErrl(l_transResult, ERRL_CALLOUT_TYPE_COMPONENT_ID, ERRL_COMPONENT_ID_FIRMWARE, @@ -643,32 +641,34 @@ errlHndl_t SMGR_set_state(OCC_STATE i_new_state) // transition function that matches the transition we need to do. for(jj=0; jj<G_smgr_state_trans_count; jj++) { - if( ((G_smgr_state_trans[jj].old_state == G_occ_internal_state) - || (G_smgr_state_trans[jj].old_state == OCC_STATE_ALL) ) - && (G_smgr_state_trans[jj].new_state == i_new_state) ) - { - // We found the transtion that matches, now run the function - // that is associated with that state transition. - if(NULL != G_smgr_state_trans[jj].trans_func_ptr) - { - // Signal that we are now in a state transition - G_state_transition_occuring = TRUE; - // Run transition function - l_transResult = (G_smgr_state_trans[jj].trans_func_ptr)(); - // Signal that we are done with the transition - G_state_transition_occuring = FALSE; - break; - } - } + if(((G_smgr_state_trans[jj].old_state == G_occ_internal_state) + || + (G_smgr_state_trans[jj].old_state == OCC_STATE_ALL)) + && + (G_smgr_state_trans[jj].new_state == i_new_state)) + { + // We found the transtion that matches, now run the function + // that is associated with that state transition. + if(NULL != G_smgr_state_trans[jj].trans_func_ptr) + { + // Signal that we are now in a state transition + G_state_transition_occuring = TRUE; + // Run transition function + l_transResult = (G_smgr_state_trans[jj].trans_func_ptr)(); + // Signal that we are done with the transition + G_state_transition_occuring = FALSE; + break; + } + } } // Check if we hit the end of the table without finding a valid // state transition. If we did, log an internal error. if(G_smgr_state_trans_count == jj) { - TRAC_ERR("No transition (or NULL) found for the state change\n"); - l_transResult = NULL; - break; + TRAC_ERR("No transition (or NULL) found for the state change"); + l_transResult = NULL; + break; } // If the state OCC requested from TMGT is the state we are now in, @@ -690,14 +690,15 @@ errlHndl_t SMGR_set_state(OCC_STATE i_new_state) // // Name: SMGR_validate_get_valid_states // -// Description: +// Description: Return a byte of status masks that correspond to the v10 poll +// response definition status byte. // // End Function Specification uint8_t SMGR_validate_get_valid_states(void) { - uint8_t l_valid_states = 0; - uint32_t l_datamask = DATA_get_present_cnfgdata(); - static BOOLEAN l_throttle_traced = FALSE; + uint8_t l_valid_states = 0; + uint32_t l_datamask = DATA_get_present_cnfgdata(); + static BOOLEAN l_throttle_traced = FALSE; // If we have everything we need to go to observation state if((l_datamask & SMGR_VALIDATE_DATA_OBSERVATION_MASK) == @@ -731,6 +732,12 @@ uint8_t SMGR_validate_get_valid_states(void) l_valid_states |= SMGR_MASK_MASTER_OCC; } + // Indicate if this OCC is the FIR master. + if (OCC_IS_FIR_MASTER()) + { + l_valid_states |= OCC_ROLE_FIR_MASTER_MASK; + } + return l_valid_states; } |