Note also that the default NOR flash memory controller setting in the current
DVEVM configuration (u-boot) is NOT optimal (everything is set at max
timeout, wait states, etc).  Hence the performance on the JFFS2 filesystem is 
not efficient and is relatively slow.  I changed the value to asynchronous 
configuration register (NOR flash is attached to CS2) as follows:

    ACFG2 = 0
        | ( 0 << 31 ) // selectStrobe      = 0;
        | ( 0 << 30 ) // extWait           = 0;
        | ( 0 << 26 ) // writeSetup        = 0;    //   0 ns
        | ( 3 << 20 ) // writeStrobe       = 3;    //  35 ns
        | ( 0 << 17 ) // writeHold         = 0;    //   0 ns
        | ( 3 << 13 ) // readSetup         = 3;    //  30 ns
        | ( 10<< 7 )  // readStrobe        = 10;   // 120 ns
        | ( 0 << 4 )  // readHold          = 0;    //   0 ns
        | ( 3 << 2 )  // turnAround        = 3;    //  ?? ns ( MAX TIMEOUT )
        | ( 1 << 0 )  // asyncSize         = 1;    // 16-bit bus
        ;

and it gives me a lot better performance.  You can add code to set the CS2 ACR
register in board/davinci/platform.S (in the same area where CS3, CS4, and CS5
are initialized).

Regards,
Andy

----- Original Message ----
From: Andy Ngo <[EMAIL PROTECTED]>
To: Yogesh Kumar M <[EMAIL PROTECTED]>; 
[email protected]
Sent: Tuesday, April 10, 2007 11:25:52 PM
Subject: Re: NOR flash file system on Davinci

Yogesh,

I have done so.  Took me a while to figure it out but I eventually did it.
Here is a summary of the steps for those who want to try:

1) Download the GIT kernel
 (linux-davinci-2.6); the Montavista version doesn't
   seem to support it
2) Create a default config for the DVEVM
   make ARCH=arm CROSS_COMPILE=arm_v5t_le- davinci_evm_dm644x_defconfig
3) Configure the kernel to disable IDE (MTD NOR flash can only be used when IDE 
support 
   is disabled)
  
   make ARCH=arm CROSS_COMPILE=arm_v5t_le- menuconfig
        => Device Drivers => ATA/ATAPI/MFM/RLL support => unselect 
ATA/ATAPI/MFM/RLL support
 
   * NOTE: no need to enable MTD NOR JFFS2 support since it's already enabled 
in 
           the default DVEVM configuration from step 2

   The flash layout is already defined in arch/arm/mach-davinci/board-evm.c:

   static struct mtd_partition davinci_evm_partitions[] = {
        /* bootloader (U-Boot, etc) in first 4 sectors */
        {
              .name             = "bootloader",
              .offset           = 0,
              .size             = 4 * SZ_64K,
              .mask_flags       = MTD_WRITEABLE, /* force read-only */
        },
        /* bootloader params in the next 1 sectors */
        {
              .name             = "params",
              .offset           = MTDPART_OFS_APPEND,
              .size             = SZ_64K,
              .mask_flags       = 0,
        },
        /* kernel */
        {
             
 .name             = "kernel",
              .offset           = MTDPART_OFS_APPEND,
              .size             = SZ_2M,
              .mask_flags       = 0
        },
        /* file system */
        {
              .name             = "filesystem",
              .offset           = MTDPART_OFS_APPEND,
              .size             = MTDPART_SIZ_FULL,
              .mask_flags       = 0
        }
    };

    so the 4 MTD partitions should look like this:

        0x00000000-0x00040000 : "bootloader"
    0x00040000-0x00050000 : "params"
        0x00050000-0x00250000 : "kernel"
    0x00250000-0x01000000 : "filesystem"

    Your JFFS2 filesystem will reside in the 4th MTD partition.

4) Build the kernel
5) Prepare your JFFS2 filesystem
    a) Download the mtd utilities from http://www.linux-mtd.infradead.org/
       and build it to generate the mkfs.jffs2 utility
    b) Gather the rootfs with which you want to generate the filesystem;
        I
 used the sample ramdisk.gz mentioned from spraah2.pdf:
            gunzip ramdisk.gz
            mkdir myrootfs
            mount -o loop ramdisk myrootfs
    c) Create the JFFS2 filesystem
            mkfs.jffs2 -d myrootfs -o rootfs.jffs2 -e 0x10000
6) Use u-boot to flash the uImage (from 4) and rootfs.jffs2 (from 5c)
    a) Flash uImage at 0x02050000
    b) Flash rootfs.jffs2 at 0x02250000
7) Adjust your boot environment variables to boot to the new NOR JFFS2 
filesystem
    a) setenv bootargs mem=120M console=ttyS0,115200n8 root=/dev/mtdblock3 rw 
noinitrd noatime rootfstype=jffs2 ip=off
    b) saveenv
8) You are done! Reboot your board and you will boot to your new JFFS2 
filesystem
   on the NOR flash. 
 NOTE: the first time you boot, the JFFS2 processing will
   prepare (format) the filesystem for use so you will hang at the kernel 
message
   "Freeing init memory: 80K" for a few minutes so be patient.  The next time 
you
   boot you won't get this "hung delay" as your JFFS2 filesystem is already 
formatted.

I spent over a week figuring this out (wasting most of my time on the Montavista
kernel until I switched over to the GIT kernel) I hope this helps anyone who 
wants
to create a small footprint system, which doesn't have the luxury of a hard 
drive 
as the DVEVM board does.

Regards,
Andy


     

----- Original Message ----
From: Yogesh Kumar M <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, April 9, 2007 1:34:54
 AM
Subject: NOR flash file system on Davinci

Hi,

    Has anybody successfully ported NOR flash based file system on DAVINCI and
successful in booting linux with flash file system?
please let me know what changes to be made to the kernel for detecting the
flash and where should I specify the memory map .

thanks
yogesh


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source





_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source




_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to