public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Re: Writing JFFS2 image to Nand flash
@ 2002-04-15 13:42 John Hall
  2002-04-15 14:06 ` Elizabeth Clarke
  2002-04-15 14:18 ` Tino Keitel
  0 siblings, 2 replies; 12+ messages in thread
From: John Hall @ 2002-04-15 13:42 UTC (permalink / raw)
  To: Linux MTD list (E-mail)

> > This image should then be written to the device with cp or dd.
> > However, if I have bad blocks on the device then dd fails.
> 
> Not sure about dd, I've just been using cp. But the main issue...

Even with the correct branch of JFFS2, I think this problem will still
exist. Using cp or dd to write the initial filesystem image takes no
account of bad blocks near the beginning of the NAND flash.

> > I'm not using the jffs2_nand_branch - I had not realised there was
> > one.
> 
> ...is that. Get that branch and it should work. At least, it works
> here :)

OK, I've got the jffs2-nand-branch of fs/jffs2/* and
include/linux/jffs2*. I found that this branch doesn't use the shared
zlib, so I've worked around that. However, I still get these errors
when compiling the kernel:

fs/fs.o: In function `jffs2_check_nand_cleanmarker':
fs/fs.o(.text+0x6040c): undefined reference to `jffs2_flash_read_oob'
fs/fs.o: In function `jffs2_write_nand_cleanmarker':
fs/fs.o(.text+0x60520): undefined reference to `jffs2_flash_write_oob'

Where are these two functions defined?

Regards,
John Hall

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Writing JFFS2 image to Nand flash
@ 2002-04-15 14:37 John Hall
  2002-04-15 15:18 ` Elizabeth Clarke
  0 siblings, 1 reply; 12+ messages in thread
From: John Hall @ 2002-04-15 14:37 UTC (permalink / raw)
  To: Elizabeth Clarke; +Cc: Linux MTD list (E-mail)

On 15 April 2002 15:06 Elizabeth Clarke <eclarke@aminocom.com> wrote:

> > fs/fs.o: In function `jffs2_check_nand_cleanmarker':
> > fs/fs.o(.text+0x6040c): undefined reference to
> > `jffs2_flash_read_oob'
> > fs/fs.o: In function `jffs2_write_nand_cleanmarker':
> > fs/fs.o(.text+0x60520): undefined reference to 
> > `jffs2_flash_write_oob'
> > Where are these two functions defined?
> 
> You should find a grep has them in wbuf.c. Are you setting
> CONFIG_JFFS2_FS_NAND?

Yes, CONFIG_JFFS2_FS_NAND is set. wbuf.c doesn't contain these
functions. I had grepped fs/jffs2/*.[ch] for them.

This is the version of wbuf.c that I have:

[john@morgan jffs2]$ cvs stat wbuf.c
===================================================================
File: wbuf.c            Status: Up-to-date

   Working revision:    1.1.2.2
   Repository revision: 1.1.2.2 /home/cvs/mtd/fs/jffs2/wbuf.c,v
   Sticky Tag:          jffs2-nand-branch (branch: 1.1.2)
   Sticky Date:         (none)
   Sticky Options:      (none)


Regards,
John Hall

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: Writing JFFS2 image to Nand flash
@ 2002-04-15 14:23 John Hall
  0 siblings, 0 replies; 12+ messages in thread
From: John Hall @ 2002-04-15 14:23 UTC (permalink / raw)
  To: Tino Keitel; +Cc: Linux MTD list (E-mail)

On 15 April 2002 14:51 Tino Keitel <tino.keitel@innominate.com> wrote:

> > > > This image should then be written to the device with cp or dd.
> > > > However, if I have bad blocks on the device then dd fails.
> > > 
> > > Not sure about dd, I've just been using cp. But the main issue...
> > 
> > Even with the correct branch of JFFS2, I think this problem will
> > still exist. Using cp or dd to write the initial filesystem image
> > takes no account of bad blocks near the beginning of the NAND flash.
> 
> What about the seek option of dd?

That's is how I have got around it, but it involves knowing where the
bad blocks are. What if the first and third blocks are bad? I think a
utility is needed that recognises bad blocks and skips them when writing
a filesystem image to a blank device.

Regards,
John Hall

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
@ 2002-04-12 13:09 John Hall
  2002-04-12 13:20 ` Elizabeth Clarke
  0 siblings, 1 reply; 12+ messages in thread
