summaryrefslogtreecommitdiffstats
path: root/src/occ_405/errl
diff options
context:
space:
mode:
authormbroyles <mbroyles@us.ibm.com>2018-09-14 15:16:56 -0500
committerMartha Broyles <mbroyles@us.ibm.com>2018-09-20 09:06:56 -0500
commit8344884b54ca2f688f1c4d87f6aa48a48ff684be (patch)
tree13fd911566f33bc39acbc549c2fc5f3e35e992f3 /src/occ_405/errl
parentb1453b6ce600d6f9879d6ebb2c30c6691a169e39 (diff)
downloadtalos-occ-8344884b54ca2f688f1c4d87f6aa48a48ff684be.tar.gz
talos-occ-8344884b54ca2f688f1c4d87f6aa48a48ff684be.zip
Improved PGPE error handling part 1
Change-Id: I6847a3bb630ee7bc6069374202daa74742b0c461 RTC: 197062 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66163 Tested-by: Martha Broyles <mbroyles@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_405/errl')
-rwxr-xr-xsrc/occ_405/errl/errl.c158
-rwxr-xr-xsrc/occ_405/errl/errl.h26
2 files changed, 177 insertions, 7 deletions
diff --git a/src/occ_405/errl/errl.c b/src/occ_405/errl/errl.c
index cef5fa8..9f659d1 100755
--- a/src/occ_405/errl/errl.c
+++ b/src/occ_405/errl/errl.c
@@ -34,6 +34,8 @@
#include <ocb_firmware_registers.h>
#include <ocb_register_addresses.h>
#include <amec_sys.h>
+#include <pgpe_shared.h>
+#include <wof.h>
uint32_t G_occErrSlotBits = 0x000000000;
uint8_t G_occErrIdCounter= 0x00;
@@ -67,6 +69,7 @@ uint8_t G_error_history[ERR_HISTORY_SIZE] = {0};
extern uint8_t G_occ_interrupt_type;
extern bool G_fir_collection_required;
+extern amec_sys_t g_amec_sys;
// Function Specification
//
@@ -292,12 +295,12 @@ errlHndl_t createErrl(
uint64_t l_time = 0;
uint8_t l_id = 0;
uint8_t l_errSlot = getErrSlotNumAndErrId( i_sev, &l_id, &l_time);
- static uint8_t traceCount = 5;
+ static uint8_t L_traceCount = 5;
if ( l_errSlot != ERRL_INVALID_SLOT )
{
- TRAC_INFO("Creating error log in slot [%d]", l_errSlot);
+ TRAC_INFO("createErrl: Creating error log in slot [%d]", l_errSlot);
// get slot pointer
l_rc = G_occErrSlots[ l_errSlot ];
@@ -345,16 +348,111 @@ errlHndl_t createErrl(
}
else
{
- if( traceCount > 0 )
+ if( L_traceCount > 0 )
{
- TRAC_INFO("Error Logs are FULL - Slot [%d]", l_errSlot);
- traceCount--;
+ TRAC_INFO("createErrl: Error Logs are FULL - Slot [%d]", l_errSlot);
+ L_traceCount--;
}
}
return l_rc;
}
+// Function Specification
+//
+// Name: createPgpeErrl
+//
+// Description: Create an Error Log due to a PGPE failure
+//
+// End Function Specification
+errlHndl_t createPgpeErrl(const uint16_t i_modId,
+ const uint8_t i_reasonCode,
+ const uint16_t i_extReasonCode,
+ const ERRL_SEVERITY i_sev,
+ const uint32_t i_userData1,
+ const uint32_t i_userData2)
+{
+ errlHndl_t l_err = INVALID_ERR_HNDL;
+ uint64_t l_time = 0;
+ uint8_t l_id = 0;
+ uint8_t l_errSlot = getErrSlotNumAndErrId( i_sev, &l_id, &l_time);
+ static uint8_t L_traceCount = 5;
+
+
+ if ( l_errSlot != ERRL_INVALID_SLOT )
+ {
+ TRAC_INFO("createPgpeErrl: Creating error log in slot [%d]", l_errSlot);
+
+ // get slot pointer
+ l_err = G_occErrSlots[ l_errSlot ];
+
+ // save off default size
+ l_err->iv_userDetails.iv_entrySize = sizeof( ErrlEntry_t );
+
+ // add error history
+ addErrHistory( l_err );
+
+ // if this is a WOF error add WOF parameters to error log
+ // only add for FSP systems where there is support for larger error logs
+ if( (i_reasonCode == WOF_DISABLED_RC) &&
+ (G_occ_interrupt_type == FSP_SUPPORTED_OCC) )
+ {
+ addUsrDtlsToErrl( l_err,
+ (uint8_t*)&(g_amec_sys.wof),
+ sizeof(amec_wof_t),
+ ERRL_USR_DTL_STRUCT_VERSION_1,
+ ERRL_USR_DTL_WOF_DATA);
+ }
+
+ // add PGPE specific data
+ addPgpeDataToErrl( l_err );
+
+ // add trace last, it will only add upto size that is left
+ addTraceToErrl( NULL, DEFAULT_TRACE_SIZE, l_err );
+
+ // save off entry Id
+ l_err->iv_entryId = l_id;
+
+ //Save off version info
+ l_err->iv_version = ERRL_STRUCT_VERSION_1;
+
+ // save off time
+ l_err->iv_userDetails.iv_timeStamp = l_time;
+
+ // set severity
+ l_err->iv_severity = i_sev;
+
+ l_err->iv_extendedRC = i_extReasonCode;
+
+ // save off user detail section version
+ l_err->iv_userDetails.iv_version = ERRL_USR_DTL_STRUCT_VERSION_1;
+
+ // save off rest of input parameters
+ l_err->iv_userDetails.iv_modId = i_modId;
+ l_err->iv_reasonCode = i_reasonCode;
+ l_err->iv_userDetails.iv_userData1 = i_userData1;
+ l_err->iv_userDetails.iv_userData2 = i_userData2;
+
+ // set callout count to 0
+ l_err->iv_numCallouts = 0;
+
+ // save off occ fields
+ l_err->iv_userDetails.iv_fclipHistory = g_amec->proc[0].chip_f_reason_history;
+ l_err->iv_userDetails.iv_occId = G_pbax_id.chip_id;
+ l_err->iv_userDetails.iv_occRole = G_occ_role;
+ l_err->iv_userDetails.iv_operatingState = CURRENT_STATE();
+ }
+ else
+ {
+ if( L_traceCount > 0 )
+ {
+ TRAC_INFO("createPgpeErrl: Error Logs are FULL - Slot [%d]", l_errSlot);
+ L_traceCount--;
+ }
+ }
+
+ return l_err;
+}
// Function Specification
//
@@ -410,7 +508,7 @@ void addTraceToErrl(
//adjust user details entry size to available size (word align )
uint16_t l_availableSize = MAX_ERRL_ENTRY_SZ - (io_err->iv_userDetails.iv_entrySize + l_headerSz );
- l_usrDtlsEntry.iv_size = ( i_traceSz < l_availableSize ) ? i_traceSz : l_availableSize; // @jh001c
+ l_usrDtlsEntry.iv_size = ( i_traceSz < l_availableSize ) ? i_traceSz : l_availableSize;
//set type
l_usrDtlsEntry.iv_type = (uint8_t) ERRL_USR_DTL_TRACE_DATA;
@@ -583,6 +681,53 @@ void addErrHistory(errlHndl_t io_err)
} // end addErrHistory()
+// Function Specification
+//
+// Name: addPgpeDataToErrl
+//
+// Description: Add PGPE specific data to log
+// NOTE: checking for valid error log and size will be done when addUsrDtlsToErrl() is called
+// End Function Specification
+void addPgpeDataToErrl(errlHndl_t io_err)
+{
+ // Build buffer with the data from PM Hcode
+ // Add PGPE PK trace
+ uint8_t l_buffer[MAX_PGPE_DBUG_DATA] = {0};
+ uint32_t l_trace_sram_addr = in32(PGPE_DEBUG_PTRS_ADDR + PGPE_DEBUG_TRACE_ADDR_OFFSET);
+ // use non-cachable address
+ l_trace_sram_addr &= 0xF7FFFFFF;
+
+ // get the data length, we will clip to our allowed max size if needed
+ uint32_t l_data_length = in32(PGPE_DEBUG_PTRS_ADDR + PGPE_DEBUG_TRACE_SIZE_OFFSET);
+ if(l_data_length > MAX_PGPE_DBUG_DATA)
+ {
+ TRAC_INFO("addPgpeDataToErrl: clipping pgpe trace size from %d to %d",
+ l_data_length, MAX_PGPE_DBUG_DATA);
+ l_data_length = MAX_PGPE_DBUG_DATA;
+ }
+ // make sure address and length are non-zero
+ if(l_trace_sram_addr && l_data_length)
+ {
+ memcpy( (void *) &l_buffer[0],
+ (void *) l_trace_sram_addr,
+ (size_t) l_data_length );
+
+ // Add the data to the error log
+ addUsrDtlsToErrl( io_err,
+ (uint8_t*)l_buffer,
+ (uint16_t)l_data_length,
+ ERRL_USR_DTL_STRUCT_VERSION_1,
+ ERRL_USR_DTL_PGPE_PK_TRACE);
+
+ // set action bit to force this error to be sent to BMC so it is seen even if info
+ setErrlActions(io_err, ERRL_ACTIONS_FORCE_SEND);
+ }
+ else
+ {
+ TRAC_ERR("PGPE trace address[%d] or length[%d] is 0!", l_trace_sram_addr, l_data_length);
+ }
+
+} // end addPgpeDataToErrl()
// Function Specification
//
@@ -929,7 +1074,6 @@ void setErrlSevToInfo( errlHndl_t io_err )
// Description: Set Actions to an Error Log
//
// End Function Specification
-// @jh001a
void setErrlActions(errlHndl_t io_err, const uint8_t i_mask)
{
// check if handle is valid
diff --git a/src/occ_405/errl/errl.h b/src/occ_405/errl/errl.h
index 9a5b178..183b35d 100755
--- a/src/occ_405/errl/errl.h
+++ b/src/occ_405/errl/errl.h
@@ -56,6 +56,9 @@ static const uint32_t INVALID_ERR = 0xFFFFFFFF;
// USED to determine the number of all trace buffer types. Now have (INF/IMP/ERR)
#define NUM_OF_TRACE_TYPE 3
+// maximum size of PGPE debug data will be added for ERRL_USR_DTL_PGPE_PK_TRACE
+#define MAX_PGPE_DBUG_DATA 0x300
+
// These bits are used to acquire a slot number. When used with the global
// slot bit mask, we are able to get 7 slots for predictive/unrecoverable errors,
// 1 slot for informational logs, and 1 slot for call home data log
@@ -69,6 +72,15 @@ typedef enum
ERRL_SLOT_MASK_CALL_HOME_DATA = 0xFF7FFFFF,
} ERRL_SLOT_MASK;
+// These are the possible sources that an error log can be coming from
+typedef enum
+{
+ ERRL_SOURCE_405 = 0x00,
+ ERRL_SOURCE_PGPE = 0x10,
+ ERRL_SOURCE_XGPE = 0x20,
+ ERRL_SOURCE_INVALID = 0xFF,
+} ERRL_SOURCE;
+
// These are the possible severities that an error log can have.
// Users must ONLY use these enum values for severity.
/* Error Severity */
@@ -87,6 +99,7 @@ typedef enum
{
ERRL_ACTIONS_CONSOLIDATE_ERRORS = 0x01, //ignored by tmgt at this time
ERRL_ACTIONS_MANUFACTURING_ERROR = 0x08, //tmgt will set severity to predictive while in mfg mode
+ ERRL_ACTIONS_FORCE_SEND = 0x10, //htmgt will force error to be sent to BMC (for info errors to be seen)
ERRL_ACTIONS_WOF_RESET_REQUIRED = 0x20, //Soft reset without incrementing permanent safe mode count
ERRL_ACTIONS_SAFE_MODE_REQUIRED = 0x40, //immediate permanent safe mode without any recovery (checkstop)
ERRL_ACTIONS_RESET_REQUIRED = 0x80, //permanent safe mode after 3 recovery attempts
@@ -113,6 +126,7 @@ typedef enum
ERRL_USR_DTL_BINARY_DATA = 0x03,
ERRL_USR_DTL_HISTORY_DATA = 0x04,
ERRL_USR_DTL_WOF_DATA = 0x05,
+ ERRL_USR_DTL_PGPE_PK_TRACE = 0x06,
} ERRL_USR_DETAIL_TYPE;
// These are the possible OCC States.
@@ -351,6 +365,15 @@ errlHndl_t createErrl(
const uint32_t i_userData2
);
+/* Create an Error Log due to a PGPE failure */
+errlHndl_t createPgpeErrl(
+ const uint16_t i_modId,
+ const uint8_t i_reasonCode,
+ const uint16_t i_extReasonCode,
+ const ERRL_SEVERITY i_sev,
+ const uint32_t i_userData1,
+ const uint32_t i_userData2
+ );
/* Add Trace Data to Error Log */
void addTraceToErrl(
@@ -362,6 +385,9 @@ void addTraceToErrl(
// Add Error history data to the Error Log
void addErrHistory(errlHndl_t io_err);
+// Add PGPE specific data to the Error Log
+void addPgpeDataToErrl(errlHndl_t io_err);
+
/* Commit the Error Log */
void commitErrl( errlHndl_t * io_err );
OpenPOWER on IntegriCloud