[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] how to mount flash via jffs2 as dir /mnt ?



Hi Falk,

Brettschneider Falk wrote:


> mtd0 is the flash, mtd2 is the root filesystem (romfs). mtd0 is the same as
> mtd1 due doubled registration (likely a bug?) in mtd/maps/physmap.c line 145
> and 181, but it actually doesn't matter to the system and can be ignored:
>   /> cat /proc/mtd
>   dev:    size   erasesize  name
>   mtd0: 01000000 00010000 "Physically mapped flash"
>   mtd1: 01000000 00010000 "Physically mapped flash"
>   mtd2: 00058000 00001000 "RAM"
> 
> BTW: Why is its shown size 0x1000000 (=16MB)? My .config defines:

Not sure here, I haven't used the physical mappings before.  MTD
partitions are pretty simple, you could take an example from
drivers/mtd/maps/mb_auto.c

> Now I've tried to format the flash (using /var since it's writeable here):
>   /> cd var
>   /var> mkdir j
>   /var> mkfs.jffs2 -d j -o j.img
>   /var> erase /dev/mtd0
>   Erase Total 1 Units
>   Performing Flash Erase of length 65536 at offset 0x0 done
>   /var> cp j.img /dev/mtd0
>   /var> mount -t jffs2 /dev/mtdblock0 /var/j

you should use "eraseall /dev/mtd0" - to erase the entire partition.
erase just erases a single write block.

I wouldn't bother with mkfs.jffs2 at all.  Just erase the entire flash
partition (use eraseall /dev/mtd0), then mount it as a jffs2.  The jffs2
layer will recognise it as "clean" flash, and format it automatically
(and much more quietly!).

Cheers,

John


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/