public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Fwd: Re: JFFS2 NAND support - Mount failure on "good" filesystem
@ 2004-02-08 22:22 Joshua Wise
  2004-02-09  7:07 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Wise @ 2004-02-08 22:22 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: Text/Plain, Size: 1822 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<tglx1> joshua_: send a patch to the maillist :)

He asked, so I forwarded his patch.

(this patch adds support for chips that need to be sent a command for each 
page of OOB data requested.)

joshua

- ----------  Forwarded Message  ----------

Subject: Re: JFFS2 NAND support - Mount failure on "good" filesystem
Date: Sunday 08 February 2004 4:51 pm
From: Thomas Gleixner <tglx@linutronix.de>
To: Joshua Wise <joshua@joshuawise.com>

On Sunday 08 February 2004 20:38, you wrote:
> On Sunday 08 February 2004 3:58 am, Thomas Gleixner wrote:
> > Seems like you managed to corrupt the OOB area, as all your blocks are
> > marked as bad. Your programming algorithm has to take care of the OOB
> > data ! There are some slightly outdated docs on linux-mtd.infradead.org
>
> My programming algorithm is exactly the same as nandwrite's. I believe that
> the issue is not in JFFS2, but in the NAND driver - do we not need multiple
> pages of OOB data, and does the NAND driver not expect the chip to
> automatically "move on"? My chip seems to be the only NAND chip that does
> not automagically move on to the next page of OOB data...
>
> jwise

- --
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx@linutronix.de

- -------------------------------------------------------



- -- 
Joshua Wise | www.joshuawise.com
GPG Key     | 0xEA80E0B3
Quote       | <RockShox> charge up a 50v 1000uf cap and toss it to someone
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAJrabPn9tWOqA4LMRAgygAKCXyWYBZArBcYyjI2keO8lTCBTvjACgh55h
uLSBge7FMMISVQiVIeAnheI=
=wwFk
-----END PGP SIGNATURE-----

[-- Attachment #2: nand.diff --]
[-- Type: text/x-diff, Size: 1175 bytes --]

--- nand.old.c	2004-02-08 22:46:04.000000000 +0100
+++ nand.c	2004-02-08 22:51:14.000000000 +0100
@@ -641,7 +641,7 @@
 	while (read < len) {
 		
 		/* If we have consequent page reads, apply delay or wait for ready/busy pin */
-		if (read) {
+		if (read && !this->noautoincr) {
 			if (!this->dev_ready) 
 				udelay (this->chip_delay);
 			else
@@ -752,6 +752,11 @@
 		col = 0;
 		/* Increment page address */
 		page++;
+		/* If the chip does not support auto page increment
+		   send new command
+		*/
+		if (this->noautoincr && read < len)
+			this->cmdfunc (mtd, NAND_CMD_READ0, 0x00, page);
 	}
 
 	/* De-select the NAND device */
@@ -820,8 +825,16 @@
 		this->read_buf(mtd, &buf[i], thislen);
 		i += thislen;
 		col += thislen;
-		/* Delay between pages */
-		udelay (this->chip_delay);
+		/* Check, if the chip supports autoincrement */
+		if (this->noautoincr && i < len) {
+		        this->cmdfunc (mtd, NAND_CMD_READOOB, col, ++page);
+		} else {
+			/* Delay between pages */
+			if (!this->dev_ready) 
+				udelay (this->chip_delay);
+			else
+				while (!this->dev_ready(mtd));        
+		}
 	}
 	/* De-select the NAND device */
 	this->select_chip(mtd, -1);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-09  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-08 22:22 Fwd: Re: JFFS2 NAND support - Mount failure on "good" filesystem Joshua Wise
2004-02-09  7:07 ` Thomas Gleixner
2004-02-09  8:20   ` "David Müller (ELSOFT AG)"
2004-02-09  8:42     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox