summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-06-22 08:42:23 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-06-22 08:45:45 +0200
commit13ef2b249063b33b3dd264c57c418015d2503339 (patch)
tree9bd4af2e6e9b489a5310e97bb993747e80de312e /drivers
parent22d7d604f13968fdaeadda73e81e930e933d7e10 (diff)
downloadbarebox-13ef2b249063b33b3dd264c57c418015d2503339.tar.gz
barebox-13ef2b249063b33b3dd264c57c418015d2503339.tar.xz
mtd: nand: gpmi: Use subpage reads only on suitable NAND chips
On some NAND chips the driver uses a ECC size that is not dividable by the number of chunks per page which means a single chunk cannot be read. Disable the subpage feature for these NANDs. This is quite unfortunate since the subpage feature really speeds up scanning NAND chips. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/nand_mxs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
index a9c6e964aa..fd4e20954f 100644
--- a/drivers/mtd/nand/nand_mxs.c
+++ b/drivers/mtd/nand/nand_mxs.c
@@ -1392,14 +1392,16 @@ static int mxs_nand_probe(struct device_d *dev)
nand->ecc.size = 512;
nand->ecc.strength = 8;
- nand->ecc.read_subpage = gpmi_ecc_read_subpage;
- nand->options |= NAND_SUBPAGE_READ;
-
/* first scan to find the device and get the page size */
err = nand_scan_ident(mtd, 4, NULL);
if (err)
goto err2;
+ if ((13 * mxs_nand_get_ecc_strength(mtd->writesize, mtd->oobsize) % 8) == 0) {
+ nand->ecc.read_subpage = gpmi_ecc_read_subpage;
+ nand->options |= NAND_SUBPAGE_READ;
+ }
+
nand->options |= NAND_NO_SUBPAGE_WRITE;
/* second phase scan */