mxc_nand controller fixes

Sascha Hauer
2018-01-09T10:14:07Z

This series fixes several problems in the mxc_nand driver.

- Raw support does not work since hardware ECC is unconditionally
enabled
- The v2/v3 controller code returns the number of corrected
bitflips for the whole page for each subpage leading to
results for times too high
- The v1 controller code returns the number of corrected bitflips
only for the last subpage. On 2k page NANDs bitflips in the
first three subpages remain uncovered

This series fixes these issues. Tested with the mtd test modules
mtd_nandbiterrs, mtd_oobtest, mtd_pagetest and mtd_readtest on
a i.MX27 board which is a v1 controller and a i.MX25 board which
is a v2 controller. Boris, and yes, I just tried some of the userspace
mtd tests aswell, namely nandtest, nandsubpagetest and nandbiterrs
;)

Based on nand/next.

Sascha

----------------------------------------------------------------
Sascha Hauer (8):
mtd: nand: mxc: reorder functions to avoid forward declarations
mtd: nand: mxc: Add function to control hardware ECC
mtd: nand: mxc: Add buffer argument to copy_spare
mtd: nand: mxc: Fix failed/corrected values for v2/v3 controllers
mtd: nand: mxc: Fix failed/corrected values for v1 controllers
mtd: nand: mxc: Add own write_page
mtd: nand: mxc: Drop now unnecessary functions
mtd: nand: mxc: remove now unused code

drivers/mtd/nand/mxc_nand.c | 519 +++++++++++++++++++++++++++-----------------
1 file changed, 322 insertions(+), 197 deletions(-)