kernel: update to 2.6.32.6
[openwrt.git] / target / linux / xburst / patches-2.6.32 / 050-nand.patch
1 From 436aee004fda70b654698aff99427abdebf6bdb9 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Mon, 11 Jan 2010 04:29:37 +0100
4 Subject: [PATCH] /opt/Projects/openwrt/target/linux/xburst/patches-2.6.31/050-nand.patch
5
6 ---
7 drivers/mtd/nand/Kconfig | 6 ++++++
8 drivers/mtd/nand/Makefile | 1 +
9 drivers/mtd/nand/nand_base.c | 19 +++++++------------
10 3 files changed, 14 insertions(+), 12 deletions(-)
11
12 --- a/drivers/mtd/nand/Kconfig
13 +++ b/drivers/mtd/nand/Kconfig
14 @@ -482,4 +482,10 @@ config MTD_NAND_W90P910
15 This enables the driver for the NAND Flash on evaluation board based
16 on w90p910.
17
18 +config MTD_NAND_JZ4740
19 + tristate "Support NAND Flash device on Jz4740 board"
20 + depends on SOC_JZ4740
21 + help
22 + Support NAND Flash device on Jz4740 board
23 +
24 endif # MTD_NAND
25 --- a/drivers/mtd/nand/Makefile
26 +++ b/drivers/mtd/nand/Makefile
27 @@ -42,5 +42,6 @@ obj-$(CONFIG_MTD_NAND_SOCRATES) += socr
28 obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.o
29 obj-$(CONFIG_MTD_NAND_W90P910) += w90p910_nand.o
30 obj-$(CONFIG_MTD_NAND_NOMADIK) += nomadik_nand.o
31 +obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
32
33 nand-objs := nand_base.o nand_bbt.o
34 --- a/drivers/mtd/nand/nand_base.c
35 +++ b/drivers/mtd/nand/nand_base.c
36 @@ -956,29 +956,22 @@ static int nand_read_page_hwecc(struct m
37 uint8_t *ecc_calc = chip->buffers->ecccalc;
38 uint8_t *ecc_code = chip->buffers->ecccode;
39 uint32_t *eccpos = chip->ecc.layout->eccpos;
40 -
41 - for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
42 - chip->ecc.hwctl(mtd, NAND_ECC_READ);
43 - chip->read_buf(mtd, p, eccsize);
44 - chip->ecc.calculate(mtd, p, &ecc_calc[i]);
45 - }
46 - chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
47 + int stat;
48
49 for (i = 0; i < chip->ecc.total; i++)
50 ecc_code[i] = chip->oob_poi[eccpos[i]];
51
52 - eccsteps = chip->ecc.steps;
53 - p = buf;
54 -
55 - for (i = 0 ; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
56 - int stat;
57
58 + for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
59 + chip->ecc.hwctl(mtd, NAND_ECC_READ);
60 + chip->read_buf(mtd, p, eccsize);
61 stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
62 if (stat < 0)
63 mtd->ecc_stats.failed++;
64 else
65 mtd->ecc_stats.corrected += stat;
66 }
67 +
68 return 0;
69 }
70
71 @@ -1178,6 +1171,8 @@ static int nand_do_read_ops(struct mtd_i
72 bufpoi = aligned ? buf : chip->buffers->databuf;
73
74 if (likely(sndcmd)) {
75 + chip->cmdfunc(mtd, NAND_CMD_READOOB, 0x00, page);
76 + chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
77 chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
78 sndcmd = 0;
79 }
This page took 0.061345 seconds and 5 git commands to generate.