mtd: Factor out OF partition support from the NOR driver.
PATCH 1/2 mtd: Factor out OF partition support from the NOR driver.
Signed-off-by Scott Wood <[email protected]>
--- drivers/mtd/Kconfig | 8 ++++ drivers/mtd/Makefile | 1 + drivers/mtd/maps/physmap_of.c | 89 ++++++++++++---------------------------- drivers/mtd/ofpart.c | 74 +++++++++++++++++++++++++++++++++ include/linux/mtd/partitions.h | 9 ++++- 5 files changed, 118 insertions(+), 63 deletions(-) create mode 100644 drivers/mtd/ofpart.c
drivers/mtd/Kconfig +8 -0
@@ -150,6 +150,14 @@ config MTD_AFS_PARTS for your particular device. It won't happen automatically. The 'armflash' map driver (CONFIG_MTD_ARMFLASH) does this, for example. +config MTD_OF_PARTS + tristate "Flash partition map based on OF description" + depends on PPC_OF && MTD_PARTITIONS + help + This provides a partition parsing function which derives + the partition map from the children of the flash node, + as described in Documentation/powerpc/booting-without-of.txt. + comment "User Modules And Translation Layers" config MTD_CHAR
drivers/mtd/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_AFS_PARTS) += afs.o +obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o # 'Users' - code which presents functionality to userspace. obj-$(CONFIG_MTD_CHAR) += mtdchar.o
drivers/mtd/maps/physmap_of.c +27 -62
111 lines not on this page · raw message
drivers/mtd/ofpart.c new file +74 -0
74 lines not on this page · raw message
include/linux/mtd/partitions.h +8 -1
@@ -71,5 +71,12 @@ extern int parse_mtd_partitions(struct mtd_info *master, const char **types,#define put_partition_parser (p) do { module_put((p)->owner); } while(0) -#endif +struct device ; +struct device_node ; + +int __devinit of_mtd_parse_partitions (struct device *dev, +struct mtd_info *mtd, +struct device_node *node, +struct mtd_partition **pparts); +#endif
Signature · 1 line
1.5.3.8