new driver - generic platform device for ram mapping
Subsystems (3)
This patch adds a generic platform_device driver for adding areas of RAM to be exported as an MTD device.
Using the platform_device method enables boards to register areas of RAM with the MTD system without having to update a driver in the MTD map code. As an example, an patch to add the 1024KiB area of static RAM on the VR1000 has also been attached
If people do not object, I will commit this to the CVS in a couple of days.
files changed:
drivers/mtd/maps/Kconfig | 10 + drivers/mtd/maps/Makefile | 1 drivers/mtd/maps/plat-ram.c | 286 +++++++++++++++++++++++++++++++++++++++++++ include/linux/mtd/plat-ram.h | 33 ++++ 4 files changed, 330 insertions(+)
Signature · 1 line
Ben
drivers/mtd/maps/Kconfig +10 -0
@@ -667,5 +667,15 @@ help This enables access to the flash chip on the Sharp SL Series of PDAs. +config MTD_PLATRAM + tristate "Map driver for platfrom device RAM (mtd-ram)" + depends on MTD + select MTD_RAM + help + Map driver for RAM areas described via the platform device + system. + + This selection automatically selects the map_ram driver. + endmenu
drivers/mtd/maps/Makefile +1 -0
@@ -72,3 +72,4 @@ obj-$(CONFIG_MTD_WRSBC8260) += wr_sbc82xx_flash.o obj-$(CONFIG_MTD_DMV182) += dmv182.o obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o +obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
drivers/mtd/maps/plat-ram.c +286 -0
286 lines not on this page · raw message
include/linux/mtd/plat-ram.h +33 -0
@@ -0,0 +1,33 @@ +/* linux/include/mtd/plat-ram.h +* +* (c) 2004 Simtec Electronics +* http://www.simtec.co.uk/products/SWLINUX/ +* Ben Dooks <[email protected]> +* +* Generic platform device based RAM map +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#ifndef __LINUX_MTD_PLATRAM_H +#define __LINUX_MTD_PLATRAM_H __FILE__ + +#define PLATRAM_RO (0) +#define PLATRAM_RW (1) + +struct platdata_mtd_ram { +char *mapname; +char **probes; +struct mtd_partition *partitions; +int nr_partitions; +int bankwidth; + +/* control callbacks */ + +void (*set_rw)(struct device *dev,int to); +}; + +#endif /* __LINUX_MTD_PLATRAM_H */
arch/arm/mach-s3c2410/mach-vr1000.c +50 -0
68 lines not on this page · raw message
Quoted 4 lines · Ben Dooks
This patch adds a generic
platform_devicedriver for adding areas of RAM to be exported as an MTD device.
Quoted 8 lines
Using the
platform_devicemethod enables boards to register areas of RAM with the MTD system without having to update a driver in the MTD map code. As an example, an patch to add the 1024KiB area of static RAM on the VR1000 has also been attachedIf people do not object, I will commit this to the CVS in a couple of days.
How is this different from slram/phram? Both your description and the code look awfully similar.
Jörn
Signature · 4 lines
Correctness comes second. Features come third. Performance comes last. Maintainability is needed for all of them.