Root/target/linux/xburst/patches-2.6.37/904-NAND-Optimize-reading-the-eec-data-for-the-JZ4740-ev.patch

1--- a/drivers/mtd/nand/nand_base.c
2+++ b/drivers/mtd/nand/nand_base.c
3@@ -1314,8 +1314,8 @@ static int nand_read_page_hwecc_oob_firs
4 
5     /* Read the OOB area first */
6     if (mtd->writesize > 512) {
7- chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
8- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
9+ chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page);
10+ chip->read_buf(mtd, ecc_code, chip->ecc.total);
11         chip->cmdfunc(mtd, NAND_CMD_RNDOUT, 0, -1);
12     } else {
13         chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
14@@ -1323,9 +1323,6 @@ static int nand_read_page_hwecc_oob_firs
15         chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
16     }
17 
18- for (i = 0; i < chip->ecc.total; i++)
19- ecc_code[i] = chip->oob_poi[eccpos[i]];
20-
21     for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
22         int stat;
23 
24@@ -1380,8 +1377,8 @@ static int nand_read_subpage_hwecc_oob_f
25 
26     /* Read the OOB area first */
27     if (mtd->writesize > 512) {
28- chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page);
29- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
30+ chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page);
31+ chip->read_buf(mtd, ecc_code, chip->ecc.total);
32         chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1);
33     } else {
34         chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
35@@ -1389,9 +1386,6 @@ static int nand_read_subpage_hwecc_oob_f
36         chip->cmdfunc(mtd, NAND_CMD_READ0, data_col_addr, page);
37     }
38 
39- for (i = 0; i < chip->ecc.total; i++)
40- ecc_code[i] = chip->oob_poi[eccpos[i]];
41-
42     p = bufpoi + data_col_addr;
43 
44     for (i = eccbytes * start_step; num_steps; num_steps--, i += eccbytes, p += eccsize) {
45

Archive Download this file



interactive