diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2010-02-26 18:09:12 +0000 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2010-02-26 18:09:12 +0000 |
commit | 87298f0de2bf3cfb615c0e6cdeefee58b0534707 (patch) | |
tree | c0bb5e3715fbb67f1592c08e394922597c608f0e /target/linux/xburst/patches-2.6.32/050-nand.patch | |
parent | de8394cc11c4f5dec1c94ee4f89a350fddcf44c2 (diff) | |
download | mtk-20170518-87298f0de2bf3cfb615c0e6cdeefee58b0534707.zip mtk-20170518-87298f0de2bf3cfb615c0e6cdeefee58b0534707.tar.gz mtk-20170518-87298f0de2bf3cfb615c0e6cdeefee58b0534707.tar.bz2 |
jz4740_nand: * Use NAND_ECC_HW_OOB_FIRST mode instead of a patched NAND_ECC_HW * Fix subpage writing * speed up reading
SVN-Revision: 19875
Diffstat (limited to 'target/linux/xburst/patches-2.6.32/050-nand.patch')
-rw-r--r-- | target/linux/xburst/patches-2.6.32/050-nand.patch | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/target/linux/xburst/patches-2.6.32/050-nand.patch b/target/linux/xburst/patches-2.6.32/050-nand.patch index e803a21..bdb1df8 100644 --- a/target/linux/xburst/patches-2.6.32/050-nand.patch +++ b/target/linux/xburst/patches-2.6.32/050-nand.patch @@ -31,49 +31,4 @@ Subject: [PATCH] /opt/Projects/openwrt/target/linux/xburst/patches-2.6.31/050-na +obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o nand-objs := nand_base.o nand_bbt.o ---- a/drivers/mtd/nand/nand_base.c -+++ b/drivers/mtd/nand/nand_base.c -@@ -956,29 +956,22 @@ static int nand_read_page_hwecc(struct m - uint8_t *ecc_calc = chip->buffers->ecccalc; - uint8_t *ecc_code = chip->buffers->ecccode; - uint32_t *eccpos = chip->ecc.layout->eccpos; -- -- for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { -- chip->ecc.hwctl(mtd, NAND_ECC_READ); -- chip->read_buf(mtd, p, eccsize); -- chip->ecc.calculate(mtd, p, &ecc_calc[i]); -- } -- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); -+ int stat; - - for (i = 0; i < chip->ecc.total; i++) - ecc_code[i] = chip->oob_poi[eccpos[i]]; - -- eccsteps = chip->ecc.steps; -- p = buf; -- -- for (i = 0 ; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { -- int stat; - -+ for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { -+ chip->ecc.hwctl(mtd, NAND_ECC_READ); -+ chip->read_buf(mtd, p, eccsize); - stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); - if (stat < 0) - mtd->ecc_stats.failed++; - else - mtd->ecc_stats.corrected += stat; - } -+ - return 0; - } - -@@ -1178,6 +1171,8 @@ static int nand_do_read_ops(struct mtd_i - bufpoi = aligned ? buf : chip->buffers->databuf; - - if (likely(sndcmd)) { -+ chip->cmdfunc(mtd, NAND_CMD_READOOB, 0x00, page); -+ chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); - chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page); - sndcmd = 0; - } + |