mkfs.jffs2
Andrew Victor
andrew at sanpeople.com
Mon Feb 21 10:21:19 EST 2005
hi,
> First of all thanx for the reply . I am using AT45DB642 NAND
> Flash and it seems to have erase block of 0x420 i,e 1056 bytes. and when
> i have created my MTD partitions i have specified the partition sizes to
> be multiple of these eraseblock sizes in
> drivers/at91/mtd/at91_dataflash.c , My 3 partitions are 4*1024*1056 (4
> GB) , 3*1024*1056 (3 GB) and 1*1024*1056 (1 GB)
Atmel AT45DB642 is DataFlash (not NAND).
mkfs.jffs2 is currently broken for DataFlash.
This is how I once fixed it. I don't know if the current mkfs.jffs2
code is different.....
In mkfs.jffs2.c in function main(). Comment out the code:
// /* If it's less than 4096, assume they meant KiB */
// if (erase_block_size && erase_block_size < 0x1000)
// erase_block_size *= 1024;
// /* If it's less than 8KiB, they're not allowed */
// if (erase_block_size < 0x2000) {
// fprintf(stderr, "Increasing erase size to 8KiB minimum\n");
// erase_block_size = 0x2000;
// }
Then run mkfs.jffs2 with the parameters "-e 2112 -n -l"
The 2112 is because JFFS2 merges multiple 528-byte or 1056-byte physical
blocks into larger virtual blocks.
The 2112 is for a 4Mb dataflash device, and that value will probably
differ for differently sized dataflash devices.
You should see the message:
JFFS2 write-buffering enabled (2112)
when you mount the JFFS2 partition. The size of brackets is the virtual
blocks size. You should also be using the code from the MTD/JFFS2 CVS.
Regards,
Andrew Victor
SAN People (Pty) Ltd.
More information about the linux-mtd
mailing list