Thanks Gavin,

        I'll try with the new map driver. 

-----Original Message-----
From: Gavin Lambert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 01, 2007 5:13 AM
To: 'uClinux development list'
Subject: RE: [uClinux-dev] MTD partitions for 2 flash chips


Quoth Steven Veigas:
> I am facing some problem in making MTD partitions for flash chips,
> which are not at continuous locations in the memory map 
[...]
> Actually I need partitions as shown below
> mtd1 - 0x34000000 to 0x34800000
> mtd2 - 0x34800000 to 0x35000000
> mtd3 - 0x38000000 to 0x38800000
> mtd4 - 0x38800000 to 0x39000000
[...]
> flash locations are not continuous. I edited the file
> drivers/mtd/maps/physmap.c as shown below 

First of all, you should probably make a new map driver rather than
hacking one of the standard ones.  It's just cleaner that way.

> static struct mtd_partition physmap_partitions[] = {
>         {
>                 name:           "IMAGES",
>                 size:           0x800000,
>                 offset:         0,
>                 mask_flags:     MTD_WRITEABLE,
>         },
>         {
>                 name:           "ROOTFS",
>                 size:           MTDPART_SIZ_FULL,
>                 //size:         0x800000,
>                 offset:         MTDPART_OFS_APPEND,
>                 mask_flags:     MTD_WRITEABLE,
>         },

These entries establish the following partitions:
  mtd1: 0x34000000 to 0x34800000
  mtd2: 0x34800000 to 0x39000000
... which consumes all of your declared flash size, so it's not
surprising that the rest fail.

>         {
>                 name:           "NO_FLASH",
>                 size:           0x3000000,
>                 offset:         MTDPART_OFS_APPEND,
>         },

You shouldn't declare a partition for nonexistent flash.  Change the
offset instead.

> how to support more than one flash, which are not at continuous
> locations in the memory map 

You just need to specify the correct offsets as well as sizes.  And
really that means writing your own map driver (or using command line
partitioning), as the physmap driver is a basic one intended for a
single contiguous range of flash.

> FYI
>     If we use only one flash at a time,  I am not getting any errors,
>     same CS is used for both

If these are separate flash chips, then how are you using the same CS
for all three?  Normally flash chips aren't internally discontiguous, so
you must be doing something weird with the address lines in that case.




_______________________________________________
uClinux-dev mailing list
[EMAIL PROTECTED]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [EMAIL PROTECTED]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to