Skip to contentSkip to conversation

problems mounting >3.3MB JFFS2 partitions on Dataflash on AT91RM9200DK

DISCUSSION Aras Vaichas 3 participants 6 messages Jul 20, 2004 – Jul 21, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I can't seem to mount a partition greater than about 3.3MB. All partitions below this size *seem* to work fine.

a partition of this size will mount:
hex: 0x34c980, decimal: 3459456, erase blocks: 3276

a partition greater than or equal to this size will NOT mount:
hex: 0x34cda0, decimal: 3460512, erase blocks: 3277

I am running Linux-2.4.6-VRS-1 on the AT91RM9200DK development board. I have tried using command line partitions and setting at91_dataflash.c, it makes no difference.

My kernel command line is:

root=/dev/ram=rx initrd=0x21100000,6000000 ramdisk_size=15360 console=ttyS0,115200,mem=32M mtdparts=dataflash0:1047552(kernel_image)ro,0x400080(4MB_part),0x3000 60(3MB_part),-(the_rest)

This gives:
dev: size erasesize name
mtd0: 00200000 00010000 "Physically mapped flash"
mtd1: 000ffc00 00000420 "kernel_image"
mtd2: 00400080 00000420 "4MB_part"
mtd3: 00300060 00000420 "3MB_part"
mtd4: 00040320 00000420 "the_rest"

mtd3 and mtd4 will mount, mtd2 will not mount. e.g.

$mount -t jffs2 /dev/mtdblock/2 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/mtdblock/2,
or too many mounted file systems
[root@AT91RM9200DK /root]$

I did notice one other strange thing. I turned on a DEBUG option in at91_dataflash.c that showed all access to the dataflash device. When I mounted the mtd3 or mtd4, it showed reading activity going on with the dataflash. But when I mounted mtd2, the dataflash was not even accessed. It is like the software isn't even getting that far.

e.g. mounting mtd4, note the debug output

[root@AT91RM9200DK /root]$mount -t jffs2 /dev/mtdblock/4 /mnt/4
dataflash_read: 8387808 .. 8388864, 1056, 0x0420 bytes
READ: (e8) f8 38 0
data: 85, 19, 03, 20, 0c, 00, 00, 00, b1, b0, 1e, e4, ff, ff, ff, ff,
dataflash_read: 8387808 .. 8387820, 12, 0x000c bytes

... SNIP ...

dataflash_read: 8648720 .. 8648764, 44, 0x002c bytes
READ: (e8) ff f0 50
data: 85, 19, 01, e0, 2c, 00, 00, 00, 5f, 56, f1, e0, 01, 00, 00, 00,

[root@AT91RM9200DK /root]$mount
/dev/rd/0 on / type ext2 (ro)
/proc on /proc type proc (rw)
/dev/mtdblock/4 on /mnt/4 type jffs2 (rw)

e.g. mounting mtd2, note the lack of debug output

[root@AT91RM9200DK /root]$mount -t jffs2 /dev/mtdblock/2 /mnt/2
mount: wrong fs type, bad option, bad superblock on /dev/mtdblock/2,
or too many mounted file systems

It doesn't even access the dataflash. So I suspect that something in a higher layer is saying that this partition isn't valid.

Any help or hints would be appreciated.

Aras

#1 lore raw
Quoted 5 lines · Aras Vaichas

I did notice one other strange thing. I turned on a DEBUG option in at91_dataflash.c that showed all access to the dataflash device. When I mounted the mtd3 or mtd4, it showed reading activity going on with the dataflash. But when I mounted mtd2, the dataflash was not even accessed. It is like the software isn't even getting that far.

Turn on MTD_DEBUG and JFFS2_DEBUG and provide the output of those

tglx

#5 lore raw
In reply to Aras Vaichas
Quoted 3 lines · Aras Vaichas

I am running Linux-2.4.6-VRS-1 on the AT91RM9200DK development board. I have tried using command line partitions and setting at91_dataflash.c, it makes no difference.

That's a lot of eraseblocks. I think your problem is fixed in 2.6.8-rc2.

