Can the current mtd suport two different types of flash on one board?

David Woodhouse dwmw2 at infradead.org
Thu Feb 26 15:18:45 EST 2004


On Thu, 2004-02-26 at 12:38 -0700, xiaogeng_jin at agilent.com wrote:
> Hi,
> 
> I'd like to know if the current mtd is capable of handling different
> types of flash devices on a single board, for example, device with
> different buswidth, device width and interleave?

Yes, it's capable of this.

> I'm just browsing the source of cfi_cmdset_0002.c and getting some
> preliminary impression that it cannot support such configuration. Am I
> right?

All the details about bus/device width and interleave are abstracted out
in order to prevent us from having to write the same read/write/erase
routines 17 times. It's convoluted, but it works.

See the implementation, for example, of cfi_gen_send_cmd() and how it
works according to the variables you named -- and how if you enabled
advanced configuration and only one interleave/devsize/bussize all the
conditionals go away and you're left with optimal code.

We have Nico to thank for that. It makes my head hurt at times, but it's
very clever.

-- 
dwmw2





More information about the linux-mtd mailing list