[Yaffs] [PATCH] [YAFFS] YAFFS2: Add comments for maintaining…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Rick Bronson
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] [YAFFS] YAFFS2: Add comments for maintaining backward compatibility.

This is my first patch for yaffs2 so bear with me... sorry if I missed
something.

[PATCH] [YAFFS] YAFFS2: Add comments for maintaining backward compatibility.

[From: Rick Bronson <>]
[Acked-by: Realname <realmail>]
Signed-off-by: Realname <realmail>


diff -ruN yaffs2.orig/yaffs_mtdif1.c yaffs2/yaffs_mtdif1.c
--- yaffs2.orig/yaffs_mtdif1.c    2007-07-23 12:14:04.000000000 -0700
+++ yaffs2/yaffs_mtdif1.c    2007-09-06 11:26:13.000000000 -0700
@@ -45,7 +45,8 @@
 #endif


 #if 0
-/* Use the following nand_ecclayout with MTD when using
+/* Use the following nand ecclayout (replace the one in
+ * nand_base.c with this one) with MTD when using
  * CONFIG_YAFFS_9BYTE_TAGS and the older on-NAND tags layout.
  * If you have existing Yaffs images and the byte order differs from this,
  * adjust 'oobfree' to match your existing Yaffs data.
@@ -58,12 +59,24 @@
  * We have/need PackedTags1 plus pageStatus: T0,T1,T2,T3,T4,T5,T6,T7,P
  * where Tn are the tag bytes, En are MTD's ECC bytes, P is the pageStatus
  * byte and B is the small-page bad-block indicator byte.
+ *
+ * If you need to maintain different OOB layouts on jffs2 vs yaffs on the
+ * same NAND part then you will need to set chip->ecc.layout on entry to
+ * the following routines: nand_read, nand_read_oob, nand_write,
+ * nand_write_oob, nand_erase_nand, nand_block_markbad.  You also need
+ * to set parts->ecclayout for the separate partitions, probably in your
+ * NAND probe routine.
  */
 static struct nand_ecclayout nand_oob_16 = {
     .eccbytes = 6,
     .eccpos = { 8, 9, 10, 13, 14, 15 },
+#ifdef CONFIG_YAFFS_9BYTE_TAGS
     .oobavail = 9,
     .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
+#else
+    .oobavail = 8,
+    .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 } }
+#endif
 };
 #endif