Root/target/linux/xburst/patches-3.3/0005-NAND-Optimize-reading-the-eec-data-for-the-JZ4740.patch

1From 4f28237a750afd1112b6f1266d36f8b718efe89c Mon Sep 17 00:00:00 2001
2From: Xiangfu Liu <xiangfu@sharism.cc>
3Date: Tue, 6 Mar 2012 11:19:26 +0800
4Subject: [PATCH 05/21] NAND-Optimize-reading-the-eec-data-for-the-JZ4740
5
6---
7 drivers/mtd/nand/nand_base.c | 14 ++++----------
8 1 files changed, 4 insertions(+), 10 deletions(-)
9
10--- a/drivers/mtd/nand/nand_base.c
11+++ b/drivers/mtd/nand/nand_base.c
12@@ -1295,8 +1295,8 @@ static int nand_read_page_hwecc_oob_firs
13 
14     /* Read the OOB area first */
15     if (mtd->writesize > 512) {
16- chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
17- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
18+ chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page);
19+ chip->read_buf(mtd, ecc_code, chip->ecc.total);
20         chip->cmdfunc(mtd, NAND_CMD_RNDOUT, 0, -1);
21     } else {
22         chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
23@@ -1304,9 +1304,6 @@ static int nand_read_page_hwecc_oob_firs
24         chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
25     }
26 
27- for (i = 0; i < chip->ecc.total; i++)
28- ecc_code[i] = chip->oob_poi[eccpos[i]];
29-
30     for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
31         int stat;
32 
33@@ -1361,8 +1358,8 @@ static int nand_read_subpage_hwecc_oob_f
34 
35     /* Read the OOB area first */
36     if (mtd->writesize > 512) {
37- chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
38- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
39+ chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page);
40+ chip->read_buf(mtd, ecc_code, chip->ecc.total);
41         chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1);
42     } else {
43         chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
44@@ -1370,9 +1367,6 @@ static int nand_read_subpage_hwecc_oob_f
45         chip->cmdfunc(mtd, NAND_CMD_READ0, data_col_addr, page);
46     }
47 
48- for (i = 0; i < chip->ecc.total; i++)
49- ecc_code[i] = chip->oob_poi[eccpos[i]];
50-
51     p = bufpoi + data_col_addr;
52 
53     for (i = eccbytes * start_step; num_steps; num_steps--, i += eccbytes, p += eccsize) {
54

Archive Download this file



interactive