[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: can't mount >3MByte JFFS2 partition on Dataflash on AT91RM920
From:       Aras Vaichas <arasv () magellan-technology ! com>
Date:       2004-07-29 2:29:38
Message-ID: 41086112.1030802 () magellan-technology ! com
[Download RAW message or body]

Why? Once your partitions are set up correctly, why would you need to change 
them? It's fairly fast to pass it as a kernel parameter from uboot by using the 
scripts effectively. If your root partition is mounted on the MTD device, then 
you can't change it once the kernel is already going (without a lot of effort)!

e.g.

Uboot> printenv

ba_con=console=ttyS0,115200,mem=32M
ba_par1=mtdparts=dataflash0:-(part1)
ba_par2=mtdparts=dataflash0:1047552(partition_1),1047552(partition_2),-(partition_33)
ba_rr=root=/dev/ram rx initrd=0x21100000,6000000 ramdisk_size=15360
ba_rf=root=/dev/mtdblock/0


e.g. one large flash partition used as root device
Uboot> setenv bootargs $(ba_con) $(ba_par1) $(ba_rf)

e.g. several small flash partitions, root on ramdisk (require ramdisk aware kernel)
Uboot> setenv bootargs $(ba_con) $(ba_par2) $(ba_rr)

I made these scripts during development to save me mistyping them. I only use 
them now if I accidentally lose my root partition through experimentation and 
need to mount a ramdisk to recover.

Aras

Yomie Chan wrote:
> Hi, can I  pass this mtdparts cmd line in after the linux kernel starts up ?
> 
> please give me a hand
> thanks
> 
> -Yomie
> 
> -----Original Message-----
> From: Vadim Yatsenko [mailto:Vadim.Yatsenko@malva.ua]
> Sent: Monday, July 19, 2004 4:53 PM
> To: linux-arm
> Subject: Re: can't mount >3MByte JFFS2 partition on Dataflash on
> AT91RM9200DK
> 
> 
> Why you don't wont to use command line partitioning.
> For example I use:
> mtdparts=dataflash0:16896(boot)ro,844800@16896(kernel)ro,-(fs)
> 
> With best regards. YaVA
> 
> ----- Original Message ----- 
> From: "Yomie Chan" <yomiechan@octopuscards.com>
> To: "'Aras Vaichas'" <arasv@magellan-technology.com>; "linux-arm-list"
> <Linux-arm-kernel@lists.arm.linux.org.uk>
> Sent: Monday, July 19, 2004 11:46 AM
> Subject: RE: can't mount >3MByte JFFS2 partition on Dataflash on
> AT91RM9200DK
> 
> 
> 
>>here's an example for my partition definition on at91_dataflash.c.
>>My dataflash is also AT45DB642 on at91rm9200dk
>>The largest partition I tried is 7MB.
>>
>>
>>static struct mtd_partition static_partitions_8M[] = {
>>    {   name:       "protected",
>>        offset:     0,
>>        size:       2 * 64 * 8 * 528    /* 2 sectors */
>>        mask_flags: MTD_WRITEABLE
>>    },
>>    {   name:       "partition A",
>>        offset:     MTDPART_OFS_NXTBLK,
>>        size:       3 * 64 * 8 * 528    /* 3 sectors */
>>    },
>>    {   name:       ""partition B",
>>        offset:     MTDPART_OFS_NXTBLK,
>>        size:       MTDPART_SIZ_FULL
>>    }
>>};
>>
>>Best Regards,
>>-Yomie
>>
>>
>>
>>-----Original Message-----
>>From: Aras Vaichas [mailto:arasv@magellan-technology.com]
>>Sent: Monday, July 19, 2004 4:33 PM
>>To: linux-arm-list
>>Subject: can't mount >3MByte JFFS2 partition on Dataflash on
>>AT91RM9200DK
>>
>>
>>I am seeing strange behaviour out of the Dataflash with respect to
>>mounting JFFS2. I am running a Linux 2.4.26-vrs1 kernel on the
> 
> AT91RM9200DK.
> 
>>I am editing the file "/driver/at91/mtd/at91_dataflash.c" to set the
>>partition sizes and offsets. The beginning of the Dataflash is occupied
>>by the kernel image, so I have to start at an offset (>1Mbyte) from
>>there. I did a binary search to find the offset locations at which it
>>started failing.
>>
>>e.g.
>>file: at91_dataflash.c
>>static struct mtd_partition static_partitions[] =
>>{
>>// fails at offset: 0x004f3260, succeeds at offset: 0x004f3680
>>         {
>>                 name:           "filesystem",
>>                 offset:         0x004f3680,
>>                 size:           MTDPART_SIZ_FULL,
>>         }
>>};
>>
>>The largest partition I can make is about 3.3MByte
>>
>>When I can successfully mount a partition on the Dataflash, I can create
>>a file, reset the device, remount the partition and the file is still
>>there. In fact, I don't even have to specify "-t jffs2" because mount
>>will automatically identify the partition type. So it all works fine.
>>
>>e.g.
>>
>>=== BEGIN SUCCESSFUL JFFS2 MOUNT ===
>>
>>[root@AT91RM9200DK /root]$dmesg
>>... snip ...
>>at91_dataflash: Atmel AT45DB642 detected [spi0] (8650752 bytes)
>>Creating 1 MTD partitions on "Atmel AT45DB642":
>>0x006000c0-0x00840000 : "filesystem"
>>... snip ...
>>[root@AT91RM9200DK /root]$cat /proc/mtd
>>dev:    size   erasesize  name
>>mtd0: 00200000 00010000 "Physically mapped flash"
>>mtd1: 0023ff40 00000420 "filesystem"
>>[root@AT91RM9200DK /root]$eraseall -j /dev/mtd/1
>>Erasing 1 Kibyte @ 23fb20 -- 99 % complete. Cleanmarker written at 23fb20.
>>[root@AT91RM9200DK /root]$mount -t jffs2 /dev/mtdblock/1 /mnt/AT45DB642/
>>[root@AT91RM9200DK /root]$mount
>>/dev/rd/0 on / type ext2 (ro)
>>/proc on /proc type proc (rw)
>>/dev/mtdblock/1 on /mnt/AT45DB642 type jffs2 (rw)
>>[root@AT91RM9200DK /root]$df
>>Filesystem           1k-blocks      Used Available Use% Mounted on
>>rootfs                   14871     13547      1324  91% /
>>/dev/root                14871     13547      1324  91% /
>>/dev/mtdblock/1           2300        28      2272   1% /mnt/AT45DB642
>>[root@AT91RM9200DK /root]$umount /mnt/AT45DB642/
>>[root@AT91RM9200DK /root]$mount
>>/dev/rd/0 on / type ext2 (ro)
>>/proc on /proc type proc (rw)
>>[root@AT91RM9200DK /root]$mount /dev/mtdblock/1 /mnt/AT45DB642/
>>[root@AT91RM9200DK /root]$[root@AT91RM9200DK /root]$mount
>>/dev/rd/0 on / type ext2 (ro)
>>/proc on /proc type proc (rw)
>>/dev/mtdblock/1 on /mnt/AT45DB642 type jffs2 (rw)
>>
>>=== END SUCCESSFUL JFFS2 MOUNT ===
>>
>>
>>BUT If I try to mount a larger partition around 3.3MB to 8MB(max), it
>>fails to mount the partition.
>>
>>e.g.
>>
>>=== BEGIN UNSUCCESSFUL JFFS2 MOUNT ===
>>[root@AT91RM9200DK /root]$dmesg
>>... snip ...
>>at91_dataflash: Atmel AT45DB642 detected [spi0] (8650752 bytes)
>>0x00400080-0x00840000 : "filesystem"
>>... snip ...
>>[root@AT91RM9200DK /root]$cat /proc/mtd
>>dev:    size   erasesize  name
>>mtd0: 00200000 00010000 "Physically mapped flash"
>>mtd1: 0043ff80 00000420 "filesystem"
>>[root@AT91RM9200DK /root]$eraseall -j /dev/mtd/1
>>Erasing 1 Kibyte @ 43fb60 -- 99 % complete. Cleanmarker written at 43fb60.
>>[root@AT91RM9200DK /root]$mount -t jffs2 /dev/mtdblock/1 /mnt/AT45DB642/
>>mount: wrong fs type, bad option, bad superblock on /dev/mtdblock/1,
>>        or too many mounted file systems
>>=== END UNSUCCESSFUL JFFS2 MOUNT ===
>>
>>Anyone had similar problems?
>>
>>regards,
>>
>>Aras Vaichas
>>
>>
>>
>>
>>-------------------------------------------------------------------
>>Subscription options:
>>http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
>>FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
>>Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
>>
>>-------------------------------------------------------------------
>>Subscription options:
> 
> http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> 
>>FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
>>Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
>>
> 
> 
> 
> -------------------------------------------------------------------
> Subscription options:
> http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
> Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
> 
> -------------------------------------------------------------------
> Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
> Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic