aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/docg3.c
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2011-11-19 10:02:49 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:07:19 -0500
commit732b63bd8c70bf8fbc50d3d3cd56c748edb8cfac (patch)
tree9885b9a2fef7cf78ddd9c563f181739d42334b43 /drivers/mtd/devices/docg3.c
parentae9d4934b2d76a9fba21f5ad3692378d0e7fc24b (diff)
mtd: docg3: add OOB layout to mtdinfo
Add OOB layout description for docg3, so that userspace can use this information to setup the data for write_oob(). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices/docg3.c')
-rw-r--r--drivers/mtd/devices/docg3.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 6eca7f6c072c..27c4feae132f 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -63,6 +63,20 @@
63 * 63 *
64 */ 64 */
65 65
66/**
67 * struct docg3_oobinfo - DiskOnChip G3 OOB layout
68 * @eccbytes: 8 bytes are used (1 for Hamming ECC, 7 for BCH ECC)
69 * @eccpos: ecc positions (byte 7 is Hamming ECC, byte 8-14 are BCH ECC)
70 * @oobfree: free pageinfo bytes (byte 0 until byte 6, byte 15
71 * @oobavail: 8 available bytes remaining after ECC toll
72 */
73static struct nand_ecclayout docg3_oobinfo = {
74 .eccbytes = 8,
75 .eccpos = {7, 8, 9, 10, 11, 12, 13, 14},
76 .oobfree = {{0, 7}, {15, 1} },
77 .oobavail = 8,
78};
79
66static inline u8 doc_readb(struct docg3 *docg3, u16 reg) 80static inline u8 doc_readb(struct docg3 *docg3, u16 reg)
67{ 81{
68 u8 val = readb(docg3->base + reg); 82 u8 val = readb(docg3->base + reg);
@@ -973,6 +987,7 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
973 mtd->write_oob = NULL; 987 mtd->write_oob = NULL;
974 mtd->sync = NULL; 988 mtd->sync = NULL;
975 mtd->block_isbad = doc_block_isbad; 989 mtd->block_isbad = doc_block_isbad;
990 mtd->ecclayout = &docg3_oobinfo;
976} 991}
977 992
978/** 993/**