m25p80 and mkfs.jffs2

Jernej Turnsek jernej.turnsek at gmail.com
Wed Apr 21 02:49:21 EDT 2010


Hi,

I am developing the platform with i.MX25 CPU, 128MB of RAM and 8MB of
AT25DF641 Flash.
I would like to set the rootfs on 6MB jffs2 partition in Flash memory.
Rootfs was built with the
OpenEmbedded and the following settings:

EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x1000 -n \
    --pad ; sumtool --eraseblock=0x1000 -n \
    --littleendian --pad \
    -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
    -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2.summary"

The problem is the provided erase size of 4096 bytes, because the tool
mkfs.jffs2 automatically
increases erasesize to 8KiB. The driver M25P80 in the Linux kernel has
a lookup table where the
erase size for the AT25DF641 is set to 4KB:

{ "at25df641",  INFO(0x1f4800, 0, 64 * 1024, 128, SECT_4K) },

If I am not mistaken, the jffs2 fs takes the provided erase size from
the mtd, which is 4KB, but
mkfs.jffs2 packs the image with 8KB, thus after boot up I get errors
in the mounting process.

My options are to set 0 instead of SECT_4K and live with the default
64KB sectors, or patch the
driver to set the erasesize to 8KiB instead of 4KB.

I would prefer not to change anything in the m25p80 driver. Is there
another way to fix the problem?

Thanks,

Jernej



More information about the linux-mtd mailing list