From: Wolfgang Grandegger <wg@grandegger.com>
To: linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>,
Wolfgang Grandegger <wg@grandegger.com>,
Ilya Yanok <yanok@emcraft.com>
Subject: [PATCH 1/2] NAND: Add support for oob size 128
Date: Wed, 25 Mar 2009 11:48:37 +0100 [thread overview]
Message-ID: <20090325105020.607040279@denx.de> (raw)
In-Reply-To: 20090325104836.325599143@denx.de
[-- Attachment #1: 0005-NAND-support-for-oob-size-128.patch --]
[-- Type: text/plain, Size: 1788 bytes --]
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/mtd/nand/nand_base.c | 17 +++++++++++++++++
include/linux/mtd/nand.h | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
Index: linux-2.6/drivers/mtd/nand/nand_base.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nand/nand_base.c
+++ linux-2.6/drivers/mtd/nand/nand_base.c
@@ -82,6 +82,20 @@ static struct nand_ecclayout nand_oob_64
.length = 38}}
};
+static struct nand_ecclayout nand_oob_128 = {
+ .eccbytes = 48,
+ .eccpos = {
+ 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111,
+ 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 127},
+ .oobfree = {
+ {.offset = 2,
+ .length = 78}}
+};
+
static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd,
int new_state);
@@ -2555,6 +2569,9 @@ int nand_scan_tail(struct mtd_info *mtd)
case 64:
chip->ecc.layout = &nand_oob_64;
break;
+ case 128:
+ chip->ecc.layout = &nand_oob_128;
+ break;
default:
printk(KERN_WARNING "No oob scheme defined for "
"oobsize %d\n", mtd->oobsize);
Index: linux-2.6/include/linux/mtd/nand.h
===================================================================
--- linux-2.6.orig/include/linux/mtd/nand.h
+++ linux-2.6/include/linux/mtd/nand.h
@@ -43,7 +43,7 @@ extern void nand_wait_ready(struct mtd_i
* is supported now. If you add a chip with bigger oobsize/page
* adjust this accordingly.
*/
-#define NAND_MAX_OOBSIZE 64
+#define NAND_MAX_OOBSIZE 128
#define NAND_MAX_PAGESIZE 2048
/*
next prev parent reply other threads:[~2009-03-25 10:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-25 10:48 [PATCH 0/2] Add support for NAND on the socrates board and oob size 128 Wolfgang Grandegger
2009-03-25 10:48 ` Wolfgang Grandegger [this message]
2009-03-25 15:05 ` [PATCH 1/2] NAND: Add support for " Sebastian Andrzej Siewior
2009-03-30 10:57 ` Wolfgang Grandegger
2009-03-25 10:48 ` [PATCH 2/2] NAND: Add support for NAND on the Socrates board Wolfgang Grandegger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090325105020.607040279@denx.de \
--to=wg@grandegger.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=yanok@emcraft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox