Patchwork [2/3] mtd: nand/docg4: reserve bb marker area in ecclayout

login
register
mail settings
Submitter Mike Dunn
Date Dec. 7, 2012, 8:07 p.m.
Message ID <1354910843-5598-3-git-send-email-mikedunn@newsguy.com>
Download mbox | patch
Permalink /patch/204604/
State Accepted
Commit 440b1d73b1b49bc08e1709ee6f6ef7ba2fc1f8ba
Headers show

Comments

Mike Dunn - Dec. 7, 2012, 8:07 p.m.
Modify the nand_ecclayout to place the two bb marker bytes in the oob region
off-limits to the user. 

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
 drivers/mtd/nand/docg4.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
index 54b1e5e..04e5fa9 100644
--- a/drivers/mtd/nand/docg4.c
+++ b/drivers/mtd/nand/docg4.c
@@ -214,15 +214,17 @@  struct docg4_priv {
 #define DOCG4_FACTORY_BBT_PAGE 16 /* page where read-only factory bbt lives */
 
 /*
- * Oob bytes 0 - 6 are available to the user.
- * Byte 7 is hamming ecc for first 7 bytes.  Bytes 8 - 14 are hw-generated ecc.
+ * Bytes 0, 1 are used as badblock marker.
+ * Bytes 2 - 6 are available to the user.
+ * Byte 7 is hamming ecc for first 7 oob bytes only.
+ * Bytes 8 - 14 are hw-generated ecc covering entire page + oob bytes 0 - 14.
  * Byte 15 (the last) is used by the driver as a "page written" flag.
  */
 static struct nand_ecclayout docg4_oobinfo = {
 	.eccbytes = 9,
 	.eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
-	.oobavail = 7,
-	.oobfree = { {0, 7} }
+	.oobavail = 5,
+	.oobfree = { {.offset = 2, .length = 5} }
 };
 
 /*