diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-07-22 18:41:23 +0000 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2013-07-22 18:41:23 +0000 |
commit | 1edc595db2f37c17131d28a6cf64483a27b5ae9c (patch) | |
tree | acc32259c37551055abfb1b0468e4b24831a4220 /target/linux/xburst/patches-3.10/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch | |
parent | e394f4dd63108ed3c9cfea5569ffde3f2d11bfc5 (diff) | |
download | upstream-1edc595db2f37c17131d28a6cf64483a27b5ae9c.tar.gz upstream-1edc595db2f37c17131d28a6cf64483a27b5ae9c.tar.bz2 upstream-1edc595db2f37c17131d28a6cf64483a27b5ae9c.zip |
xburst: Add 3.10 support
Missing files from the previous commit.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37510 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/xburst/patches-3.10/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch')
-rw-r--r-- | target/linux/xburst/patches-3.10/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/xburst/patches-3.10/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch b/target/linux/xburst/patches-3.10/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch new file mode 100644 index 0000000000..da951dcbb9 --- /dev/null +++ b/target/linux/xburst/patches-3.10/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch @@ -0,0 +1,50 @@ +From f2b7099d3986e59aab5792cecc052e440caf2cdd Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen <lars@metafoo.de> +Date: Sat, 26 Feb 2011 15:30:07 +0100 +Subject: [PATCH 02/16] NAND: Optimize NAND_ECC_HW_OOB_FIRST read + +Avoid sending unnecessary READ commands to the chip. + +Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> +--- + drivers/mtd/nand/nand_base.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c +index dfcd0a5..287c433 100644 +--- a/drivers/mtd/nand/nand_base.c ++++ b/drivers/mtd/nand/nand_base.c +@@ -1278,9 +1278,16 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd, + unsigned int max_bitflips = 0; + + /* Read the OOB area first */ +- chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); +- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); +- chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); ++ /* Read the OOB area first */ ++ if (mtd->writesize > 512) { ++ chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); ++ chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); ++ chip->cmdfunc(mtd, NAND_CMD_RNDOUT, 0, -1); ++ } else { ++ chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); ++ chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); ++ chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); ++ } + + for (i = 0; i < chip->ecc.total; i++) + ecc_code[i] = chip->oob_poi[eccpos[i]]; +@@ -1455,7 +1462,9 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from, + if (realpage != chip->pagebuf || oob) { + bufpoi = aligned ? buf : chip->buffers->databuf; + +- chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page); ++ if (chip->ecc.mode != NAND_ECC_HW_OOB_FIRST) { ++ chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page); ++ } + + /* + * Now read the page into the buffer. Absent an error, +-- +1.7.10.4 + |