diff options
| author | Chris Cain <cjcain@us.ibm.com> | 2017-01-10 14:32:13 -0600 |
|---|---|---|
| committer | Christopher J. Cain <cjcain@us.ibm.com> | 2017-01-18 18:40:21 -0500 |
| commit | 6089fe0e7580b1c5030d1f380b1bc91c293e8bb9 (patch) | |
| tree | 274c7e5e0c6a3214fd4c792266fbe8a396fa23d8 /src/occ_405/errl | |
| parent | 4141b5f5fef2ba4b444aabbda1677e7f583cd4e8 (diff) | |
| download | talos-occ-6089fe0e7580b1c5030d1f380b1bc91c293e8bb9.tar.gz talos-occ-6089fe0e7580b1c5030d1f380b1bc91c293e8bb9.zip | |
AVS Bus divider, loadline and misc changes
- validate CRC in cmd response
- read current / voltage on alternating ticks (commands on both bus for each tick)
- calculate chip power (with loadline) and power for each tick
- update divider value for bus speed
- add error history counters and add them to logs
Change-Id: I33bce916dc2dffef6a6d616633a5f1266d7baa7e
RTC: 163992
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34947
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Diffstat (limited to 'src/occ_405/errl')
| -rwxr-xr-x | src/occ_405/errl/errl.c | 66 | ||||
| -rwxr-xr-x | src/occ_405/errl/errl.h | 21 |
2 files changed, 86 insertions, 1 deletions
diff --git a/src/occ_405/errl/errl.c b/src/occ_405/errl/errl.c index a309279..07b5e6e 100755 --- a/src/occ_405/errl/errl.c +++ b/src/occ_405/errl/errl.c @@ -61,6 +61,9 @@ errlHndl_t G_occErrSlots[ERRL_MAX_SLOTS] = { (errlHndl_t) G_callslot }; +// Array of error counters that are only cleared on OCC reset +uint8_t G_error_history[ERR_HISTORY_SIZE] = {0}; + extern uint8_t G_occ_interrupt_type; extern bool G_fir_collection_required; @@ -305,6 +308,9 @@ errlHndl_t createErrl( // add trace addTraceToErrl( i_trace, i_traceSz, l_rc ); + // add error history + addErrHistory( l_rc ); + // save off entry Id l_rc->iv_entryId = l_id; @@ -518,6 +524,64 @@ void addTraceToErrl( } + + +// Function Specification +// +// Name: addErrHistory +// +// Description: Add error trace history to log +// +// End Function Specification +void addErrHistory(errlHndl_t io_err) +{ + // 1. Check if error log is not null + // 2. error log is not invalid + // 3. error log has not been commited + // 4. free space is enough (to hold new user detail header + data) + 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 ) ) + { + void * l_errPtr = io_err; + ErrlUserDetailsEntry_t l_usrDtlsEntry; + const uint16_t l_usrDtlsHeaderSz = sizeof(l_usrDtlsEntry); + + // io_err |-----------------------------------------| + // | ErrlEntry_t | + // | {iv_userDetails.iv_userDetailEntrySize, | <== elog header and optional user details sections, need to add length + // | ... other elements ... }| of new usrdtl section(ErrlUserDetailsEntry_t + data len) + // |-----------------------------------------| + // | ErrlUserDetailsEntry_t | <== new user detail header (l_usrDtlsEntry) + // |-----------------------------------------| + // | data ... | <== new user detail data (G_error_history) + // | ... | + + l_usrDtlsEntry.iv_size = sizeof(G_error_history); + l_usrDtlsEntry.iv_type = (uint8_t) ERRL_USR_DTL_HISTORY_DATA; + l_usrDtlsEntry.iv_version = 1; + + // Calculate trace data address (err address + sizeof(ErrlEntry_t + existing usrDtls) + sizeof(ErrlUserDetailsEntry_t)) + void * l_dataAddr = l_errPtr + io_err->iv_userDetails.iv_entrySize + l_usrDtlsHeaderSz; + memcpy(l_dataAddr, G_error_history, sizeof(G_error_history)); + + // Calculate entire data length including usrDtl header. + const uint16_t l_sizeOfUsrDtls = l_usrDtlsHeaderSz + l_usrDtlsEntry.iv_size; + + // Copy new user details header into log + memcpy(l_errPtr+((io_err->iv_userDetails.iv_entrySize)), &l_usrDtlsEntry, l_usrDtlsHeaderSz); + + //update master user details size with new data + io_err->iv_userDetails.iv_userDetailEntrySize += l_sizeOfUsrDtls; + + //update error log with new size + io_err->iv_userDetails.iv_entrySize += l_sizeOfUsrDtls; + } + +} // end addErrHistory() + + // Function Specification // // Name: reportErrorLog @@ -571,7 +635,7 @@ void commitErrl( errlHndl_t *io_err ) if (l_oisr0_status.fields.check_stop_ppc405) { - TRAC_IMP("addTraceToErrl: System checkstop detected: ppc405, OISR0[0x%08x]", + TRAC_IMP("commitErrl: System checkstop detected: ppc405, OISR0[0x%08x]", l_oisr0_status.value); //Go to the reset state to minimize errors reset_state_request(RESET_REQUESTED_DUE_TO_ERROR); diff --git a/src/occ_405/errl/errl.h b/src/occ_405/errl/errl.h index 217dde2..fcfb83b 100755 --- a/src/occ_405/errl/errl.h +++ b/src/occ_405/errl/errl.h @@ -110,6 +110,7 @@ typedef enum ERRL_USR_DTL_TRACE_DATA = 0x01, ERRL_USR_DTL_CALLHOME_DATA = 0x02, ERRL_USR_DTL_BINARY_DATA = 0x03, + ERRL_USR_DTL_HISTORY_DATA = 0x04, } ERRL_USR_DETAIL_TYPE; // These are the possible OCC States. @@ -265,6 +266,23 @@ extern uint8_t G_occErrIdCounter; extern errlHndl_t G_occErrSlots[ERRL_MAX_SLOTS]; +// Array of error counters that are only cleared on OCC reset +#define ERR_HISTORY_SIZE 32 +extern uint8_t G_error_history[ERR_HISTORY_SIZE]; +typedef enum { + ERR_AVSBUS_VDD_CURRENT = 1, + ERR_AVSBUS_VDD_VOLTAGE = 2, + ERR_AVSBUS_VDN_CURRENT = 3, + ERR_AVSBUS_VDN_VOLTAGE = 4, + ERR_DIMM_I2C_PORT0 = 5, + ERR_DIMM_I2C_PORT1 = 6 +} ERR_HISTORY_INDEX; +#define INCREMENT_ERR_HISTORY(errorIndex) { \ + if ((errorIndex < ERR_HISTORY_SIZE) && (G_error_history[errorIndex] < 255)) { \ + ++G_error_history[errorIndex]; \ + } \ +} + // Globals used by testcases extern uint8_t G_errslot1[MAX_ERRL_ENTRY_SZ]; extern uint8_t G_errslot2[MAX_ERRL_ENTRY_SZ]; @@ -296,6 +314,9 @@ void addTraceToErrl( errlHndl_t io_errl ); +// Add Error history data to the Error Log +void addErrHistory(errlHndl_t io_err); + /* Commit the Error Log */ void commitErrl( errlHndl_t * io_err ); |

