diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2013-05-03 16:52:54 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-06-02 16:01:02 -0500 |
commit | 231c0fe688b855130c474dc2f89d83632ecd3e3c (patch) | |
tree | 90f619475729b939f7f9987c58b725e38e7920f4 /src/include/usr/pnor | |
parent | f74626d33553b1f5b557e57bf1a3672a6afb4e5a (diff) | |
download | talos-hostboot-231c0fe688b855130c474dc2f89d83632ecd3e3c.tar.gz talos-hostboot-231c0fe688b855130c474dc2f89d83632ecd3e3c.zip |
PNOR ECC algorithms
RTC: 70686
Change-Id: I977bbabf99d57cdf28ef2c0a79d1f10f6b1c201c
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4364
Tested-by: Jenkins Server
Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/pnor')
-rw-r--r-- | src/include/usr/pnor/ecc.H | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/include/usr/pnor/ecc.H b/src/include/usr/pnor/ecc.H new file mode 100644 index 000000000..079339aa2 --- /dev/null +++ b/src/include/usr/pnor/ecc.H @@ -0,0 +1,84 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/pnor/ecc.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __PNOR_ECC_H +#define __PNOR_ECC_H + +#include <stdint.h> + +/** @file ecc.H + * @brief Interfaces for the P8 8-byte ECC algorithm. + */ + +namespace PNOR +{ +namespace ECC +{ + /** Status for the ECC removal function. */ + enum eccStatus + { + CLEAN, //< No ECC Error was detected. + CORRECTED, //< ECC error detected and corrected. + UNCORRECTABLE //< ECC error detected and uncorrectable. + }; + + /** Bit field identifiers for syndrome calculations. */ + enum eccBitfields + { + GD = 0xff, //< Good, ECC matches. + UE = 0xfe, //< Uncorrectable. + E0 = 71, //< Error in ECC bit 0 + E1 = 70, //< Error in ECC bit 1 + E2 = 69, //< Error in ECC bit 2 + E3 = 68, //< Error in ECC bit 3 + E4 = 67, //< Error in ECC bit 4 + E5 = 66, //< Error in ECC bit 5 + E6 = 65, //< Error in ECC bit 6 + E7 = 64 //< Error in ECC bit 7 + }; + + /** Inject ECC into a data stream. + * + * @param[in] i_src - Source data to create ECC on. + * @param[in] i_srcSz - Size in bytes of source data. + * @param[out] o_dst - Destination buffer of data+ECC. + * + * @note i_srcSz must be a multiple of 8 bytes. + */ + void injectECC(const uint8_t* i_src, size_t i_srcSz, + uint8_t* o_dst); + + /** Remove ECC from a data stream. + * + * @param[in,out] io_src - Source data+ECC stream. + * @param[out] o_dst - Destination buffer for data only. + * @param[in] i_dstSz - Size in bytes of destination ((srcSz / 9) * 8). + * + * @note i_dstSz must be a multiple of 8 bytes. + */ + eccStatus removeECC(uint8_t* io_src, + uint8_t* o_dst, size_t i_dstSz); + +} +} + +#endif |