mtd/drivers/mtd/nand diskonchip.c,1.1,1.2
David Woodhouse
dwmw2 at infradead.org
Wed Jul 9 07:23:47 EDT 2003
Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv16641
Modified Files:
diskonchip.c
Log Message:
Remove extra debugging
Index: diskonchip.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/diskonchip.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- diskonchip.c 3 Jul 2003 17:36:18 -0000 1.1
+++ diskonchip.c 9 Jul 2003 11:23:44 -0000 1.2
@@ -359,95 +359,6 @@
.owner = THIS_MODULE,
};
-void fish(struct erase_info *fish)
-{
-}
-void hexdump(u_char *buf, int len)
-{
- int i;
- for (i=0; i<len; i+=16)
- printk("%03x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
- buf[i], buf[i+1], buf[i+2], buf[i+3],
- buf[i+4], buf[i+5], buf[i+6], buf[i+7],
- buf[i+8], buf[i+9], buf[i+10], buf[i+11],
- buf[i+12], buf[i+13], buf[i+14], buf[i+15]);
-}
-
-void testdoc(struct mtd_info *mtd)
-{
- static char blkbuf[512];
- static char oobbuf[16];
- struct erase_info er = {
- .addr = 0,
- .len = mtd->erasesize,
- .callback = fish,
- };
- int ret, i;
- struct nand_chip *this = mtd->priv;
- size_t retlen;
-
- printk("Erase\n");
- ret = mtd->erase(mtd, &er);
- printk("Erase returned %d\n", ret);
- er.addr = 0x2000;
- ret = mtd->erase(mtd, &er);
- printk("Second Erase returned %d\n", ret);
-
- ret = mtd->read(mtd, 0, 512, &retlen, blkbuf);
- printk("Read from zero:\n");
- hexdump(blkbuf, 512);
-
- ret = mtd->read_oob(mtd, 0, 16, &retlen, oobbuf);
- printk("Read OOB\n");
- hexdump(oobbuf, 16);
-#if 1
-
-
- for (i=0; i<256; i++)
- blkbuf[i] = i;
- for (; i<512; i++)
- blkbuf[i] = 512-i;
-
- ret = mtd->write(mtd, 0, 512, &retlen, blkbuf);
- printk("Wrote, %d\n", ret);
-
- ret = mtd->read(mtd, 0, 512, &retlen, blkbuf);
- printk("Read from zero:\n");
- hexdump(blkbuf, 512);
-
- ret = mtd->read_oob(mtd, 0, 16, &retlen, oobbuf);
- printk("Read OOB\n");
- hexdump(oobbuf, 16);
-#endif
- this->hwcontrol(mtd, NAND_CTL_SETNCE);
- this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
- this->hwcontrol(mtd, NAND_CTL_CLRNCE);
- printk("Write OOB:\n");
- memset(oobbuf, 0x5a, 16);
- ret = mtd->write_oob(mtd, 1, 14, &retlen, oobbuf);
-
- printk("Wrote OOB, %d\n", ret);
- ret = mtd->read(mtd, 0, 512, &retlen, blkbuf);
- printk("Read from zero:\n");
- hexdump(blkbuf, 512);
-
- ret = mtd->read_oob(mtd, 0, 16, &retlen, oobbuf);
- printk("Read OOB\n");
- hexdump(oobbuf, 16);
-
- sprintf(blkbuf, "hello");
- printk("Write page 2\n");
- ret = mtd->write_oob(mtd, 0x2000, 5, &retlen, blkbuf);
- ret = mtd->read(mtd, 0x2000, 512, &retlen, blkbuf);
- printk("Read from 0x2000:\n");
- hexdump(blkbuf, 512);
-
- ret = mtd->read_oob(mtd, 0x2000, 16, &retlen, oobbuf);
- printk("Read OOB\n");
- hexdump(oobbuf, 16);
-
-}
-
int __init init_nanddoc(void)
{
mydoc.virtadr = (unsigned long)ioremap(mydoc.physadr, DOC_IOREMAP_LEN);
@@ -490,7 +401,6 @@
}
add_mtd_device(&mymtd);
- if (debug)testdoc(&mymtd);
return 0;
}
More information about the linux-mtd-cvs
mailing list