From 5e53fc1458f1e9761a118bf0de06a26f192a0d58 Mon Sep 17 00:00:00 2001 From: mbroyles Date: Mon, 20 May 2019 15:37:17 -0500 Subject: Increase PGPE elog size to include full PGPE trace Change-Id: I160a7ec8a71c12013fd47be9e426f2e02e41737f Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77653 Tested-by: FSP CI Jenkins Reviewed-by: Christopher J. Cain Reviewed-by: Martha Broyles --- src/occ_405/cmdh/cmdh_dbug_cmd.c | 23 ++ src/occ_405/cmdh/cmdh_dbug_cmd.h | 4 +- src/occ_405/errl/errl.c | 167 +++++---- src/occ_405/errl/errl.h | 47 +-- src/occ_405/errl/test/Makefile | 60 ---- src/occ_405/errl/test/app.mk | 105 ------ src/occ_405/errl/test/errltest.c | 717 -------------------------------------- src/occ_405/errl/test/gpefiles.mk | 29 -- src/occ_405/errl/test/parser.c | 268 -------------- src/occ_405/errl/test/test.mk | 33 -- src/occ_405/occbuildname.c | 2 +- 11 files changed, 153 insertions(+), 1302 deletions(-) delete mode 100755 src/occ_405/errl/test/Makefile delete mode 100755 src/occ_405/errl/test/app.mk delete mode 100755 src/occ_405/errl/test/errltest.c delete mode 100755 src/occ_405/errl/test/gpefiles.mk delete mode 100755 src/occ_405/errl/test/parser.c delete mode 100755 src/occ_405/errl/test/test.mk (limited to 'src/occ_405') diff --git a/src/occ_405/cmdh/cmdh_dbug_cmd.c b/src/occ_405/cmdh/cmdh_dbug_cmd.c index 1b752d1..d613c18 100755 --- a/src/occ_405/cmdh/cmdh_dbug_cmd.c +++ b/src/occ_405/cmdh/cmdh_dbug_cmd.c @@ -1157,6 +1157,8 @@ void dbug_proc_data_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { + errlHndl_t l_err = NULL; + // Sub Command for debug is always first byte of data uint8_t l_sub_cmd = i_cmd_ptr->data[0]; @@ -1221,6 +1223,27 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, dbug_apss_dump(i_cmd_ptr, o_rsp_ptr); break; + case DBUG_INJECT_PGPE_ERRL: + TRAC_ERR("cmdh_dbug_cmd: Creating PGPE Error Log"); + l_err = createPgpeErrl(CMDH_DBUG_MID, //modId + PGPE_FAILURE, //reasoncode + OCC_NO_EXTENDED_RC, //Extended reason code + ERRL_SEV_UNRECOVERABLE, //Severity + 0xff, //userdata1 + 0xff); //userdata2 + + if (INVALID_ERR_HNDL == l_err) + { + TRAC_ERR("cmdh_dbug_cmd: Failed to create PGPE Error Log"); + G_rsp_status = ERRL_RC_INTERNAL_FAIL; + } + else + { + // Commit Error log + commitErrl(&l_err); + } + break; + case DBUG_INJECT_ERRL: dbug_err_inject(i_cmd_ptr, o_rsp_ptr); break; diff --git a/src/occ_405/cmdh/cmdh_dbug_cmd.h b/src/occ_405/cmdh/cmdh_dbug_cmd.h index 2baea27..16ab04b 100755 --- a/src/occ_405/cmdh/cmdh_dbug_cmd.h +++ b/src/occ_405/cmdh/cmdh_dbug_cmd.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -72,7 +72,7 @@ typedef enum // free = 0x10, // free = 0x11, DBUG_TRIGGER_EPOW = 0x12, -// free = 0x13 + DBUG_INJECT_PGPE_ERRL = 0x13, DBUG_INJECT_ERRL = 0x14, DBUG_DIMM_INJECT = 0x15, // free = 0x16 diff --git a/src/occ_405/errl/errl.c b/src/occ_405/errl/errl.c index 0c705c5..8b7cbac 100755 --- a/src/occ_405/errl/errl.c +++ b/src/occ_405/errl/errl.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,8 +45,8 @@ uint8_t G_errslot2[MAX_ERRL_ENTRY_SZ] = {0}; uint8_t G_errslot3[MAX_ERRL_ENTRY_SZ] = {0}; uint8_t G_errslot4[MAX_ERRL_ENTRY_SZ] = {0}; uint8_t G_errslot5[MAX_ERRL_ENTRY_SZ] = {0}; -uint8_t G_errslot6[MAX_ERRL_ENTRY_SZ] = {0}; -uint8_t G_errslot7[MAX_ERRL_ENTRY_SZ] = {0}; + +uint8_t G_pgpeslot[MAX_ERRL_PGPE_ENTRY_SZ] = {0}; uint8_t G_infoslot[MAX_ERRL_ENTRY_SZ] = {0}; @@ -58,8 +58,7 @@ errlHndl_t G_occErrSlots[ERRL_MAX_SLOTS] = { (errlHndl_t) G_errslot3, (errlHndl_t) G_errslot4, (errlHndl_t) G_errslot5, - (errlHndl_t) G_errslot6, - (errlHndl_t) G_errslot7, + (errlHndl_t) G_pgpeslot, (errlHndl_t) G_infoslot, (errlHndl_t) G_callslot }; @@ -84,11 +83,14 @@ extern amec_sys_t g_amec_sys; uint8_t getErrSlotNumAndErrId( ERRL_SEVERITY i_severity, uint8_t *o_errlId, - uint64_t *o_timeStamp + uint64_t *o_timeStamp, + uint16_t *o_maxSize ) { uint8_t l_rc = ERRL_INVALID_SLOT; uint32_t l_mask = ERRL_SLOT_MASK_DEFAULT; + uint16_t l_maxSize = 0; + bool l_retry_find_slot = FALSE; //Use severity to determine what slots are available for the given //type of errorlog severity. @@ -96,55 +98,76 @@ uint8_t getErrSlotNumAndErrId( { case ERRL_SEV_INFORMATIONAL: l_mask = ERRL_SLOT_MASK_INFORMATIONAL; + l_maxSize = MAX_ERRL_ENTRY_SZ; break; case ERRL_SEV_PREDICTIVE: - l_mask = ERRL_SLOT_MASK_PREDICTIVE; - break; case ERRL_SEV_UNRECOVERABLE: - l_mask = ERRL_SLOT_MASK_UNRECOVERABLE; + l_mask = ERRL_SLOT_MASK_OCC_ERROR; + l_maxSize = MAX_ERRL_ENTRY_SZ; + break; + case ERRL_SEV_PGPE_ERROR: + l_mask = ERRL_SLOT_MASK_PGPE_ERROR; + l_maxSize = MAX_ERRL_PGPE_ENTRY_SZ; break; case ERRL_SEV_CALLHOME_DATA: l_mask = ERRL_SLOT_MASK_CALL_HOME_DATA; + l_maxSize = MAX_ERRL_CALL_HOME_SZ; break; }; - - // we have a valid mask - if ( l_mask != ERRL_SLOT_MASK_DEFAULT ) + do { - // 1. Find an available slot - // l_slotBitWord represents the available slots given the severity type. - uint8_t l_slot = ERRL_INVALID_SLOT; - uint32_t l_slotBitWord = ~(G_occErrSlotBits | l_mask); - SsxMachineContext l_ctx; - - // 2. use assembly cntlzw (count leading zeros) to get available slot based on - // severity type, and (disable/enable interrupts) - ssx_critical_section_enter(SSX_NONCRITICAL, &l_ctx); - __asm__ __volatile__ ( "cntlzw %0, %1;" : "=r" (l_slot) : "r" (l_slotBitWord)); - ssx_critical_section_exit(&l_ctx); - - // A slot is available and valid - if ( l_slot < ERRL_MAX_SLOTS ) - { - ssx_critical_section_enter(SSX_NONCRITICAL, &l_ctx); - // 3. Get time stamp & save off timestamp - // Internal caller so assuming valid pointer - *o_timeStamp = ssx_timebase_get(); - // save of counter and then increment it - // Note: Internal caller so assuming valid pointer - - //Provide next ErrorId; G_occErrIdCounter should never be 0. - *o_errlId = ((++G_occErrIdCounter) == 0) ? ++G_occErrIdCounter : G_occErrIdCounter; - - //Set slot bit in list of used up slots. - G_occErrSlotBits |= (ERRL_SLOT_SHIFT >> l_slot); - ssx_critical_section_exit(&l_ctx); - - l_rc = l_slot; - - } - } + l_retry_find_slot = FALSE; + // we have a valid mask + if ( l_mask != ERRL_SLOT_MASK_DEFAULT ) + { + // 1. Find an available slot + // l_slotBitWord represents the available slots given the severity type. + uint8_t l_slot = ERRL_INVALID_SLOT; + uint32_t l_slotBitWord = ~(G_occErrSlotBits | l_mask); + SsxMachineContext l_ctx; + + // 2. use assembly cntlzw (count leading zeros) to get available slot based on + // severity type, and (disable/enable interrupts) + ssx_critical_section_enter(SSX_NONCRITICAL, &l_ctx); + __asm__ __volatile__ ( "cntlzw %0, %1;" : "=r" (l_slot) : "r" (l_slotBitWord)); + ssx_critical_section_exit(&l_ctx); + + // A slot is available and valid + if ( l_slot < ERRL_MAX_SLOTS ) + { + ssx_critical_section_enter(SSX_NONCRITICAL, &l_ctx); + // 3. Get time stamp & save off timestamp + // Internal caller so assuming valid pointer + *o_timeStamp = ssx_timebase_get(); + // save of counter and then increment it + // Note: Internal caller so assuming valid pointer + + //Provide next ErrorId; G_occErrIdCounter should never be 0. + *o_errlId = ((++G_occErrIdCounter) == 0) ? ++G_occErrIdCounter : G_occErrIdCounter; + + //Set slot bit in list of used up slots. + G_occErrSlotBits |= (ERRL_SLOT_SHIFT >> l_slot); + ssx_critical_section_exit(&l_ctx); + + // return the maximum size + *o_maxSize = l_maxSize; + + l_rc = l_slot; + } + else if(l_mask == ERRL_SLOT_MASK_PGPE_ERROR) + { + // only 1 slot for PGPE error, use an OCC error slot if available + // this just means less trace data will be in the log but at least + // the error is logged + l_mask = ERRL_SLOT_MASK_OCC_ERROR; + l_maxSize = MAX_ERRL_ENTRY_SZ; + + l_retry_find_slot = TRUE; + } + } // if valid mask + + }while(l_retry_find_slot); // return slot return l_rc; @@ -296,18 +319,22 @@ errlHndl_t createErrl( { errlHndl_t l_rc = INVALID_ERR_HNDL; uint64_t l_time = 0; + uint16_t l_maxSize = 0; uint8_t l_id = 0; - uint8_t l_errSlot = getErrSlotNumAndErrId( i_sev, &l_id, &l_time); + uint8_t l_errSlot = getErrSlotNumAndErrId( i_sev, &l_id, &l_time, &l_maxSize); static uint8_t L_traceCount = 5; if ( l_errSlot != ERRL_INVALID_SLOT ) { - TRAC_INFO("createErrl: Creating error log in slot [%d]", l_errSlot); + TRAC_INFO("createErrl: Creating error log in slot[%d] max size[%d]", l_errSlot, l_maxSize); // get slot pointer l_rc = G_occErrSlots[ l_errSlot ]; + // save off maximum error log size + l_rc->iv_maxSize = l_maxSize; + // save off default size l_rc->iv_userDetails.iv_entrySize = sizeof( ErrlEntry_t ); @@ -377,14 +404,15 @@ errlHndl_t createPgpeErrl(const uint16_t i_modId, { errlHndl_t l_err = INVALID_ERR_HNDL; uint64_t l_time = 0; + uint16_t l_maxSize = 0; uint8_t l_id = 0; - uint8_t l_errSlot = getErrSlotNumAndErrId( i_sev, &l_id, &l_time); + uint8_t l_errSlot = getErrSlotNumAndErrId(ERRL_SEV_PGPE_ERROR, &l_id, &l_time, &l_maxSize); static uint8_t L_traceCount = 5; if ( l_errSlot != ERRL_INVALID_SLOT ) { - TRAC_INFO("createPgpeErrl: Creating error log in slot [%d]", l_errSlot); + TRAC_INFO("createPgpeErrl: Creating error log in slot[%d] max size[%d]", l_errSlot, l_maxSize); // Trace a few regs for PGPE debug uint32_t l_oisr0_status; // OCC Interrupt Source 0 Register @@ -399,6 +427,9 @@ errlHndl_t createPgpeErrl(const uint16_t i_modId, // get slot pointer l_err = G_occErrSlots[ l_errSlot ]; + // save off maximum error log size + l_err->iv_maxSize = l_maxSize; + // save off default size l_err->iv_userDetails.iv_entrySize = sizeof( ErrlEntry_t ); @@ -509,7 +540,7 @@ void addTraceToErrl( (io_err != INVALID_ERR_HNDL) && (io_err->iv_userDetails.iv_committed == 0) && (i_traceSz != 0) && - ((io_err->iv_userDetails.iv_entrySize + sizeof(ErrlUserDetailsEntry_t)) < MAX_ERRL_ENTRY_SZ ) && + ((io_err->iv_userDetails.iv_entrySize + sizeof(ErrlUserDetailsEntry_t)) < io_err->iv_maxSize) && ((i_trace==&g_des_array[INF_TRACE_DESCRIPTOR]) || (i_trace==&g_des_array[ERR_TRACE_DESCRIPTOR]) || (i_trace==&g_des_array[IMP_TRACE_DESCRIPTOR]) || @@ -520,7 +551,7 @@ void addTraceToErrl( uint16_t l_headerSz = sizeof( l_usrDtlsEntry ); //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 ); + uint16_t l_availableSize = io_err->iv_maxSize - (io_err->iv_userDetails.iv_entrySize + l_headerSz ); l_usrDtlsEntry.iv_size = ( i_traceSz < l_availableSize ) ? i_traceSz : l_availableSize; //set type @@ -655,7 +686,7 @@ void addErrHistory(errlHndl_t io_err) if( (io_err != NULL) && (io_err != INVALID_ERR_HNDL) && (io_err->iv_userDetails.iv_committed == 0) && - ((io_err->iv_userDetails.iv_entrySize + sizeof(ErrlUserDetailsEntry_t) + sizeof(G_error_history)) < MAX_ERRL_ENTRY_SZ ) ) + ((io_err->iv_userDetails.iv_entrySize + sizeof(ErrlUserDetailsEntry_t) + sizeof(G_error_history)) < io_err->iv_maxSize ) ) { void * l_errPtr = io_err; ErrlUserDetailsEntry_t l_usrDtlsEntry; @@ -703,31 +734,38 @@ void addErrHistory(errlHndl_t io_err) // 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) + + // if the PGPE error slot wasn't available reduce PGPE trace so we get some OCC trace + if(io_err->iv_maxSize != MAX_ERRL_PGPE_ENTRY_SZ) + { + TRAC_INFO("addPgpeDataToErrl: PGPE error slot not available clipping pgpe trace size from %d to %d", + l_data_length, MAX_PGPE_DBUG_DATA_NO_SLOT); + l_data_length = MAX_PGPE_DBUG_DATA_NO_SLOT; + } + else 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; } + else + { + TRAC_INFO("addPgpeDataToErrl: adding full pgpe trace size %d", l_data_length); + } + // 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, + (uint8_t*)l_trace_sram_addr, (uint16_t)l_data_length, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_PGPE_PK_TRACE); @@ -859,7 +897,7 @@ void commitErrl( errlHndl_t *io_err ) (*io_err)->iv_checkSum = l_sum; // Flush error log out to SRAM since the FSP will directly read it - dcache_flush( *io_err, MAX_ERRL_ENTRY_SZ ); + dcache_flush( *io_err, (*io_err)->iv_maxSize ); // report error to FSP reportErrorLog( *io_err, l_size ); @@ -1003,9 +1041,6 @@ void addUsrDtlsToErrl( const uint8_t i_version, const ERRL_USR_DETAIL_TYPE i_type) { - // Locals - uint16_t l_maxSize = (i_type == ERRL_USR_DTL_CALLHOME_DATA) ? MAX_ERRL_CALL_HOME_SZ : MAX_ERRL_ENTRY_SZ; - // 1. check if handle is valid // 2. NOT empty // 3. not committed @@ -1017,14 +1052,14 @@ void addUsrDtlsToErrl( (io_err->iv_userDetails.iv_committed == 0) && (i_size != 0) && (i_dataPtr != NULL) && - ((io_err->iv_userDetails.iv_entrySize) < l_maxSize)) + ((io_err->iv_userDetails.iv_entrySize) < io_err->iv_maxSize)) { //local copy of the usr details entry ErrlUserDetailsEntry_t l_usrDtlsEntry; uint16_t l_headerSz = sizeof( l_usrDtlsEntry ); //adjust user details entry size to available size (word align ) - uint16_t l_availableSize = l_maxSize - (io_err->iv_userDetails.iv_entrySize + l_headerSz ); + uint16_t l_availableSize = io_err->iv_maxSize - (io_err->iv_userDetails.iv_entrySize + l_headerSz ); l_usrDtlsEntry.iv_size = ( i_size < l_availableSize ) ? i_size : l_availableSize; //set type diff --git a/src/occ_405/errl/errl.h b/src/occ_405/errl/errl.h index 5a8774c..e57dc0d 100755 --- a/src/occ_405/errl/errl.h +++ b/src/occ_405/errl/errl.h @@ -39,17 +39,20 @@ static const uint32_t ERRL_SLOT_SHIFT = 0x80000000; // Used for defaulting handle to invalid static const uint32_t INVALID_ERR = 0xFFFFFFFF; -// Max size of non call home data logs (2048 bytes) -#define MAX_ERRL_ENTRY_SZ 0x800 +// Max size of non call home data logs (2128 bytes) +#define MAX_ERRL_ENTRY_SZ 0x850 // Max size of call home data log (3072 bytes) #define MAX_ERRL_CALL_HOME_SZ 0xC00 -// Max size of callouts +// Max size of an OCC detected PGPE error log (3616 bytes) +#define MAX_ERRL_PGPE_ENTRY_SZ 0xE20 + +// Max number of callouts #define ERRL_MAX_CALLOUTS 6 // Max number of error logs -#define ERRL_MAX_SLOTS 9 +#define ERRL_MAX_SLOTS 8 // Used to default a old/bad error handle #define INVALID_ERR_HNDL (errlHndl_t)INVALID_ERR @@ -57,20 +60,23 @@ 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 +// maximum size of PGPE debug data will be added for ERRL_USR_DTL_PGPE_PK_TRACE when PGPE error slot available +#define MAX_PGPE_DBUG_DATA 0x860 +// maximum size of PGPE debug data will be added for ERRL_USR_DTL_PGPE_PK_TRACE when PGPE error slot not available +#define MAX_PGPE_DBUG_DATA_NO_SLOT 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 +// slot bit mask, we are able to get 5 slots for predictive/unrecoverable errors, +// 1 slot for an OCC detected PGPE error, 1 slot for informational logs, +// and 1 slot for call home data log /* Slot Masks */ typedef enum { ERRL_SLOT_MASK_DEFAULT = 0xFFFFFFFF, - ERRL_SLOT_MASK_INFORMATIONAL = 0xFEFFFFFF, - ERRL_SLOT_MASK_PREDICTIVE = 0x01FFFFFF, - ERRL_SLOT_MASK_UNRECOVERABLE = 0x01FFFFFF, - ERRL_SLOT_MASK_CALL_HOME_DATA = 0xFF7FFFFF, + ERRL_SLOT_MASK_INFORMATIONAL = 0xFDFFFFFF, + ERRL_SLOT_MASK_OCC_ERROR = 0x07FFFFFF, + ERRL_SLOT_MASK_CALL_HOME_DATA = 0xFEFFFFFF, + ERRL_SLOT_MASK_PGPE_ERROR = 0xFBFFFFFF, } ERRL_SLOT_MASK; // These are the possible sources that an error log can be coming from @@ -87,10 +93,11 @@ typedef enum /* Error Severity */ typedef enum { - ERRL_SEV_INFORMATIONAL = 0x00, - ERRL_SEV_PREDICTIVE = 0x01, - ERRL_SEV_UNRECOVERABLE = 0x02, - ERRL_SEV_CALLHOME_DATA = 0x03, + ERRL_SEV_INFORMATIONAL = 0x00, // Used by TMGT + ERRL_SEV_PREDICTIVE = 0x01, // Used by TMGT + ERRL_SEV_UNRECOVERABLE = 0x02, // Used by TMGT + ERRL_SEV_CALLHOME_DATA = 0x03, // internal OCC use. Not used by TMGT + ERRL_SEV_PGPE_ERROR = 0x04, // internal OCC use. Not used by TMGT } ERRL_SEVERITY; // These are the possible actions that an error log can have. @@ -263,8 +270,8 @@ struct ErrlEntry }; uint8_t word; } iv_actions; - // Reserved for extended reason code for uniquely identifying error if needed - uint16_t iv_reserved; + // Maximum size for the whole error log including all user details + uint16_t iv_maxSize; uint16_t iv_extendedRC; // Log Callout Number uint8_t iv_numCallouts; @@ -356,8 +363,7 @@ extern uint8_t G_errslot2[MAX_ERRL_ENTRY_SZ]; extern uint8_t G_errslot3[MAX_ERRL_ENTRY_SZ]; extern uint8_t G_errslot4[MAX_ERRL_ENTRY_SZ]; extern uint8_t G_errslot5[MAX_ERRL_ENTRY_SZ]; -extern uint8_t G_errslot6[MAX_ERRL_ENTRY_SZ]; -extern uint8_t G_errslot7[MAX_ERRL_ENTRY_SZ]; +extern uint8_t G_pgpeslot[MAX_ERRL_PGPE_ENTRY_SZ]; extern uint8_t G_infoslot[MAX_ERRL_ENTRY_SZ]; extern uint8_t G_callslot[MAX_ERRL_CALL_HOME_SZ]; @@ -403,7 +409,6 @@ void commitErrl( errlHndl_t * io_err ); errlHndl_t deleteErrl( errlHndl_t * io_err); /* Add Callout to Error Log */ -// @jh001c void addCalloutToErrl( errlHndl_t io_err, const ERRL_CALLOUT_TYPE i_type, diff --git a/src/occ_405/errl/test/Makefile b/src/occ_405/errl/test/Makefile deleted file mode 100755 index 77393f1..0000000 --- a/src/occ_405/errl/test/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occ_405/errl/test/Makefile $ -# -# OpenPOWER OnChipController Project -# -# 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 -# -# 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 test.mk - -APP = errltest -APP_INCLUDES += -I../../../ssx -APP_INCLUDES += -I../../../lib -APP_INCLUDES += -I../../incl -APP_INCLUDES += -I../../trac -APP_INCLUDES += -I../../async -APP_INCLUDES += -I../../errl -APP_INCLUDES += -I../../gpe -APP_INCLUDES += -I../../thread -APP_INCLUDES += -I. - - - - -#D = -DVERIFICATION=1 \ - -DSSX_STACK_CHECK=0 \ - -DINITIALIZE_PMC=0 \ - -DINITIALIZE_SIMICS_IO=0 \ - -DINITIALIZE_RTX_IO=1 \ - -DINITIALIZE_PBA=1 \ - -DSIMICS_MAGIC_PANIC=1 \ - -DSSX_KERNEL_TRACE_ENABLE=1 - - -SOURCES = ${all_cfiles} -MODE = validation - -PGP_ASYNC_SUPPORT = 1 - -include ./app.mk - -pgas: - $(CC) $(CFLAGS) -c -Wa,-al -Wa,--listing-cont-lines='10' diff --git a/src/occ_405/errl/test/app.mk b/src/occ_405/errl/test/app.mk deleted file mode 100755 index 720b5c8..0000000 --- a/src/occ_405/errl/test/app.mk +++ /dev/null @@ -1,105 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occ_405/errl/test/app.mk $ -# -# OpenPOWER OnChipController Project -# -# 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 -# -# 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 - - -# Description: mk occ application -# -# This Makefile is included-ed into application Makefiles and -# encapsulates the steps necessary to create application images. -# -# The application Makefile (user) must define the following variables: -# -# APP - The name of the application -# SOURCES - The list of local source files that implement the -# application. -# -# The application Makefile (user) may optionally define the following -# variables: -# -# D - The value of $(D) is appended to DEFS defined by ssx.mk -# -# MODE - The following modes are recognized: -# -# validation - (Default) An application that requires all SSX -# services. -# -# firmware - An interrupt only configuration. -# -# The make process creates the following files: -# -# $(APP).out - The PowerPC-ELF version of the application -# $(APP).bin - A binary SRAM image of the application -# $(APP).map - The linker map of the application - -OCC = ../../ -SSX = ../../../ssx -LIB = ../../../lib -PGP = $(SSX)/pgp - -ifeq "$(MODE)" "firmware" -SSX_TIMER_SUPPORT = 0 -SSX_THREAD_SUPPORT = 0 -endif - -export SSX_TIMER_SUPPORT -export SSX_THREAD_SUPPORT -export PPC405_MMU_SUPPORT -export PGP_ASYNC_SUPPORT - -INCLUDES = -I $(OCC) -I$(LIB) - -include $(PGP)/ssx.mk - -C-OBJECTS = $(SOURCES:.c=.o) -OBJECTS = $(C-OBJECTS:.S=.o) - -LDFLAGS = -L $(SSX)/ssx -L $(SSX)/ppc32 -L $(SSX)/ppc405 -L $(SSX)/pgp \ - -L $(OCC) -L $(LIB) -lssx -lppc32 - -DEFS += $(D) - -all: $(OBJECTS) libssx.a - $(MAKE) -C $(PGP) DEFS="$(DEFS)" -e - $(CPP) -P $(DEFS) < $(OCC)/linkocc.cmd > linkscript - $(LD) $(OBJECTS) \ - -Tlinkscript $(LDFLAGS) -Map $(APP).map -Bstatic -o $(APP).out - $(OBJCOPY) -O binary $(APP).out $(APP).bin - $(OBJDUMP) -d $(APP).out > $(APP).dis - -libssx.a: - $(MAKE) -C $(LIB) DEFS="$(DEFS)" -e - - -.PHONY : clean -clean: - rm -f *.o *.d *.d.* *.out *.bin *.srec *.dis *.map linkscript - rm -f ./*/*.o ./*/*.d ./*/*.d.* - -.PHONY : clean_all -clean_all: - $(MAKE) clean - $(MAKE) -C $(PGP) clean - --include $(OBJECTS:.o=.d) diff --git a/src/occ_405/errl/test/errltest.c b/src/occ_405/errl/test/errltest.c deleted file mode 100755 index 9a35ae0..0000000 --- a/src/occ_405/errl/test/errltest.c +++ /dev/null @@ -1,717 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occ_405/errl/test/errltest.c $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,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 "ssx.h" -#include "ssx_io.h" -#include "simics_stdio.h" -#include -#include -#include -#include - -uint8_t noncritical_stack[NONCRITICAL_STACK_SIZE]; -uint8_t critical_stack[CRITICAL_STACK_SIZE]; - -/// Period in which to run #timer_routine -#define TIMER_INTERVAL (SsxInterval) SSX_MICROSECONDS(100) - -#define SevAsciiValue( _v_ ) \ - ( ( _v_ == ERRL_SEV_INFORMATIONAL ) ? "Informational" : \ - ( _v_ == ERRL_SEV_PREDICTIVE ) ? "Predictive" : \ - ( _v_ == ERRL_SEV_UNRECOVERABLE ) ? "Unrecovrable" : \ - ( _v_ == ERRL_SEV_CALLHOME_DATA ) ? "Call Home" : \ - "Unknown" ) - -/*----------------------------------------------------------------------------*/ -/* SsxTimer and SsxThread Declarations and Priorities */ -/*----------------------------------------------------------------------------*/ - -/// Our timer based on TIMER_INTERVAL that kicks off most of the work. See #timer_routine -SsxTimer timer; - -/// Our idle thread. See #main_thread_routine -SsxThread main_thread; - -SsxThread prcd_thread; - -/*----------------------------------------------------------------------------*/ -/* SsxSemaphore Declarations */ -/*----------------------------------------------------------------------------*/ -SsxSemaphore prcd_sem; - -int g_j = 0; -int g_k = 0; - -SimicsStdio simics_stdout; -SimicsStdio simics_stderr; - -extern void timer_routine(void *private); -extern void rtloop_ocb_init(void); - -// Function Specification -// -// Name: pgp_validation_ssx_main_hook -// -// Description: -// -// End Function Specification -void pgp_validation_ssx_main_hook(void) -{ - -} - -// Function Specification -// -// Name: Cmd_Hndl_thread_routine -// -// Description: -// -// End Function Specification -void Cmd_Hndl_thread_routine(void *arg) -{ -} - -// Function Specification -// -// Name: App_thread_routine -// -// Description: -// -// End Function Specification -void App_thread_routine(void *arg) -{ -} - -// Function Specification -// -// Name: Thermal_Monitor_thread_routine -// -// Description: -// -// End Function Specification -void Thermal_Monitor_thread_routine(void *arg) -{ -} - -// Function Specification -// -// Name: Hlth_Monitor_thread_routine -// -// Description: -// -// End Function Specification -void Hlth_Monitor_thread_routine(void *arg) -{ -} - -// Function Specification -// -// Name: FFDC_thread_routine -// -// Description: -// -// End Function Specification -void FFDC_thread_routine(void *arg) -{ -} - - -// Function Specification -// -// Name: prcd_thread_routine -// -// Description: This thread loops as the highest priority thread, where it currently just -// -// End Function Specification -void prcd_thread_routine(void *private) -{ - while(1) - { - // Just sit here until this semaphore is posted, which will never happen. - ssx_semaphore_pend(&prcd_sem, SSX_WAIT_FOREVER); - - // Only trace the first XX times that this function loops - if(g_j < 20) - { - g_k = 0; - g_j++; - - } - } -} - -// Function Specification -// -// Name: dumpLog -// -// Description: -// -// End Function Specification -void dumpLog( errlHndl_t i_log, uint32_t i_len ) -{ - uint32_t l_written = 0; - uint32_t l_counter = 0; - uint8_t * l_data = (uint8_t*) i_log; - - printf("----------%p---------- \n", i_log ); - - if ( i_log == NULL ) - return; - - while ( l_counter < i_len) - { - printf("| %08X ", (uint32_t) l_data + l_counter); - - // Display 16 bytes in Hex with 2 spaces in between - l_written = 0; - uint8_t i = 0; - for ( i = 0; i < 16 && l_counter < i_len; i++ ) - { - l_written += printf("%02X",l_data[l_counter++]); - - if ( ! ( l_counter % 4 ) ) - { - l_written += printf(" "); - } - } - - // Pad with spaces - uint8_t l_space[64] = {0}; - memset( l_space, 0x00, sizeof( l_space )); - memset( l_space, ' ', 43-l_written); - printf("%s", l_space ); - - // Display ASCII - l_written = 0; - uint8_t l_char; - for ( ; i > 0 ; i-- ) - { - l_char = l_data[ l_counter-i ]; - - if ( isprint( l_char ) && - ( l_char != '&' ) && - ( l_char != '<' ) && - ( l_char != '>' ) - ) - { - l_written += printf("%c",l_char ); - } - else - { - l_written += printf("." ); - } - } - - // Pad with spaces - uint8_t l_space2[64] = {0}; - memset( l_space2, 0x00, sizeof( l_space2 )); - memset( l_space2, ' ', 19-l_written); - printf("%s\n", l_space2 ); - } - printf("----------%p---------- \n", i_log ); - -} - -// Function Specification -// -// Name: ppdumpslot -// -// Description: -// -// End Function Specification -void ppdumpslot(void) -{ - errlHndl_t l_array[ERRL_MAX_SLOTS] = { - (errlHndl_t)G_errslot1, - (errlHndl_t)G_errslot2, - (errlHndl_t)G_errslot3, - (errlHndl_t)G_errslot4, - (errlHndl_t)G_errslot5, - (errlHndl_t)G_errslot6, - (errlHndl_t)G_errslot7, - (errlHndl_t)G_infoslot, - (errlHndl_t)G_callslot, - }; - - - printf("-------- \n"); - - uint8_t l_index = 0; - for(l_index =0; l_index < ERRL_MAX_SLOTS; l_index++) - { - if(l_array[l_index]->iv_version !=0) - { - printf("slot[%01d] sz[%04d] id[%03d] @[%p] \n",l_index,l_array[l_index]->iv_userDetails.iv_entrySize, l_array[l_index]->iv_entryId, l_array[l_index]); - } - else - { - printf("slot[%01d] [0] \n",l_index); - } - } - printf("-------- \n"); -} - - -// Function Specification -// -// Name: testsizelimit -// -// Description: -// -// End Function Specification -void testsizelimit(const tracDesc_t i_trace) -{ - printf("%s: START \n", __FUNCTION__ ); - errlHndl_t l_handle = NULL; - errlHndl_t l_handle2 = NULL; - errlHndl_t l_handle3 = NULL; - - l_handle = createErrl( 0x1616, 0x08, ERRL_SEV_PREDICTIVE, i_trace, 512, 0x1, 0x2); - l_handle2 = createErrl( 0x1616, 0x08, ERRL_SEV_CALLHOME_DATA, i_trace, 512, 0x1, 0x2); - l_handle3 = createErrl( 0x1616, 0x08, ERRL_SEV_INFORMATIONAL, i_trace, 512, 0x1, 0x2); - errlHndl_t l_handleX = l_handle; - errlHndl_t l_handle2X = l_handle2; - errlHndl_t l_handle3X = l_handle3; - printf("%s: Slots after Create - 3 slots should be used (one of each)\n", __FUNCTION__ ); - ppdumpslot(); - - uint8_t l_data[ MAX_ERRL_CALL_HOME_SZ * 2 ]; - - memset( l_data, 0xCC, sizeof( l_data ) ); - - addUsrDtlsToErrl( l_handle, l_data, sizeof( l_data ), ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - - memset( l_data, 0xEE, sizeof( l_data ) ); - - addUsrDtlsToErrl( l_handle2, l_data, sizeof( l_data ), ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_CALLHOME_DATA ); - - memset( l_data, 0xDD, sizeof( l_data ) ); - - addUsrDtlsToErrl( l_handle3, l_data, 76, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - dumpLog( l_handle2, l_handle2->iv_userDetails.iv_entrySize ); - dumpLog( l_handle3, l_handle3->iv_userDetails.iv_entrySize ); - - commitErrl( &l_handle ); - commitErrl( &l_handle2 ); - commitErrl( &l_handle3 ); - printf("%s: Slots after Commit - 3 slots should be used/committed \n", __FUNCTION__ ); - ppdumpslot(); - - deleteErrl(&l_handleX); - deleteErrl(&l_handle2X); - deleteErrl(&l_handle3X); - printf("%s: Slots after delete Log - All slots should be empty\n", __FUNCTION__ ); - ppdumpslot(); - printf("%s: END \n", __FUNCTION__ ); -} - -// Function Specification -// -// Name: testdtlsizelimit -// -// Description: -// -// End Function Specification -void testdtlsizelimit(const tracDesc_t i_trace) -{ - printf("%s: START \n", __FUNCTION__ ); - errlHndl_t l_handle = NULL; - - l_handle = createErrl( 0x1616, 0x08, ERRL_SEV_PREDICTIVE, i_trace, 512, 0x1, 0x2); - errlHndl_t l_handleX = l_handle; - ppdumpslot(); - - uint8_t l_data[ MAX_ERRL_CALL_HOME_SZ * 2 ]; - - memset( l_data, 0xAA, sizeof( l_data ) ); - addUsrDtlsToErrl( l_handle, l_data, 256, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - //dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - printf("%s: Slots after create + 256 bytes \n", __FUNCTION__ ); - ppdumpslot(); - - memset( l_data, 0xBB, sizeof( l_data ) ); - addUsrDtlsToErrl( l_handle, l_data, 512, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - //dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - printf("%s: Slots after create + 256 + 512 bytes \n", __FUNCTION__ ); - ppdumpslot(); - - memset( l_data, 0xCC, sizeof( l_data ) ); - addUsrDtlsToErrl( l_handle, l_data, 1024, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - //dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - printf("%s: Slots after create + 256 + 512 +1024 bytes \n", __FUNCTION__ ); - ppdumpslot(); - - memset( l_data, 0xDD, sizeof( l_data ) ); - addUsrDtlsToErrl( l_handle, l_data, 2048, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - printf("%s: Slots after create 2k should be full with DD having only 72 bytes \n", __FUNCTION__ ); - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - ppdumpslot(); - - - commitErrl( &l_handle ); - deleteErrl(&l_handleX); - printf("%s: Slots should now be empty \n", __FUNCTION__ ); - ppdumpslot(); - printf("%s: END \n", __FUNCTION__ ); -} - -// Function Specification -// -// Name: timetest -// -// Description: -// -// End Function Specification -void timetest(const tracDesc_t i_trace) -{ - printf("%s: START \n", __FUNCTION__ ); - errlHndl_t l_handle = NULL; - uint64_t l_start = 0; - uint64_t l_end = 0; - - l_start = ssx_timebase_get(); - l_handle = createErrl( 0x1716, 0x08, ERRL_SEV_CALLHOME_DATA, i_trace, 128, 0x1, 0x2); - errlHndl_t l_handle2 = l_handle; - commitErrl( &l_handle ); - l_end = ssx_timebase_get(); - printf("%s: Time to create/delete secs[%d] \n",__FUNCTION__, (int)SSX_MICROSECONDS(l_end-l_start)); - - deleteErrl(&l_handle2); - printf("%s: END \n", __FUNCTION__ ); -} - -// Function Specification -// -// Name: createcommitdeletelog -// -// Description: -// -// End Function Specification -void createcommitdeletelog(const tracDesc_t i_trace) -{ - printf("%s: START \n", __FUNCTION__ ); - errlHndl_t l_handle = NULL; - l_handle = createErrl( 0x1616, 0x08, ERRL_SEV_CALLHOME_DATA, i_trace, 512, 0x1, 0x2); - printf("%s: Slots after Creating call home log \n", __FUNCTION__ ); - ppdumpslot(); - - - errlHndl_t l_handle2 = l_handle; - commitErrl( &l_handle ); - printf("%s: Slots after Commiting call home log \n ", __FUNCTION__ ); - dumpLog( l_handle2, l_handle2->iv_userDetails.iv_entrySize ); - ppdumpslot(); - - deleteErrl(&l_handle2); - printf("%s: Slots after delete Log \n", __FUNCTION__ ); - ppdumpslot(); - - printf("%s: END \n", __FUNCTION__ ); -} - - -// Function Specification -// -// Name: create2infologtest -// -// Description: -// -// End Function Specification -void create2infologtest(const tracDesc_t i_trace) -{ - printf("%s: START \n", __FUNCTION__ ); - printf("--------------------------------\n"); - errlHndl_t l_handle = NULL; - errlHndl_t l_handle2= NULL; - l_handle = createErrl( 0x1616, 0x08, ERRL_SEV_INFORMATIONAL,i_trace, 5, 0x1, 0x2); - - l_handle2 = createErrl( 0x2727, 0x19, ERRL_SEV_INFORMATIONAL, i_trace, 6, 0x2, 0x3); - - if( l_handle2 == INVALID_ERR_HNDL ) - { - printf("%s: Creating 2 info logs PASSED, only 1 was created @ %p \n", __FUNCTION__, l_handle ); - ppdumpslot(); - } - else - { - printf("%s: Creating 2 info logs FAILED, only 1 info log should be created! %p \n", __FUNCTION__, l_handle2 ); - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - dumpLog( l_handle2, l_handle2->iv_userDetails.iv_entrySize ); - ppdumpslot(); - } - - deleteErrl(&l_handle); - - printf("%s: END \n", __FUNCTION__ ); -} - -// Function Specification -// -// Name: createMaxLogs -// -// Description: -// -// End Function Specification -void createMaxLogs(const tracDesc_t i_trace) -{ - ERRL_SEVERITY l_sevs[4] = - { - ERRL_SEV_UNRECOVERABLE, - ERRL_SEV_PREDICTIVE, - ERRL_SEV_CALLHOME_DATA, - ERRL_SEV_INFORMATIONAL - }; - - uint8_t l_chars[6] = { 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; - - - printf("%s: START \n", __FUNCTION__ ); - errlHndl_t l_handle = NULL; - printf("--------------------------------\n"); - - - uint32_t l_index = 0; - for(l_index =0; l_index < ERRL_MAX_SLOTS; l_index++) - { - uint32_t l_sev = (uint32_t)rand32(4); - uint32_t l_trace = (uint32_t)rand32( 512 ); - l_handle = createErrl( 0x1616, 0x08, l_sevs[ l_sev ], i_trace, l_trace, 0x1, 0x2); - - if( ( l_handle != INVALID_ERR_HNDL) && - ( l_handle != NULL ) ) - { - printf("Log Created @ %p with Sev[%s]\n",l_handle, SevAsciiValue( l_sevs[ l_sev ]) ); - - uint8_t l_ud = (uint8_t) rand32(2); - if ( l_ud ) - { - uint8_t l_data[ (uint32_t) rand32( 512 ) ]; - - memset( l_data, l_chars[(uint8_t) rand32(6)], sizeof( l_data ) ); - addUsrDtlsToErrl( l_handle, l_data, sizeof(l_data), ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - } - - commitErrl( &l_handle ); - } - else - { - printf("Could not create error log with Sev[%s]\n",SevAsciiValue( l_sevs[ l_sev ]) ); - - uint8_t l_purge = (uint8_t) rand32(2); - - if ( l_purge ) - { - uint32_t l_slots = (uint32_t)rand32(ERRL_MAX_SLOTS); - - if ((G_occErrSlots[l_slots] != INVALID_ERR_HNDL) && - (G_occErrSlots[l_slots] != NULL )) - { - printf("Deleting log with id[%d] @ %p (slot %d)\n", G_occErrSlots[l_slots]->iv_entryId, G_occErrSlots[l_slots], l_slots ); - errlHndl_t l_handle = G_occErrSlots[l_slots]; - deleteErrl( &l_handle ); - } - } - - } - - uint8_t l_dumpfile = (uint8_t) rand32(2); - - if ( l_dumpfile ) - { - uint32_t l_slots = (uint32_t)rand32(ERRL_MAX_SLOTS); - - if ((G_occErrSlots[l_slots] != INVALID_ERR_HNDL) && - (G_occErrSlots[l_slots] != NULL )) - { - errlHndl_t l_handle = G_occErrSlots[l_slots]; - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - } - } - - ppdumpslot(); - } - - printf("%s: END \n", __FUNCTION__ ); -} - - -// Function Specification -// -// Name: testcallouts -// -// Description: -// -// End Function Specification -void testcallouts(const tracDesc_t i_trace) -{ - printf("%s: START \n", __FUNCTION__ ); - errlHndl_t l_handle = NULL; - printf("--------------------------------\n"); - - l_handle = createErrl( 0x1616, 0x08,ERRL_SEV_PREDICTIVE,i_trace, 5, 0x1, 0x2); - errlHndl_t l_log = l_handle; - - if(l_handle != INVALID_ERR_HNDL) - { -// printf("Commiting log @p %p\n",l_handle); - ERRL_CALLOUT_PRIORITY l_array[8] = { - ERRL_CALLOUT_PRIORITY_HIGH, - ERRL_CALLOUT_PRIORITY_MED, - ERRL_CALLOUT_PRIORITY_LOW, - ERRL_CALLOUT_PRIORITY_HIGH, - ERRL_CALLOUT_PRIORITY_MED, - ERRL_CALLOUT_PRIORITY_MED, - ERRL_CALLOUT_PRIORITY_LOW, - ERRL_CALLOUT_PRIORITY_LOW, - }; - uint8_t l_index = 0; - for(l_index =0; l_index < 8; l_index++) - { - printf("%s: current callouts %d attempting to add callout # %d with priority %d\n", __FUNCTION__, l_handle->iv_numCallouts, l_index, l_array[l_index] ); - addCalloutToErrl(l_handle,l_index,l_array[l_index]); - } - - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - - commitErrl( &l_handle ); - } - else - { - printf("could not create error log with [%s]\n",SevAsciiValue(ERRL_SEV_CALLHOME_DATA)); - } - - ppdumpslot(); - - deleteErrl( &l_log ); - - printf("%s: END \n", __FUNCTION__ ); -} - -// Function Specification -// -// Name: main_thread_routine -// -// Description: This thread currently just loops as the lowest priority thread, handling -// the lowest priority tasks. -// -// End Function Specification -void main_thread_routine(void *private) -{ - // Start the critical 250uS timer - ssx_timer_schedule(&timer, 1, TIMER_INTERVAL); - - while(1) - { - // Only trace the first XX times that this function loops - if(g_k < 3) - { - g_k++; - - } - - // Sleep for 1000 before we run the loop again - ssx_sleep_absolute(1000); - } -} - - -// Function Specification -// -// Name: main -// -// Description: main() currently initalizes our trace buffer along with creating threads -// and timers for execution. Note that once main runs ssx_start_threads, we -// never return as the SSX kernel takes over. -// -// End Function Specification -int main(int argc, char **argv) -{ - - // Initialize stdout so we can do printf from within simics env - simics_stdout_create(&simics_stdout); - simics_stderr_create(&simics_stderr); - stdout = (FILE *)(&simics_stdout); - stderr = (FILE *)(&simics_stderr); - - // Initialize SSX Stacks (note that this also reinitializes the time base to 0) - ssx_initialize((SsxAddress)noncritical_stack, NONCRITICAL_STACK_SIZE, - (SsxAddress)critical_stack, CRITICAL_STACK_SIZE, - 0); - - // TRACE: Trace buffers initialized - tracDesc_t g_trac_main = NULL; - - timetest(g_trac_main); - - //createcommitdeletelog(g_trac_main); - - //testsizelimit( g_trac_main ); - - //testdtlsizelimit( g_trac_main ); - - //create2infologtest(g_trac_main); - - //createMaxLogs(g_trac_main); - - //testcallouts(g_trac_main); - - - // Create Timers - //ssx_timer_create(&timer, timer_routine, 0); - - // Create Global Semaphores - ssx_semaphore_create(&prcd_sem, 0, 13); - - // Create Threads - ssx_thread_create(&main_thread, - main_thread_routine, - (void *)0, - (SsxAddress)main_thread_stack, - THREAD_STACK_SIZE, - 1); - - // Create Threads - ssx_thread_create(&prcd_thread, - prcd_thread_routine, - (void *)0, - (SsxAddress)prcd_thread_stack, - THREAD_STACK_SIZE, - 0); - - // Make Threads runnable - ssx_thread_resume(&main_thread); - ssx_thread_resume(&prcd_thread); - - // Initialize Realtime Loop Timer Interrupt - //rtloop_ocb_init(); - - // Enter SSX Kernel - ssx_start_threads(); - - return 0; -} - diff --git a/src/occ_405/errl/test/gpefiles.mk b/src/occ_405/errl/test/gpefiles.mk deleted file mode 100755 index 049a87c..0000000 --- a/src/occ_405/errl/test/gpefiles.mk +++ /dev/null @@ -1,29 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occ_405/errl/test/gpefiles.mk $ -# -# OpenPOWER OnChipController Project -# -# 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 -# -# 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 - -occ_GPEFILES = ../../gpe/pore_test.S - -all_gpefiles = ${occ_GPEFILES} - diff --git a/src/occ_405/errl/test/parser.c b/src/occ_405/errl/test/parser.c deleted file mode 100755 index 1b00468..0000000 --- a/src/occ_405/errl/test/parser.c +++ /dev/null @@ -1,268 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occ_405/errl/test/parser.c $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ -/* [+] 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 -#include -#include - -typedef uint32_t UINT32; -typedef int32_t INT32; -typedef uint8_t UCHAR; -typedef uint8_t UINT8; -typedef int8_t INT8; -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef char CHAR; -typedef unsigned int UINT; -typedef unsigned long ULONG; -typedef int INT; -typedef void VOID; -typedef uint32_t size_t ; - - -// Max size of non call home data logs (2048 bytes) -#define MAX_ERRL_ENTRY_SZ 0x800 - -// Max size of call home data log (3072 bytes) -#define MAX_ERRL_CALL_HOME_SZ 0xC00 - -// Max size of callouts -#define ERRL_MAX_CALLOUTS 6 - -// Max number of error logs -#define ERRL_MAX_SLOTS 9 - -// Used to default a old/bad error handle -#define INVALID_ERR_HNDL (errlHndl_t)INVALID_ERR - -// 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 -/* Slot Masks */ -typedef enum -{ - ERRL_SLOT_MASK_DEFAULT = 0xFFFFFFFF, - ERRL_SLOT_MASK_INFORMATIONAL = 0xFEFFFFFF, - ERRL_SLOT_MASK_PREDICTIVE = 0x01FFFFFF, - ERRL_SLOT_MASK_UNRECOVERABLE = 0x01FFFFFF, - ERRL_SLOT_MASK_CALL_HOME_DATA = 0xFF7FFFFF, -} ERRL_SLOT_MASK; - -// These are the possible severities that an error log can have. -// Users must ONLY use these enum values for severity. -/* Error Severity */ -typedef enum -{ - ERRL_SEV_INFORMATIONAL = 0x00, - ERRL_SEV_PREDICTIVE = 0x01, - ERRL_SEV_UNRECOVERABLE = 0x02, - ERRL_SEV_CALLHOME_DATA = 0x03, -} ERRL_SEVERITY; - -// These are the possible callout priorities that a callout can have. -// Users must ONLY use these enum values for callout priority -/* Callout Priority */ -typedef enum -{ - ERRL_CALLOUT_PRIORITY_INVALID = 0x00, - ERRL_CALLOUT_PRIORITY_LOW = 0x01, - ERRL_CALLOUT_PRIORITY_MED = 0x02, - ERRL_CALLOUT_PRIORITY_HIGH = 0x03, -} ERRL_CALLOUT_PRIORITY; - -// These are the user detail types that a user details can have. -// Users must ONLY use these enum values for user detail type -/* User Detail Type */ -typedef enum -{ - ERRL_USR_DTL_TRACE_DATA = 0x01, - ERRL_USR_DTL_CALLHOME_DATA = 0x02, -} ERRL_USR_DETAIL_TYPE; - -// These are the possible OCC States. -/* OCC States */ -typedef enum -{ - ERRL_OCC_STATE_INVALID = 0xFF, -} ERRL_OCC_STATE; - -//Versions -/* Errl Structure Version */ -typedef enum -{ - ERRL_STRUCT_VERSION_1 = 0x01, -} ERRL_STRUCT_VERSION; - -/* Errl User Details Version */ -typedef enum -{ - ERRL_USR_DTL_STRUCT_VERSION_1 = 0x01, -} ERRL_USR_DTL_STRUCT_VERSION; - - -/* Errl Trace Version */ -typedef enum -{ - ERRL_TRACE_VERSION_1 = 0x00, -} ERRL_TRACE_VERSION; - -/* Callout Structure */ -struct ErrlCallout -{ - uint64_t iv_homUnitId; // HOM Unit ID - uint8_t iv_priority; // Callout Priority - // NOTE: Users must use ERRL_CALLOUT_PRIORITY enum - uint8_t iv_reserved1; // Reserved 1 - uint16_t iv_reserved2; // Reserved 2 - -} __attribute__ ((__packed__)); - -typedef struct ErrlCallout ErrlCallout_t; - -// The User Detail Entry Structure consists of the fields below followed -// by the actual data the user is trying to collect. -// NOTE: A data pointer field is NOT defined but rather inferred here. In the -// error log contents, the user will see all the subsequent fields followed -// by the actual data -/* User Detail Entry Structure */ -struct ErrlUserDetailsEntry -{ - uint8_t iv_version; // User Details Entry Version - uint8_t iv_type; // User Details Entry Type - // Note: Users must use ERRL_USR_DETAIL_TYPE enum - uint16_t iv_size; // User Details Entry Size -} __attribute__ ((__packed__)); - -typedef struct ErrlUserDetailsEntry ErrlUserDetailsEntry_t; - -// The User Detail Structure consists of the fields below followed -// by each individual User Details Entry structure & data -// NOTE: A data pointer field is NOT defined but rather inferred here. In the -// error log contents, the user will see all the subsequent fields followed -// by each User Details Entry structure and its data -/* User Detail Structure */ -struct ErrlUserDetails -{ - uint8_t iv_version; // User Details Version - uint8_t iv_reserved; // Reserved - uint16_t iv_modId; // Module Id - uint32_t iv_fclipHistory; // Frequency Clip History - uint64_t iv_timeStamp; // Time Stamp - uint8_t iv_occId; // OCC ID - uint8_t iv_occRole; // OCC Role - uint8_t iv_operatingState; // OCC State - uint8_t iv_committed:1; // Log Committed? - uint8_t iv_reserved1:7; - uint32_t iv_userData1; // User Data Word 1 - uint32_t iv_userData2; // User Data Word 2 - uint32_t iv_userData3; // User Data Word 3 - uint16_t iv_reserved2; - uint16_t iv_extendedRC; // Extended RC - uint16_t iv_entrySize; // Log Size - uint16_t iv_userDetailEntrySize; // User Details Size -} __attribute__ ((__packed__)); - -typedef struct ErrlUserDetails ErrlUserDetails_t; - -/* Error Log Structure */ -struct ErrlEntry -{ - uint16_t iv_checkSum; // Log CheckSum - uint8_t iv_version; // Log Version - uint8_t iv_entryId; // Log Entry ID - uint8_t iv_reasonCode; // Log Reason Code - uint8_t iv_severity; // Log Severity - // NOTE: Users must use ERRL_SEVERITY enum - uint8_t iv_reserved1; // Reserved - - uint8_t iv_numCallouts; // Log Callout Number - ErrlCallout_t iv_callouts[ERRL_MAX_CALLOUTS]; - ErrlUserDetails_t iv_userDetails; // User Details section for Log - -} __attribute__ ((__packed__)); - -typedef struct ErrlEntry ErrlEntry_t; - -// Function Specification -// -// Name: main -// -// Description: main function -// -// End Function Specification -main() -{ - FILE * l_fptr = fopen( "occ.log.bin", "r"); - uint32_t l_sizeRead = 0; - uint32_t l_readBuf[3072] = {0}; - - if ( l_fptr ) - { - fseek( l_fptr, 0, SEEK_END); - uint32_t l_len = ftell( l_fptr ); - fseek( l_fptr, 0, SEEK_SET); - - l_sizeRead = fread( l_readBuf, 1, l_len, l_fptr ); - - printf("File read contains %d bytes read %d \n", l_len, l_sizeRead ); - } - - fclose( l_fptr ); - - ErrlEntry_t l_log; - - memcpy( &l_log, l_readBuf, l_sizeRead ); - - printf(" CheckSum : 0x%04X \n", ntohs(l_log.iv_checkSum) ); - printf(" Version : 0x%02X \n", l_log.iv_version); - printf(" Entry Id : 0x%02X \n", l_log.iv_entryId); - printf(" Reason Code: 0x%02X \n", l_log.iv_reasonCode); - printf(" Severity : 0x%02X \n", l_log.iv_severity); - printf(" Callouts : 0x%02X \n", l_log.iv_numCallouts); - uint8_t l_index=0; - for( l_index=0; l_index < ERRL_MAX_CALLOUTS; l_index++) - { - printf(" Callout%d : \n", l_index+1); - printf(" HOM UID : 0x%08X \n", ntohl(l_log.iv_callouts[l_index].iv_homUnitId)); - printf(" Priority : 0x%02X \n", l_log.iv_callouts[l_index].iv_priority ); - } - printf(" UserDetails : \n" ); - printf(" Version : 0x%02X \n", l_log.iv_userDetails.iv_version ); - printf(" Module Id : 0x%04X \n", ntohs(l_log.iv_userDetails.iv_modId) ); - printf(" FClip History : 0x%08X \n", l_log.iv_userDetails.iv_fclipHistory ); - printf(" Time : 0x%08X \n", l_log.iv_userDetails.iv_timeStamp ); - printf(" OCC ID : 0x%02X \n", l_log.iv_userDetails.iv_occId ); - printf(" OCC Role : 0x%02X \n", l_log.iv_userDetails.iv_occRole ); - printf(" OCC State : 0x%02X \n", l_log.iv_userDetails.iv_operatingState ); - printf(" Committed : %s \n", (l_log.iv_userDetails.iv_committed != 0) ? "true":"false" ); - printf(" Word 1 : 0x%08X \n", ntohl(l_log.iv_userDetails.iv_userData1) ); - printf(" Word 2 : 0x%08X \n", ntohl(l_log.iv_userDetails.iv_userData2) ); - printf(" Word 3 : 0x%08X \n", ntohl(l_log.iv_userDetails.iv_userData3) ); - printf(" Word 4 : 0x%08X \n", ntohl(l_log.iv_userDetails.iv_userData4) ); - printf(" Entry Size : 0x%04X \n", ntohs(l_log.iv_userDetails.iv_entrySize) ); - - - return 0; -} diff --git a/src/occ_405/errl/test/test.mk b/src/occ_405/errl/test/test.mk deleted file mode 100755 index ebf84d8..0000000 --- a/src/occ_405/errl/test/test.mk +++ /dev/null @@ -1,33 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occ_405/errl/test/test.mk $ -# -# OpenPOWER OnChipController Project -# -# 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 -# -# 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 - -errltest_CFILES = \ - ../../common.c \ - ../errl.c \ - ../../thread/threadSch.c \ - errltest.c - -all_cfiles = ${errltest_CFILES} - diff --git a/src/occ_405/occbuildname.c b/src/occ_405/occbuildname.c index 95646b1..fd08a84 100755 --- a/src/occ_405/occbuildname.c +++ b/src/occ_405/occbuildname.c @@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = #else -volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /**/ "op_occ_190514a\0" /**/ ; +volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /**/ "op_occ_190522a\0" /**/ ; #endif -- cgit v1.2.1