Skip to content

Commit 440b1d7

Browse files
mike-dunndedekind
authored andcommitted
mtd: nand/docg4: reserve bb marker area in ecclayout
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> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent 5a90d41 commit 440b1d7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/mtd/nand/docg4.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,17 @@ struct docg4_priv {
214214
#define DOCG4_FACTORY_BBT_PAGE 16 /* page where read-only factory bbt lives */
215215

216216
/*
217-
* Oob bytes 0 - 6 are available to the user.
218-
* Byte 7 is hamming ecc for first 7 bytes. Bytes 8 - 14 are hw-generated ecc.
217+
* Bytes 0, 1 are used as badblock marker.
218+
* Bytes 2 - 6 are available to the user.
219+
* Byte 7 is hamming ecc for first 7 oob bytes only.
220+
* Bytes 8 - 14 are hw-generated ecc covering entire page + oob bytes 0 - 14.
219221
* Byte 15 (the last) is used by the driver as a "page written" flag.
220222
*/
221223
static struct nand_ecclayout docg4_oobinfo = {
222224
.eccbytes = 9,
223225
.eccpos = {7, 8, 9, 10, 11, 12, 13, 14, 15},
224-
.oobavail = 7,
225-
.oobfree = { {0, 7} }
226+
.oobavail = 5,
227+
.oobfree = { {.offset = 2, .length = 5} }
226228
};
227229

228230
/*

0 commit comments

Comments
 (0)