mtd-utils: add support for 4k pages.
PATCH 1/1 mtd-utils: add support for 4k pages.
From: Thomas Gleixner <[email protected]>
Add support for 4K pages in nanddump & nandwrite.
Signed-off-by Thomas Gleixner <[email protected]>
Signed-off-by Sebastian Siewior <[email protected]>
---
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(-)
nanddump.c +4 -3
@@ -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 )) {
nandwrite.c +4 -3
@@ -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 );
Signature · 1 line
1.5.5.2
Artem Bityutskiy
AppliedHi,
Quoted 6 lines · Sebastian Siewior
From: Thomas Gleixner <[email protected]>
Add support for 4K pages in nanddump & nandwrite.
Signed-off-by Thomas Gleixner <[email protected]>Signed-off-by Sebastian Siewior <[email protected]>
I've applied it, thanks.
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)