Patchwork nandlogical: corect oobblock/writesize patch

login
register
mail settings
Submitter lumag
Date Sept. 5, 2011, 12:05 a.m.
Message ID <1315181107-26857-1-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/10983/
State New, archived
Headers show

Comments

lumag - Sept. 5, 2011, 12:05 a.m.
Somehow the oobblock-to-writesize.patch patch got damaged. Correct it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 .../nandlogical/oobblock-to-writesize.patch        |   74 +++++++++++++-------
 1 files changed, 48 insertions(+), 26 deletions(-)
Paul Eggleton - Sept. 5, 2011, 12:22 a.m.
On Monday 05 September 2011 01:05:07 Dmitry Eremin-Solenikov wrote:
> Somehow the oobblock-to-writesize.patch patch got damaged. Correct it.

I guess this is for meta-handheld?

Cheers,
Paul
lumag - Sept. 5, 2011, 8:49 p.m.
On 9/5/11, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> On Monday 05 September 2011 01:05:07 Dmitry Eremin-Solenikov wrote:
>> Somehow the oobblock-to-writesize.patch patch got damaged. Correct it.
>
> I guess this is for meta-handheld?

Yes.

>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre
>
Paul Eggleton - Sept. 5, 2011, 11:39 p.m.
On Monday 05 September 2011 21:49:47 Dmitry Eremin-Solenikov wrote:
> On 9/5/11, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> > On Monday 05 September 2011 01:05:07 Dmitry Eremin-Solenikov wrote:
> >> Somehow the oobblock-to-writesize.patch patch got damaged. Correct it.
> > 
> > I guess this is for meta-handheld?
> 
> Yes.

Merged to meta-handheld, thanks.

Cheers,
Paul

Patch

diff --git a/recipes-bsp/zaurus-utils/nandlogical/oobblock-to-writesize.patch b/recipes-bsp/zaurus-utils/nandlogical/oobblock-to-writesize.patch
index 23d011e..2d5aba8 100644
--- a/recipes-bsp/zaurus-utils/nandlogical/oobblock-to-writesize.patch
+++ b/recipes-bsp/zaurus-utils/nandlogical/oobblock-to-writesize.patch
@@ -6,29 +6,51 @@  Fix build against 2.6.24 kernel.
 Signed off by Stanislav Brabec <utx@penguin.cz>
 Signed off by Andrea Adami <andrea.adami@gmail.com>
 
---- a/nandlogical.c	2006-06-09 17:06:48.000000000 +0200
-+++ b/nandlogical.c	2011-08-05 11:17:28.000000000 +0200
-138c138
-< 	//ret = nand_read_raw(nand, oobuf, offset, nand->oobblock, nand->oobsize);
----
-> 	//ret = nand_read_raw(nand, oobuf, offset, nand->writesize, nand->oobsize);
-279,281c279,281
-< 	if (!(meminfo.oobsize == 64 && meminfo.oobblock == 2048) &&
-< 	    !(meminfo.oobsize == 16 && meminfo.oobblock == 512) &&
-< 	    !(meminfo.oobsize == 8 && meminfo.oobblock == 256)) {
----
-> 	if (!(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
-> 	    !(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
-> 	    !(meminfo.oobsize == 8 && meminfo.writesize == 256)) {
-287c287
-< 	//printf("erasesize %x\noobblock %x\noobsize %x\nsize %x\n", meminfo.erasesize, meminfo.oobblock, meminfo.oobsize, meminfo.size);
----
-> 	//printf("erasesize %x\nwritesize %x\noobsize %x\nsize %x\n", meminfo.erasesize, meminfo.writesize, meminfo.oobsize, meminfo.size);
-292c292
-< 	oobbuf = (char *)malloc(meminfo.oobblock);
----
-> 	oobbuf = (char *)malloc(meminfo.writesize);
-300c300
-< 	bs = meminfo.oobblock;
----
-> 	bs = meminfo.writesize;
+Index: survive-1.1.0/nandlogical.c
+===================================================================
+--- survive-1.1.0.orig/nandlogical.c	2006-06-09 19:06:48.000000000 +0400
++++ survive-1.1.0/nandlogical.c	2011-09-05 04:00:37.000000000 +0400
+@@ -135,7 +135,7 @@
+ 	oob.start = offset;
+ 	ret = ioctl(fd, MEMREADOOB, &oob);
+ 
+-	//ret = nand_read_raw(nand, oobuf, offset, nand->oobblock, nand->oobsize);
++	//ret = nand_read_raw(nand, oobuf, offset, nand->writesize, nand->oobsize);
+ 	if (!ret) {
+     	    int log_no = nand_get_logical_no(oobbuf);
+ 	    if (((int)log_no >= 0) && (log_no < blocks)) {
+@@ -276,20 +276,20 @@
+ 	}
+ 
+ 	/* Make sure device page sizes are valid */
+-	if (!(meminfo.oobsize == 64 && meminfo.oobblock == 2048) &&
+-	    !(meminfo.oobsize == 16 && meminfo.oobblock == 512) &&
+-	    !(meminfo.oobsize == 8 && meminfo.oobblock == 256)) {
++	if (!(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
++	    !(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
++	    !(meminfo.oobsize == 8 && meminfo.writesize == 256)) {
+ 	    fprintf(stderr, "Unknown flash (not normal NAND)\n");
+ 	    close(fd);
+ 	    exit(1);
+ 	}
+ 
+-	//printf("erasesize %x\noobblock %x\noobsize %x\nsize %x\n", meminfo.erasesize, meminfo.oobblock, meminfo.oobsize, meminfo.size);
++	//printf("erasesize %x\nwritesize %x\noobsize %x\nsize %x\n", meminfo.erasesize, meminfo.writesize, meminfo.oobsize, meminfo.size);
+ 	
+ 	blocks = NAND_LOGICAL_SIZE / meminfo.erasesize;
+ 	log2phy = (unsigned long *) malloc(blocks * sizeof(unsigned long));
+ 	readbuf = (char *)malloc(meminfo.erasesize);
+-	oobbuf = (char *)malloc(meminfo.oobblock);	
++	oobbuf = (char *)malloc(meminfo.writesize);
+ 	oob.ptr = oobbuf;
+ 
+ 	scan_logical(blocks, meminfo.erasesize);
+@@ -297,7 +297,7 @@
+ 	//printf("Start: %x\nEnd: %x\n", start_addr, length);
+ 	
+ 	end_addr = start_addr + length;
+-	bs = meminfo.oobblock;
++	bs = meminfo.writesize;
+ 
+ 	for (ofs = start_addr; ofs < end_addr ; ofs+=bs) {
+ 	    int new_logical_added = 0;