mtd size calcualtion assumes same size'd flashes ?

Josh Boyer jwboyer at gmail.com
Wed Dec 14 08:37:28 EST 2005


On 12/14/05, alfred hitch <alfred.hitch at gmail.com> 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