OSDN Git Service

mtd: nand: mxc: Fix failed/corrected values for v2/v3 controllers
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 17 Jan 2018 11:32:09 +0000 (12:32 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 12 Feb 2018 22:35:34 +0000 (23:35 +0100)
commit67b87f66cae0bca0dd6602739383381c10b0c9c4
tree652d1ddfa1d00303b8a4bbf03899ed7e2249e564
parent1af0b3147448954c50e555496b80d94a0800a5e4
mtd: nand: mxc: Fix failed/corrected values for v2/v3 controllers

Currently nand_read_page_hwecc() from nand_base calls
mxc_nand_correct_data_v2_v3() for each subpage, but in this function we
return the corrected/failed results for the whole page instead
of a single subpage. On a 2k page size Nand this leads to results which
are 4 times too high.
The whole ecc.calculate/ecc.correct mechanism used by
nand_read_page_hwecc() is not suitable for devices which correct the
data in hardware, so fix this by using a driver specific read_page
function which does the right thing. Also add read_page_raw and read_oob
For proper raw and oob read support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/nand/mxc_nand.c