diff options
author | Ivan Djelic <ivan.djelic@parrot.com> | 2011-03-11 05:05:32 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-03-11 09:25:50 -0500 |
commit | 437aa565e2656776a7104aaacd792fe789ea8b2d (patch) | |
tree | a48688f36673af7bdb29fd24de216e170f4ef22b /lib/Kconfig | |
parent | 2c1c5f199482356c00f70b6f2f368c3455d1230c (diff) |
lib: add shared BCH ECC library
This is a new software BCH encoding/decoding library, similar to the shared
Reed-Solomon library.
Binary BCH (Bose-Chaudhuri-Hocquenghem) codes are widely used to correct
errors in NAND flash devices requiring more than 1-bit ecc correction; they
are generally better suited for NAND flash than RS codes because NAND bit
errors do not occur in bursts. Latest SLC NAND devices typically require at
least 4-bit ecc protection per 512 bytes block.
This library provides software encoding/decoding, but may also be used with
ASIC/SoC hardware BCH engines to perform error correction. It is being
currently used for this purpose on an OMAP3630 board (4bit/8bit HW BCH). It
has also been used to decode raw dumps of NAND devices with on-die BCH ecc
engines (e.g. Micron 4bit ecc SLC devices).
Latest NAND devices (including SLC) can exhibit high error rates (typically
a dozen or more bitflips per hour during stress tests); in order to
minimize the performance impact of error correction, this library
implements recently developed algorithms for fast polynomial root finding
(see bch.c header for details) instead of the traditional exhaustive Chien
root search; a few performance figures are provided below:
Platform: arm926ejs @ 468 MHz, 32 KiB icache, 16 KiB dcache
BCH ecc : 4-bit per 512 bytes
Encoding average throughput: 250 Mbits/s
Error correction time (compared with Chien search):
average worst average (Chien) worst (Chien)
----------------------------------------------------------
1 bit 8.5 µs 11 µs 200 µs 383 µs
2 bit 9.7 µs 12.5 µs 477 µs 728 µs
3 bit 18.1 µs 20.6 µs 758 µs 1010 µs
4 bit 19.5 µs 23 µs 1028 µs 1280 µs
In the above figures, "worst" is meant in terms of error pattern, not in
terms of cache miss / page faults effects (not taken into account here).
The library has been extensively tested on the following platforms: x86,
x86_64, arm926ejs, omap3630, qemu-ppc64, qemu-mips.
Signed-off-by: Ivan Djelic <ivan.djelic@parrot.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'lib/Kconfig')
-rw-r--r-- | lib/Kconfig | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index 0ee67e08ad3e..b9fef78ed04f 100644 --- a/lib/Kconfig +++ b/lib/Kconfig | |||
@@ -155,6 +155,45 @@ config REED_SOLOMON_DEC16 | |||
155 | boolean | 155 | boolean |
156 | 156 | ||
157 | # | 157 | # |
158 | # BCH support is selected if needed | ||
159 | # | ||
160 | config BCH | ||
161 | tristate | ||
162 | |||
163 | config BCH_CONST_PARAMS | ||
164 | boolean | ||
165 | help | ||
166 | Drivers may select this option to force specific constant | ||
167 | values for parameters 'm' (Galois field order) and 't' | ||
168 | (error correction capability). Those specific values must | ||
169 | be set by declaring default values for symbols BCH_CONST_M | ||
170 | and BCH_CONST_T. | ||
171 | Doing so will enable extra compiler optimizations, | ||
172 | improving encoding and decoding performance up to 2x for | ||
173 | usual (m,t) values (typically such that m*t < 200). | ||
174 | When this option is selected, the BCH library supports | ||
175 | only a single (m,t) configuration. This is mainly useful | ||
176 | for NAND flash board drivers requiring known, fixed BCH | ||
177 | parameters. | ||
178 | |||
179 | config BCH_CONST_M | ||
180 | int | ||
181 | range 5 15 | ||
182 | help | ||
183 | Constant value for Galois field order 'm'. If 'k' is the | ||
184 | number of data bits to protect, 'm' should be chosen such | ||
185 | that (k + m*t) <= 2**m - 1. | ||
186 | Drivers should declare a default value for this symbol if | ||
187 | they select option BCH_CONST_PARAMS. | ||
188 | |||
189 | config BCH_CONST_T | ||
190 | int | ||
191 | help | ||
192 | Constant value for error correction capability in bits 't'. | ||
193 | Drivers should declare a default value for this symbol if | ||
194 | they select option BCH_CONST_PARAMS. | ||
195 | |||
196 | # | ||
158 | # Textsearch support is select'ed if needed | 197 | # Textsearch support is select'ed if needed |
159 | # | 198 | # |
160 | config TEXTSEARCH | 199 | config TEXTSEARCH |