@@ -174,8 +174,12 @@ static void process_options (int argc, char * const argv[])
/*
* Buffers for reading data from flash
*/
-static unsigned char readbuf[4096];
-static unsigned char oobbuf[128];
+
+#define NAND_MAX_PAGESIZE 4096
+#define NAND_MAX_OOBSIZE 256
+
+static unsigned char readbuf[NAND_MAX_PAGESIZE];
+static unsigned char oobbuf[NAND_MAX_OOBSIZE];
/*
* Main program
@@ -43,7 +43,7 @@
#define VERSION "$Revision: 1.32 $"
#define MAX_PAGE_SIZE 4096
-#define MAX_OOB_SIZE 128
+#define MAX_OOB_SIZE 256
// oob layouts to pass into the kernel as default
static struct nand_oobinfo none_oobinfo = {
@@ -302,7 +302,9 @@ int main(int argc, char * const argv[])
!(meminfo.oobsize == 8 && meminfo.writesize == 256) &&
!(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
!(meminfo.oobsize == 64 && meminfo.writesize == 4096) &&
- !(meminfo.oobsize == 128 && meminfo.writesize == 4096)) {
+ !(meminfo.oobsize == 128 && meminfo.writesize == 4096) &&
+ !(meminfo.oobsize == 218 && meminfo.writesize == 4096) &&
+ !(meminfo.oobsize == 224 && meminfo.writesize == 4096)) {
fprintf(stderr, "Unknown flash (not normal NAND)\n");
close(fd);
exit (EXIT_FAILURE);
Parts of this are a resubmission of this patch: http://lists.infradead.org/pipermail/linux-mtd/2010-May/029885.html This was tested with Samsung K9GAG08U0D. Signed-off-by: Brian Norris <norris@broadcom.com> --- nanddump.c | 8 ++++++-- nandwrite.c | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-)