From: John Hall @ 2002-04-12 13:09 UTC (permalink / raw)
  To: Linux MTD list (E-mail); +Cc: eclarke

Elizabeth Clarke <eclarke@aminocom.com> wrote:
> > I'm having problems writing a JFFS2 image to a Nand flash device
> > whose first block is bad. cp and dd fail in this case. Do I need to
> > write a utility that checks for bad blocks and skips them, or am I
> > missing something?
> 
> What messages is it giving? debug enabled? are you using the JFFS2
> code from the jffs2_nand_branch code from cvs?

>From my understanding, mkfs.jffs2 creates a JFFS2 image without any
reference to the device that is being targeted (with the possible
exception of specifying an erase size if the erase size is bigger than
64K). This image should then be written to the device with cp or dd.
However, if I have bad blocks on the device then dd fails.

This is an example of the erase finding that the first block is bad:

	root@board:/tmp# eraseall /dev/mtd/0
	Erasing nand_erase: attempt to erase a bad block at page
0x00000000
	8 Kibyte @ 0 --  0 % complete.
	eraseall: /dev/mtd/0: MTD Erase failure: Input/output error
	Erased 8192 Kibyte @ 0 -- 100% complete.

Then create a jffs2 image:

	root@board:/tmp# mkfs.jffs2 -d /tmp/files -o /tmp/img

Then write it:

	root@board:/tmp# dd if=/tmp/img of=/dev/mtd/0
	dd: writing `/dev/mtd/0': Input/output error
	0+1 records in
	0+0 records out


I'm not using the jffs2_nand_branch - I had not realised there was one.
I have the latest CVS code from the trunk. What changes are there to
support nand flash - is it just limiting the number of writes to a page,
or are there other things?
I will switch to the nand branch and try that.

Regards, 
John Hall

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Writing JFFS2 image to Nand flash
@ 2002-04-12 10:02 John Hall
  2002-04-12 12:47 ` Elizabeth Clarke
  0 siblings, 1 reply; 12+ messages in thread
From: John Hall @ 2002-04-12 10:02 UTC (permalink / raw)
  To: Linux MTD list (E-mail)

Hi,

I'm having problems writing a JFFS2 image to a Nand flash device whose
first block is bad. cp and dd fail in this case. Do I need to write a
utility that checks for bad blocks and skips them, or am I missing
something?

Regards,
John Hall

-- 
OptionExist Limited.
The Irwin Centre, Scotland Road, Dry Drayton, Cambridge.
Tel: +44 (0)1954 211244, Fax: +44 (0)1954 211565
http://www.optionexist.co.uk/

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

end of thread, other threads:[~2002-04-15 16:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-15 13:42 Writing JFFS2 image to Nand flash John Hall
2002-04-15 14:06 ` Elizabeth Clarke
2002-04-15 14:18 ` Tino Keitel
  -- strict thread matches above, loose matches on Subject: below --
2002-04-15 14:37 John Hall
2002-04-15 15:18 ` Elizabeth Clarke
2002-04-15 16:02   ` David Woodhouse
2002-04-15 16:05     ` Elizabeth Clarke
2002-04-15 14:23 John Hall
2002-04-12 13:09 John Hall
2002-04-12 13:20 ` Elizabeth Clarke
2002-04-12 10:02 John Hall
2002-04-12 12:47 ` Elizabeth Clarke

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