aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-10-31 19:19:20 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2006-10-31 19:19:20 -0500
commitcad40654c312fc51bdb520e9be91e29a9742bbcb (patch)
tree682b30b108db2e637da5ff4e7f43c28c5e63bb6d /drivers/mtd/nand
parentbe8444bdf34f7ba21e2364ca296c68e81033e3b2 (diff)
[MTD] NAND: Fix ECC settings in CAFÉ controller driver.
We were resetting cafe->ctl2 to zero after an erase (and also during a write, but it was correctly reset after that). This meant that ECC reads after an erase were failing. Doh. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/cafe.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mtd/nand/cafe.c b/drivers/mtd/nand/cafe.c
index c5d03b07f7a9..fad304bf7b7e 100644
--- a/drivers/mtd/nand/cafe.c
+++ b/drivers/mtd/nand/cafe.c
@@ -159,6 +159,7 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command,
159 /* Second half of a command we already calculated */ 159 /* Second half of a command we already calculated */
160 cafe_writel(cafe, cafe->ctl2 | 0x100 | command, NAND_CTRL2); 160 cafe_writel(cafe, cafe->ctl2 | 0x100 | command, NAND_CTRL2);
161 ctl1 = cafe->ctl1; 161 ctl1 = cafe->ctl1;
162 cafe->ctl2 &= ~(1<<30);
162 cafe_dev_dbg(&cafe->pdev->dev, "Continue command, ctl1 %08x, #data %d\n", 163 cafe_dev_dbg(&cafe->pdev->dev, "Continue command, ctl1 %08x, #data %d\n",
163 cafe->ctl1, cafe->nr_data); 164 cafe->ctl1, cafe->nr_data);
164 goto do_command; 165 goto do_command;
@@ -219,7 +220,6 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command,
219 /* Ignore the first command of a pair; the hardware 220 /* Ignore the first command of a pair; the hardware
220 deals with them both at once, later */ 221 deals with them both at once, later */
221 cafe->ctl1 = ctl1; 222 cafe->ctl1 = ctl1;
222 cafe->ctl2 = 0;
223 cafe_dev_dbg(&cafe->pdev->dev, "Setup for delayed command, ctl1 %08x, dlen %x\n", 223 cafe_dev_dbg(&cafe->pdev->dev, "Setup for delayed command, ctl1 %08x, dlen %x\n",
224 cafe->ctl1, cafe->datalen); 224 cafe->ctl1, cafe->datalen);
225 return; 225 return;
@@ -281,9 +281,7 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command,
281 command, 500000-c, irqs, cafe_readl(cafe, NAND_IRQ)); 281 command, 500000-c, irqs, cafe_readl(cafe, NAND_IRQ));
282 } 282 }
283 283
284 284 WARN_ON(cafe->ctl2 & (1<<30));
285 cafe->ctl2 &= ~(1<<8);
286 cafe->ctl2 &= ~(1<<30);
287 285
288 switch (command) { 286 switch (command) {
289 287
@@ -471,9 +469,7 @@ static void cafe_nand_write_page_lowlevel(struct mtd_info *mtd,
471 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); 469 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
472 470
473 /* Set up ECC autogeneration */ 471 /* Set up ECC autogeneration */
474 cafe->ctl2 |= (1<<27) | (1<<30); 472 cafe->ctl2 |= (1<<30);
475 if (mtd->writesize == 2048)
476 cafe->ctl2 |= (1<<29);
477} 473}
478 474
479static int cafe_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip, 475static int cafe_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,