mtd size calcualtion assumes same size'd flashes ?

alfred hitch alfred.hitch at
Wed Dec 14 23:30:08 EST 2005

Hi josh,

Thanks for your mail.
I am not so clear on this separate mtd device for each chip thing.
I have been simply creating the say map file in ixp425.c with whole
flash layout declared there.
I had to do mknod for each partition created in map separately
something like this say:
ixp425.c: static struct mtd_partition ixp425_partitions[] = {
                name:   "bootloader",
                offset: 0x00000000,
                size:   0x00020000,
                name:   "bootloader-config",
                offset: 0x00020000,
                size:   0x00020000,
                name:   "normal-kernel",
                offset: 0x00040000,
                size:   0x00100000,

and I had to do a mknod of  /dev/mtd0,1.2 etc with sequential minor numbers ..

Can you please tell me how to create separate MTD devices if this isnt
that ? or any relavant doc ?


On 12/14/05, Josh Boyer <jwboyer at> wrote:
> On 12/14/05, alfred hitch <alfred.hitch at> wrote:
> > Hi,
> >
> > Please correct me if my understanding is wrong here:
> > but while grepp'ing through the code of linux 2.6 base I had.
> > File cfi_cmdset0001.c :
> > function: static struct mtd_info *cfi_intelext_setup(struct map_info *map)
> >
> >       mtd->size = devsize * cfi->numchips;
> >
> > This seems to me an assumption that the flash'es in system are all of
> > same size and so can be added up ?
> > Is my understanding correct, sorry dont have latest code access.
> I believe your understanding is correct.  Your device size can span
> multiple chips if they are physically contiguous and of the same type.
> >
> > If that is the case, any reasons to do so  ?
> > My system happened to have an odd sized flash config and was creating messups.
> > If my understanding is correct, I would have like to patch and post it.
> The normal method of dealing with heterogenous chips is to create
> separate MTD devices for each chip in your map driver.  You can then
> use MTD_CONCAT to  concatenate these separate devices into one large
> device.
> josh

More information about the linux-mtd mailing list