public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* NAND and JFFS2 newbie question
@ 2009-01-27 16:56 Will Wagner
  2009-01-28 12:29 ` Nils Faerber
  0 siblings, 1 reply; 3+ messages in thread
From: Will Wagner @ 2009-01-27 16:56 UTC (permalink / raw)
  To: linux-mtd

Hi All,

I have an arm iMx31 board with 128M of NAND flash. It all appears to be working however I 
get a lot of error/warning messages and I'd just like to check I am doing things right.

The NAND chip is a ST NAND01G-B2B used in 8-bit mode which has 2048+64 byte pages and 128k 
block size. Linux is 2.6.24.7 with Freescale patches for MTD support on the iMx31 chip.

I am wanting to create a JFFS2 partition on the device. The partition is created using:

mkfs.jffs2 -s 2 -e 128 -c 12 -o fs.jffs2 -r jffs2_fs

Are these the correct arguments for the flash device I am using?

On the target I then do:
 > flash_eraseall /dev/mtd4
Erasing 128 Kibyte @ 5f60000 -- 99 % complete.
Skipping bad block at 0x05f80000

Skipping bad block at 0x05fa0000

Skipping bad block at 0x05fc0000

Skipping bad block at 0x05fe0000

 > nandwrite -p /dev/mtdblock4 fs.jffs2
Writing data to block 0

 > mount -t jffs2 /dev/mtdblock4 /flashfs
JFFS2 doesn't use OOB.
CLEANMARKER node found at 0x00000000 has totlen 0xc != normal 0x0
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x05fc0010: 0xffff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x05fe0010: 0xffff instead
# nand_erase: attempt to erase a bad block at page 0x0000ff80
Erase at 0x05fc0000 failed immediately: errno -5
nand_erase: attempt to erase a bad block at page 0x0000ffc0
Erase at 0x05fe0000 failed immediately: errno -5

Does this seem right? Why doesn't it use OOB and why is the cleanmarker wrong?

It all seems to be working but any advice on whether I am doing things write and if the 
output is all acceptable warnings would be much appreciated.

Thanks,

Will
-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------

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

* Re: NAND and JFFS2 newbie question
  2009-01-27 16:56 NAND and JFFS2 newbie question Will Wagner
@ 2009-01-28 12:29 ` Nils Faerber
  2009-01-28 13:19   ` Will Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Nils Faerber @ 2009-01-28 12:29 UTC (permalink / raw)
  To: Will Wagner; +Cc: linux-mtd

Will Wagner schrieb:
> Hi All,
> 
> I have an arm iMx31 board with 128M of NAND flash. It all appears to be working however I 
> get a lot of error/warning messages and I'd just like to check I am doing things right.
> 
> The NAND chip is a ST NAND01G-B2B used in 8-bit mode which has 2048+64 byte pages and 128k 
> block size. Linux is 2.6.24.7 with Freescale patches for MTD support on the iMx31 chip.
> 
> I am wanting to create a JFFS2 partition on the device. The partition is created using:
> 
> mkfs.jffs2 -s 2 -e 128 -c 12 -o fs.jffs2 -r jffs2_fs

I guess one of the problems will be that the sizes you specified are way
too small. Fomr the man-page of mkfs.jffs2:
"Options that take SIZE arguments can be specified as either decimal
(e.g., 65536), octal (0200000), or hexidecimal (0x1000)"

So for an eraseblocksize of 128kbytes you would specify "-e 131072".

Wrong settings can confuse jffs2 pretty easily.

> Thanks,
> Will
Cheers
  nils faerber

-- 
kernel concepts GbR        Tel: +49-271-771091-12
Sieghuetter Hauptweg 48    Fax: +49-271-771091-19
D-57072 Siegen             Mob: +49-176-21024535
http://www.kernelconcepts.de

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

* Re: NAND and JFFS2 newbie question
  2009-01-28 12:29 ` Nils Faerber
@ 2009-01-28 13:19   ` Will Wagner
  0 siblings, 0 replies; 3+ messages in thread
From: Will Wagner @ 2009-01-28 13:19 UTC (permalink / raw)
  To: Nils Faerber; +Cc: linux-mtd

Nils Faerber wrote:

>> I am wanting to create a JFFS2 partition on the device. The partition is created using:
>>
>> mkfs.jffs2 -s 2 -e 128 -c 12 -o fs.jffs2 -r jffs2_fs
> 
> I guess one of the problems will be that the sizes you specified are way
> too small. Fomr the man-page of mkfs.jffs2:
> "Options that take SIZE arguments can be specified as either decimal
> (e.g., 65536), octal (0200000), or hexidecimal (0x1000)"
> 

The man page seemed to imply that values under 4096 would be treated as KiB so -e 128 
should be correct. However the page size looks like it doesn't do that and so it should be 
set to 2048.

As an aside do I need to specify the -c option or is it not needed? If it is needed is 12 
the correct size for the clean marker?

Thanks,

Will

-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------

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

end of thread, other threads:[~2009-01-28 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27 16:56 NAND and JFFS2 newbie question Will Wagner
2009-01-28 12:29 ` Nils Faerber
2009-01-28 13:19   ` Will Wagner

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