From: Sebastian Siewior <bigeasy@linutronix.de>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>, linux-mtd@lists.infradead.org
Subject: [PATCH] mtd-utils: add support for 4k pages.
Date: Wed, 20 Aug 2008 12:32:14 +0200 [thread overview]
Message-ID: <20080820103214.GA21091@www.tglx.de> (raw)
From: Thomas Gleixner <tglx@linutronix.de>
Add support for 4K pages in nanddump & nandwrite.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
---
Original patch was done by tglx, I just made sure it still applies and
works on latest git.
nanddump.c | 7 ++++---
nandwrite.c | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/nanddump.c b/nanddump.c
index 9e10de4..be40287 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -159,8 +159,8 @@ void process_options (int argc, char *argv[])
/*
* Buffers for reading data from flash
*/
-unsigned char readbuf[2048];
-unsigned char oobbuf[64];
+unsigned char readbuf[4096];
+unsigned char oobbuf[128];
/*
* Main program
@@ -194,7 +194,8 @@ int main(int argc, char **argv)
}
/* Make sure device page sizes are valid */
- if (!(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
+ if (!(meminfo.oobsize == 128 && meminfo.writesize == 4096) &&
+ !(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
!(meminfo.oobsize == 32 && meminfo.writesize == 1024) &&
!(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
!(meminfo.oobsize == 8 && meminfo.writesize == 256)) {
diff --git a/nandwrite.c b/nandwrite.c
index a5462ae..e745fba 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -39,8 +39,8 @@
#define PROGRAM "nandwrite"
#define VERSION "$Revision: 1.32 $"
-#define MAX_PAGE_SIZE 2048
-#define MAX_OOB_SIZE 64
+#define MAX_PAGE_SIZE 4096
+#define MAX_OOB_SIZE 128
/*
* Buffer array used for writing data
@@ -248,7 +248,8 @@ int main(int argc, char **argv)
/* Make sure device page sizes are valid */
if (!(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
!(meminfo.oobsize == 8 && meminfo.writesize == 256) &&
- !(meminfo.oobsize == 64 && meminfo.writesize == 2048)) {
+ !(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
+ !(meminfo.oobsize == 128 && meminfo.writesize == 4096)) {
fprintf(stderr, "Unknown flash (not normal NAND)\n");
close(fd);
exit(1);
--
1.5.5.2
next reply other threads:[~2008-08-20 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-20 10:32 Sebastian Siewior [this message]
2008-08-21 7:22 ` [PATCH] mtd-utils: add support for 4k pages Artem Bityutskiy
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=20080820103214.GA21091@www.tglx.de \
--to=bigeasy@linutronix.de \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.