[PATCH V2 2/2] mtd/maps/mtd-ram: add an of-platform driver

Ken MacLeod ken at bitsko.slc.ut.us
Wed Jul 1 14:22:19 EDT 2009

w.sang at pengutronix.de (Wolfram Sang) writes:

> On Sat, Jun 06, 2009 at 09:14:08AM +0100, David Woodhouse wrote:
>> It _would_ be possible to hook up RAM through the existing of_physmap
>> driver, I think -- although it would be slightly less efficient that
>> way.
>> Maybe cleaner from the device-tree POV though. And if we want to put a
>> special case in the _code_ to make it more efficient, we can do that.
> During development, I also checked physmap_of.c and found this binding:
>         {
>                 .type           = "rom",
>                 .compatible     = "direct-mapped"
>         },
> which made some sense to me and I thought about .type = "ram". However, I then
> found this in the code:
> /* Helper function to handle probing of the obsolete "direct-mapped"
>  * compatible binding, which has an extra "probe-type" property
>  * describing the type of flash probe necessary. */
> static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,

I was just looking into the same thing but I used:

		.compatible	= "mtd-ram",
		.data		= (void *)"map_ram",

This causes of_flash_probe to set up the map and then call
do_map_probe("map_ram", ...), instead of calling the "obsolete" code

This seems to be working for me.  It looks like partition support
would be included too but I haven't tried that.

  -- Ken

More information about the linux-mtd mailing list