[RFC] Adding MTD to device tree

Segher Boessenkool segher at kernel.crashing.org
Sat Aug 12 19:58:01 EST 2006


>>    Required properties:
>>     - device_type : one of "nand-flash", "nor-flash", or "rom".
>
> There are more than just those kinds of MTDs.  There's dataflash,
> AG-AND, NVRAM, ioremappable DRAM, etc.  I'd prefer it to just be  
> called
> "flash".  See more below.

Existing firmwares call it "rom", "nvram", "flash".  All of those
are easy; and I have really no opinion how all the weirdo nand-flash
etc. interfaces should be handled.

device_type communicates to the device-tree consumer what other
properties to expect in this node -- it does not indicate the exact
programming model of the device itself.

I suspect for most nand-flash you can get away with a device_type
of "nand-flash"; for some you might have to specify something more
detailed.

>>     - model : an identifier for the actual controller chip used.
>
> Meaning what exactly?  Lots of NOR flash doesn't have a "controller".

Lots of those chips from different vendors are pin-compatible as well,
so you cannot really hardcode one specific model number.  I don't see
this information being very useful anyway.  Instead, in most cases, the
information you're really after is the programming interface for the
device.  And that goes...

>>     - compatible : Should be the name of the MTD driver. For
>>       type "rom", this is most likely "physmap".
>
> This I agree with, but Sergei already had this.  And since you're
> specifying the name of the MTD driver, that typically already knows  
> what
> type of chip it's talking to.

"compatible" contains a list, most specific first.  So for example
for a NOR-flash it could be "jedec-flash,nor-flash,flash" or whatnot.
(Btw: no comma's, but 0-chars in the actual properties!)


Segher




More information about the Linuxppc-embedded mailing list