[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] JFFS2 and MTD
Hi Robert,
Robert Swindells wrote:
> John Williams wrote:
>
>>Robert Swindells wrote:
>>
>>>>I haven't - I saw that the output of mkfs.jffs2 when run on an empty
>>>>directory was itself empty, so just figured I could mount straight on
>>>>top of an empty mtdblock device.
>>>
>>>Had you erased the area ?
>
>
>>Yes -
>>$ eraseall /dev/mtd6
>>$ mount -t jffs2 /dev/mtd6 /var
>
>
>>It is silent, no errors reported, but then the behaviour on trying to
>>create files etc.
>
>
> I would erase it before trying to boot if you can.
I've tried that - still the same.
>>should the jffs2 block size be related to some physical parameter of the
>>system? What is the importance?
>
>
> The JFFS2 block size is the flash block size. It needs to know this in
> order to do wear levelling and to garbage collect dirty blocks.
Ah ok well that is important - I'll check it out.
>>>>Is JFFS2 trying to mount some kind of default fdile system? This is all
>>>>happening before the shell starts, and before I can do any explicit
>>>>mount -t jffs2 commands.
>>>
>>>
>>>It isn't trying to mount anything at this stage, it will just format
>>>up any blocks that are not marked as being already used. This works
>>>best if the unused blocks are cleared.
>
>
>>Sure - but how does the jffs2 module initialisation know which of the
>>flash partitions are available for use? e.g. the mtd5 (image) segment
>>is not for jffs2, it is a raw kernel / filesys image. I don't want
>>jffs2 playing anywhere near it.
>
>
> Can you grab the boot messages just before setting up JFFS2 ?
Yes - it's attached. The message "magics are XXX, XXX" are some
debugging messages from my hacks on the ext2 driver.
>>Should I be writing a partition table somewhere?
>
> No, you only need one if you don't want to hard code partition sizes
> into the kernel.
Do you mean the MTD map, mbvanilla-flash.c??
I've noted that I am also having trouble with the ramfs driver - it
seems to start up properly but any writes to it fail with "no space on
device". I traced into the kernel to see that the inode associated with
the ramdisk block driver has a size of zero, so all writes fail. The
actual write_page() code in the driver never gets called.
I don't know why this is but am suspicious that it's related to the
failure on the mtdblock devices too. I can read and write quite happily
from the mtd char devices, but jffs2 (which should just *work*) is
unhappy on the mtdblock.
Need to look into it further tomorrow (today's a public holiday here).
Thanks,
John
Linux version 2.4.21-uc0 (jwilliam@g435-9029) (gcc version 2.95.3-4 Xilinx EDK 6.1 Build EDK_G.3) #1083 Tue Aug 12 12:44:13 EST 2003
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
CPU: MICROBLAZE
Console: xmbserial on UARTLite
Kernel command line:
Calibrating delay loop... 3.18 BogoMIPS
Memory: 14936K/16384K available (727K kernel code, 205K data)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Microblaze UARTlite serial driver version 1.00
ttyS0 at 0xffff2000 (irq = 1) is a Microblaze UARTlite
ttyS1 at 0xffff4000 (irq = 2) is a Microblaze UARTlite
Starting kswapd
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
MBVanilla flash probe(0xff000000,8388608,4): 800000 at ff000000
Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Creating 8 MTD partitions on "Flash":
0x00000000-0x00020000 : "Bootloader"
0x00020000-0x00040000 : "Bootargs"
0x00040000-0x00060000 : "MAC"
0x00080000-0x00100000 : "Config"
0x00060000-0x00080000 : "Spare"
0x00100000-0x00300000 : "Image"
0x00300000-0x00800000 : "JFFS2"
0x00000000-0x00800000 : "Flash"
MBVanilla ram probe(0x800ea698,344064,4): 54000 at 800ea698
Creating 1 MTD partitions on "RAM":
0x00000000-0x00054000 : "Romfs"
blk: queue 800dddc0, I/O limit 0Mb (mask 0x0)
magics are 90A5, a590
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x2d72 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x3166 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x0005 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x72e0 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x524f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x6973 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000002c: 0xd1ff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000030: 0x2e00 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000004c: 0xd1d1 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000050: 0x2e2e 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 0x00001000: 0xeac1 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00001004: 0xc9e0 instead
[snip]
jffs2_scan_empty(): Empty block at 0x000530a8 ends at 0x00053134 (with 0xff000012)! Marking dirty
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00053134: 0xff00 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00053138: 0x2200 instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00053000 is not formatted. It will be erased
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
VFS: Mounted root (romfs filesystem) readonly.
Freeing unused kernel memory: 36K freed
Sash command shell (version 1.1.1)
/>