[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 again,
John Williams wrote to microblaze-uclinux@xxxxxxxxxxxxxx:
> MTD provides block and character device interfaces to the partitions -
> mtdblockN is the block interface, mtdN is the char interface
> You can only mount on block devices, not char. You probably want
> mount -t jffs2 /dev/mtdblock0 /mnt
> Again, fdisk works on block devices, not char.
> fdisk doesn't really make sense if you are using MTD partitions - just
> put the jffs2 filesystem on an MTD partition directly, don't
> bother with
> fdisk.
This explains a lot to me, this is an important puzzle piece.
Now I'm a big step further and have done this:
----------------
The boot logging is:
...
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications
AB.
...
physmap flash device: 400000 at fec00000
Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
physmap: no partition info available, registering whole flash (Physically
mapped flash) at once
uclinux[mtd]: RAM probe address=0x800c5e2c size=0x58000
uclinux[mtd]: root filesystem index=2
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 36K
Shell invoked to run file: /etc/rc
Command: mount -t proc proc /proc
Command: mount -t ramfs none /var
init: Failed to open /etc/inittab.
Sash command shell (version 1.1.1)
/>
-----------------
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:
#
# Mapping drivers for chip access
#
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=fec00000
CONFIG_MTD_PHYSMAP_LEN=400000
CONFIG_MTD_PHYSMAP_BUSWIDTH=2
...
# CONFIG_MTD_MBVANILLA is not set
# CONFIG_MTD_MB_AUTO is not set
...
# CONFIG_MTD_SUZAKU is not set
...
CONFIG_MTD_UCLINUX=y
...
-----------------
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
but it seems it doesn't work and the output is just:
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:
0xe001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004:
0x002d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008:
0x8112 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c:
0x0001 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014:
0x0002 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018:
0x0048 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020:
0xe687 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024:
0x7a45 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028:
0x7374 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000002c:
0xffff instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400000:
0xff01 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400008:
0xfc04 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0040000c:
0x110d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400010:
0x9420 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400014:
0xa421 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400018:
0x9401 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0040001c:
0xb000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400020:
0x31a0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400024:
0xb000 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00400028:
0x3040 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00400000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00410000:
0xf816 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00410004:
0xf896 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00410008:
0xf876 instead
...
8<
...
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00630020:
0x1a3e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00630024:
0xd1f8 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00630000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640000:
0xef47 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640004:
0xbc31 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640008:
0xf27e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0064000c:
0xda7f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640010:
0xd454 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640014:
0xa6a8 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640018:
0x257e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0064001c:
0xc14b instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640020:
0xf998 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00640024:
0x37c2 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00640000 is not formatted. It will be erased
JFFS2: Erase block at 0x00800000 is not formatted. It will be erased
JFFS2: Erase block at 0x00810000 is not formatted. It will be erased
...
8<
...
JFFS2: Erase block at 0x00fc0000 is not formatted. It will be erased
JFFS2: Erase block at 0x00fd0000 is not formatted. It will be erased
JFFS2: Erase block at 0x00fe0000 is not formatted. It will be erased
JFFS2: Erase block at 0x00ff0000 is not formatted. It will be erased
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
mount: Mounting /dev/mtdblock0 on /var/j failed: Invalid argument
pid 24: failed 256
/var>
What could be wrong here?
TIA + Cheers,
F@lk
___________________________
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/