mtd/fs/jffs2 wbuf.c,1.33,1.34

David Woodhouse dwmw2 at infradead.org
Tue Jul 1 18:37:23 EDT 2003


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv11996

Modified Files:
	wbuf.c 
Log Message:
Add DiskOnChip ECC support.


Index: wbuf.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/wbuf.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- wbuf.c	1 Jul 2003 22:35:10 -0000	1.33
+++ wbuf.c	1 Jul 2003 22:37:20 -0000	1.34
@@ -757,6 +757,11 @@
 	eccpos: {JFFS2_OOB_ECCPOS0, JFFS2_OOB_ECCPOS1, JFFS2_OOB_ECCPOS2, JFFS2_OOB_ECCPOS3, JFFS2_OOB_ECCPOS4, JFFS2_OOB_ECCPOS5}
 };
 
+static struct nand_oobinfo jffs2_oobinfo_docecc = {
+	useecc: 1,
+	eccpos: {0,1,2,3,4,5}
+};
+
 
 
 int jffs2_nand_flash_setup(struct jffs2_sb_info *c)
@@ -776,8 +781,11 @@
 	c->wbuf_timer.function = jffs2_wbuf_timeout;
 	c->wbuf_timer.data = (unsigned long) c;
 
+	/* FIXME: If we had a generic way of describing the hardware's
+	   use of OOB area, we could perhaps make this generic too. */
 	switch(c->mtd->ecctype) {
 	case MTD_ECC_SW:
+		D1(printk(KERN_DEBUG "JFFS2 using software ECC\n"));
 		c->oobinfo = &jffs2_oobinfo_swecc;
 		if (c->mtd->oobsize == 8) {
 			c->fsdata_pos = NAND_JFFS2_OOB8_FSDAPOS;
@@ -787,6 +795,14 @@
 			c->fsdata_len = NAND_JFFS2_OOB16_FSDALEN;
 		}
 		c->badblock_pos = NAND_BADBLOCK_POS;
+		break;
+
+	case MTD_ECC_RS_DiskOnChip:
+		D1(printk(KERN_DEBUG "JFFS2 using DiskOnChip hardware ECC\n"));
+		c->oobinfo = &jffs2_oobinfo_docecc;
+		c->fsdata_pos = 6;
+		c->fsdata_len = NAND_JFFS2_OOB16_FSDALEN;
+		c->badblock_pos = 15;
 		break;
 
 	default:




More information about the linux-mtd-cvs mailing list