aboutsummaryrefslogtreecommitdiff
path: root/common/board_r.c
diff options
context:
space:
mode:
authorDavid Rivshin <DRivshin@allworx.com>2021-11-18 13:25:24 -0500
committerTom Rini <trini@konsulko.com>2022-01-16 08:31:03 -0500
commitf44bcb9f0d73c13738b8f3e437bda75fda642ad7 (patch)
treee552e7973388813473581560b3ba37245e3b289d /common/board_r.c
parenta6e562fe36b2bae780589a81a11fceb6e1b4a9f7 (diff)
nand: gpmc: Handle bitflips in erased pages when using BCH ECC engine
In the case of an erased (sub)page both the data and ECC are all 0xFF bytes. This fails the normal ECC verification, as the computed ECC of all-0xFF is not also 0xFF. The GPMC NAND driver attempted to detect erased pages by checking that the ECC bytes are all-0xFF, but this had two problems: 1) bitflips in the data were not corrected, so the data looked not-erased 2) bitflips in the ECC bytes were reported as uncorrectable ECC errors The equivalent Linux driver [1] correctly handles this by counting the number of 0-bits in the combination of data and ECC bytes. If the number of 0-bits is less than the amount of bits correctable by the selected ECC algorithm, then it is treated as an erased page with correctable bitflips. Implement similar, though simplified, logic in omap_correct_data_bch(). [1] see omap_elm_correct_data() in omap2.c Signed-off-by: David Rivshin <drivshin@allworx.com>
Diffstat (limited to 'common/board_r.c')
0 files changed, 0 insertions, 0 deletions