JFFS2 as rootfs on DataFlash
Ricard Wanderlof
ricard.wanderlof at axis.com
Fri Feb 22 07:15:26 EST 2008
On Thu, 21 Feb 2008, Mangesh Edake wrote:
> However I found that dataflash driver in u-boot
> doesnot deal with extra 16-bytes (oob) and doesnot
> write any JFFS2 specific magic bitmask, node crc,
> cleanmarker etc. info to the oob. But the nand flash
> (legacy) driver does the same in u-boot. Also
> kernel-mtd driver for at45 dataflash is missing with
> read_oob, write_oob functions whereas mtd-nand uses
> those routines. So my concern is, while copying the
> jffs2 image to dataflash is it necessory to write
> jffs2 specific info in oob region..? My assumption is,
> this info should be present in image itself and
> mkfs.jffs2 must take care of this while creating an
> image. (Please corret me if I'm wrong...)
The only JFFS2 data present in the OOB is the cleanmarker indicator for
blocks that are unused, i.e. where the data is =0xFF. For blocks that are
used, all JFFS2 info is in the ordinary data area.
Since the JFFS2 driver automagically writes cleanmarkers to unused blocks
when mounting (after erasing them first), it is not necessary to have
(oob) cleanmarkers in the filesystem image produced by mkfs.jffs2, and
indeed there is no option to do so IIRC.
The said, we've seen that the erase/cleamarker write during initial mount
of a JFFS2 filesystem consumes a lot of cpu time, and this can be
minimized by writing all the cleanmarkers before mounting. It is possible
that nandwrite -j would do this (we don't use nandwrite to write the
initial image in our products so I don't have any experience with this).
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
More information about the linux-mtd
mailing list