diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-10-30 23:36:04 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-10-30 23:36:04 -0500 |
commit | be8444bdf34f7ba21e2364ca296c68e81033e3b2 (patch) | |
tree | 2bbd646174c1e71d7eb0588caff40b294642dc79 /drivers/mtd/nand | |
parent | 195a253b6632e2b7e6319f2f67120e708646554e (diff) |
[MTD] NAND: Add register debugging spew option to CAFÉ driver
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/cafe.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/mtd/nand/cafe.c b/drivers/mtd/nand/cafe.c index 175cf82393ef..c5d03b07f7a9 100644 --- a/drivers/mtd/nand/cafe.c +++ b/drivers/mtd/nand/cafe.c | |||
@@ -72,6 +72,9 @@ module_param(skipbbt, int, 0644); | |||
72 | static int debug = 0; | 72 | static int debug = 0; |
73 | module_param(debug, int, 0644); | 73 | module_param(debug, int, 0644); |
74 | 74 | ||
75 | static int regdebug = 0; | ||
76 | module_param(regdebug, int, 0644); | ||
77 | |||
75 | static int checkecc = 1; | 78 | static int checkecc = 1; |
76 | module_param(checkecc, int, 0644); | 79 | module_param(checkecc, int, 0644); |
77 | 80 | ||
@@ -228,12 +231,6 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, | |||
228 | cafe_writel(cafe, cafe->ctl2 | 0x100 | NAND_CMD_READSTART, NAND_CTRL2); | 231 | cafe_writel(cafe, cafe->ctl2 | 0x100 | NAND_CMD_READSTART, NAND_CTRL2); |
229 | 232 | ||
230 | do_command: | 233 | do_command: |
231 | #if 0 | ||
232 | /* http://dev.laptop.org/ticket/200 | ||
233 | ECC on read only works if we read precisely 0x80e bytes */ | ||
234 | if (cafe->datalen == 2112) | ||
235 | cafe->datalen = 2062; | ||
236 | #endif | ||
237 | cafe_dev_dbg(&cafe->pdev->dev, "dlen %x, ctl1 %x, ctl2 %x\n", | 234 | cafe_dev_dbg(&cafe->pdev->dev, "dlen %x, ctl1 %x, ctl2 %x\n", |
238 | cafe->datalen, ctl1, cafe_readl(cafe, NAND_CTRL2)); | 235 | cafe->datalen, ctl1, cafe_readl(cafe, NAND_CTRL2)); |
239 | 236 | ||
@@ -254,13 +251,13 @@ static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, | |||
254 | } | 251 | } |
255 | cafe->datalen = 0; | 252 | cafe->datalen = 0; |
256 | 253 | ||
257 | #if 0 | 254 | if (unlikely(regdebug)) { |
258 | { int i; | 255 | int i; |
259 | printk("About to write command %08x\n", ctl1); | 256 | printk("About to write command %08x to register 0\n", ctl1); |
260 | for (i=0; i< 0x5c; i+=4) | 257 | for (i=4; i< 0x5c; i+=4) |
261 | printk("Register %x: %08x\n", i, readl(cafe->mmio + i)); | 258 | printk("Register %x: %08x\n", i, readl(cafe->mmio + i)); |
262 | } | 259 | } |
263 | #endif | 260 | |
264 | cafe_writel(cafe, ctl1, NAND_CTRL1); | 261 | cafe_writel(cafe, ctl1, NAND_CTRL1); |
265 | /* Apply this short delay always to ensure that we do wait tWB in | 262 | /* Apply this short delay always to ensure that we do wait tWB in |
266 | * any case on any machine. */ | 263 | * any case on any machine. */ |
@@ -388,7 +385,10 @@ static int cafe_nand_read_page(struct mtd_info *mtd, struct nand_chip *chip, | |||
388 | } | 385 | } |
389 | 386 | ||
390 | if ((i = cafe_correct_ecc(buf, syn)) < 0) { | 387 | if ((i = cafe_correct_ecc(buf, syn)) < 0) { |
391 | dev_dbg(&cafe->pdev->dev, "Failed to correct ECC\n"); | 388 | dev_dbg(&cafe->pdev->dev, "Failed to correct ECC at %08x\n", |
389 | cafe_readl(cafe, NAND_ADDR2) * 2048); | ||
390 | for (i=0; i< 0x5c; i+=4) | ||
391 | printk("Register %x: %08x\n", i, readl(cafe->mmio + i)); | ||
392 | mtd->ecc_stats.failed++; | 392 | mtd->ecc_stats.failed++; |
393 | } else { | 393 | } else { |
394 | dev_dbg(&cafe->pdev->dev, "Corrected %d symbol errors\n", i); | 394 | dev_dbg(&cafe->pdev->dev, "Corrected %d symbol errors\n", i); |