Signature · 1 line
dwmw2
#2 lore raw
In reply to Thomas Gleixner
Quoted 4 lines · Thomas Gleixner

Turn on MTD_DEBUG and JFFS2_DEBUG and provide the output of those

tglx

OK, three examples:

(1) mounting a small jffs2 partition

[root@AT91RM9200DK /root]$more /proc/mtd
dev: size erasesize name
mtd0: 00200000 00010000 "Physically mapped flash"
mtd1: 000ffc00 00000420 "kernel_image"
mtd2: 00400080 00000420 "4MB_part"
mtd3: 00300060 00000420 "3MB_part"
mtd4: 00040320 00000420 "the_rest"

[root@AT91RM9200DK /root]$mount /dev/mtdblock/4 /mnt/4 mtdblock_open
ok
mtdblock: read on "the_rest" at 0x0, size 0x800
mtdblock: read on "the_rest" at 0x800, size 0x800
mtdblock: read on "the_rest" at 0x2000, size 0x800
mtdblock: read on "the_rest" at 0x2800, size 0x800
mtdblock: read on "the_rest" at 0x3000, size 0x800
mtdblock: read on "the_rest" at 0x3800, size 0x800
mtdblock: read on "the_rest" at 0x8000, size 0x800
mtdblock: read on "the_rest" at 0x8800, size 0x800
mtdblock: read on "the_rest" at 0x9000, size 0x800
mtdblock: read on "the_rest" at 0x9800, size 0x800 mtdblock_release
ok
mtdblock_open
ok

(2) mounting a large jffs2 partition, no fs type specified

[root@AT91RM9200DK /root]$mount /dev/mtdblock/2 /mnt/2 mtdblock_open
ok
mtdblock: read on "4MB_part" at 0x0, size 0x800
mtdblock: read on "4MB_part" at 0x800, size 0x800
mtdblock: read on "4MB_part" at 0x2000, size 0x800
mtdblock: read on "4MB_part" at 0x2800, size 0x800
mtdblock: read on "4MB_part" at 0x3000, size 0x800
mtdblock: read on "4MB_part" at 0x3800, size 0x800
mtdblock: read on "4MB_part" at 0x8000, size 0x800
mtdblock: read on "4MB_part" at 0x8800, size 0x800
mtdblock: read on "4MB_part" at 0x9000, size 0x800
mtdblock: read on "4MB_part" at 0x9800, size 0x800 mtdblock_release
ok
mtdblock_open
ok
mtdblock_release
ok
mount: you must specify the filesystem type

(3) mounting a large jffs2 partition, jffs2 type specified

[root@AT91RM9200DK /root]$mount -t jffs2 /dev/mtdblock/2 /mnt/2 mtdblock_open
ok
mtdblock_release
ok
mountmtdblock_open
:ok
wrong fsmtdblock_release
ok
type, bad option, bad superblock on /dev/mtdblock/2,
or too many mounted file systems
[root@AT91RM9200DK /root]$

#3 lore raw
Quoted 1 line · Aras Vaichas

OK, three examples:

That's precisely as I expected -- you have too many erase blocks, the kmalloc fails and the mount fails without ever trying to read from the flash.

As I said, it's fixed in the current 2.6 kernel.

Signature · 1 line
dwmw2
#4 lore raw
Quoted 4 lines · David Woodhouse

On Wed, 2004-07-21 at 10:45 +1000, Aras Vaichas wrote:

As I said, it's fixed in the current 2.6 kernel.

I would love to be using the 2.6 kernel but there was this fairly recent email from SAN people ...

What can I do?

# To: linux-arm@xxxxxxxxxxxxxxxxxxxxxx
# Subject: Re: linux and the at91rm9200
# From: Andrew Victor <andrew@xxxxxxxxxxxxx>
# Date: 03 Jun 2004 19:21:29 +0200

Quoted 1 line

Just get 2.6.6.

The AT91RM9200 is currently only supported by the 2.4 kernels. Latest version is 2.4.26-vrs1.

Regards,
Andrew Victor
SAN People