diff options
author | Dzuy Nguyen <dzuy@us.ibm.com> | 2016-11-23 16:57:16 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-01-19 18:03:32 -0500 |
commit | 7fd14de1394f507935cd60f6215ca5f65b97df51 (patch) | |
tree | 57aee80a5e9627f76fa9b09068568fc07f05df6c /src/include | |
parent | e671bf2e25b6902a76212ab830c1f6e2841042cc (diff) | |
download | talos-hostboot-7fd14de1394f507935cd60f6215ca5f65b97df51.tar.gz talos-hostboot-7fd14de1394f507935cd60f6215ca5f65b97df51.zip |
SBE FIFO device driver FFDC and error recovery
Add SBE FFDC error handling to FIFO driver
Change-Id: I6ae81062eac1d5362c5fa5651c8ca5a2043b5c73
RTC: 149454
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32969
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/sbeio/sbe_ffdc_parser.H | 126 | ||||
-rw-r--r-- | src/include/usr/sbeio/sbe_psudd.H | 28 | ||||
-rw-r--r-- | src/include/usr/sbeio/sbeioreasoncodes.H | 4 |
3 files changed, 130 insertions, 28 deletions
diff --git a/src/include/usr/sbeio/sbe_ffdc_parser.H b/src/include/usr/sbeio/sbe_ffdc_parser.H new file mode 100644 index 000000000..ce81f25ee --- /dev/null +++ b/src/include/usr/sbeio/sbe_ffdc_parser.H @@ -0,0 +1,126 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/sbeio/sbe_ffdc_parser.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* [+] 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 */ + +#ifndef __SBEFFDC_H +#define __SBEFFDC_H + +/** + * @file sbe_ffdc_parser.H + * @brief SBE FFDC package parser + */ + + +namespace SBEIO +{ + +/* + * @brief Type to hold the ffdc package + * This struct also holds the size and the RC +*/ +struct ffdc_package +{ + void * ffdcPtr; + uint32_t rc; + size_t size; +}; + +class SbeFFDCParser +{ + public: + + /** + * @brief Constructor + */ + SbeFFDCParser() = default; + + /** + * @brief Destructor + */ + ~SbeFFDCParser(); + + /** + * @brief Parses the FFDC data package + * @param[in] i_ffdcPackageBuffer Memory buffer contains FFDC package + * + */ + void parseFFDCData(void * i_ffdcPackageBuffer); + + /** + * @brief Returns number of FFDC packages found + * @retval: number of FFDC packages found + */ + uint8_t getTotalPackages(); + + /** + * @brief Get the raw ffdc package stored + * @retval: return pointer to raw ffdc package + * @param[in] i_index index number + */ + void * getFFDCPackage(uint8_t i_index); + + /** + * @brief Get the return code of the package + * @retval: return code of the ffdc package + * @param[in] i_index index number + */ + uint32_t getPackageRC(uint8_t i_index); + + /** + * @brief Returns the size of a ffdc package (bytes) + * @retval: length of data stored + * @param[in] i_index index number + */ + uint8_t getPackageLength(uint8_t i_index); + + private: + + /** + * @brief List of ffdc packages + */ + std::vector<ffdc_package *> iv_ffdcPackages; + + /** + * @brief constants to keep track while parsing + */ + const uint16_t iv_ffdcMagicByte = 0xFFDC; + const uint8_t iv_ffdcWordLen = 4; + const uint8_t iv_headerWordInBytes = iv_ffdcWordLen * 2; + const uint8_t iv_ffdcPackageSize = 2; + + /** + * @brief Store the data words found in FFDC package + * @param[in] i_ffdcPackage FFDC package to store + * @param[in] i_rc the RC word + * @param[in] i_packageLen length of package + */ + + void addFFDCPackage(void * i_ffdcPackage, uint32_t i_rc, + uint8_t i_packageLen); + +}; + +} + +#endif diff --git a/src/include/usr/sbeio/sbe_psudd.H b/src/include/usr/sbeio/sbe_psudd.H index f6e73cf3a..598e571af 100644 --- a/src/include/usr/sbeio/sbe_psudd.H +++ b/src/include/usr/sbeio/sbe_psudd.H @@ -468,14 +468,6 @@ class SbePsu ~SbePsu(); /** - * @brief parse the FFDC package from buffer - * @param[in] io_errl Error Entry object - * @retval: true == success, false == failure - */ - - bool handleFFDCError(ERRORLOG::ErrlEntry * io_errl); - - /** * @brief populate the iv_ffdcPackageBuffer * @param[in] i_data FFDC error data * @param[in] i_len data buffer len to copy @@ -495,31 +487,11 @@ class SbePsu void * iv_ffdcPackageBuffer; /** - * @brief Magic byte in FFDC header - */ - const uint16_t ffdcMagicByte = 0xFFDC; - - /** - * @brief each FFDC word is 4 byte long - */ - const uint8_t ffdcWordLen = 4; - - /** - * @brief difference between package length and N words - */ - const uint8_t ffdcPadLen = 6; - - /** * @brief FFDC package needs to be 2 pages */ const uint8_t ffdcPackageSize = 2; /** - * @brief byte pad before word data begins - */ - const uint8_t wordPadding = 12; - - /** * @brief zero out the FFDC package buffer */ void initFFDCPackageBuffer(); diff --git a/src/include/usr/sbeio/sbeioreasoncodes.H b/src/include/usr/sbeio/sbeioreasoncodes.H index e40c8606d..abd9540ca 100644 --- a/src/include/usr/sbeio/sbeioreasoncodes.H +++ b/src/include/usr/sbeio/sbeioreasoncodes.H @@ -45,6 +45,7 @@ enum sbeioModuleId SBEIO_INVALID_MODULE = 0x00, SBEIO_PSU = 0x01, SBEIO_FIFO = 0x02, + SBEIO_FFDC_PARSER = 0x03, }; /** @@ -74,6 +75,9 @@ enum sbeioReasonCode SBEIO_FIFO_MASTER_TARGET = SBEIO_COMP_ID | 0x18, SBEIO_FIFO_SENTINEL_TARGET = SBEIO_COMP_ID | 0x19, + // SBE FFDC Parser error codes + SBEIO_FFDC_PARSER_BUFF_OVERFLOW = SBEIO_COMP_ID | 0x1A, + // Remove once we collect the FFDC ourselves - @todo-RTC:144313 //termination_rc |