1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
svn-openwrt-archive/target/linux/xburst/patches-3.18/002-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch
Jonas Gorski 76d079204d kernel: update 3.18 to 3.18.14
Changelogs:

* https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.18.12
* https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.18.13
* https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.18.14

Build tested on brcm63xx and ipq806x, runtested on brcm63xx.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 45711
2015-05-21 19:32:46 +00:00

44 lines
1.5 KiB
Diff

From 98d33db1c87e2447b9b203399d2f995e05ecdb52 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 2/7] NAND: Optimize NAND_ECC_HW_OOB_FIRST read
Avoid sending unnecessary READ commands to the chip.
---
drivers/mtd/nand/nand_base.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1360,9 +1360,16 @@ static int nand_read_page_hwecc_oob_firs
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]];
@@ -1575,7 +1582,9 @@ static int nand_do_read_ops(struct mtd_i
__func__, buf);
read_retry:
- 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,