Skip to contentSkip to conversation

mtd: Factor out OF partition support from the NOR driver.

PATCH RESEND In review Scott Wood 1 participant 1 message Jan 11, 2008 Memory technology devices (MTD)

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH RESEND 2/3 mtd: Factor out OF partition support from the NOR driver.

---
 drivers/mtd/Kconfig            |    8 ++++
 drivers/mtd/Makefile           |    1 +
 drivers/mtd/maps/physmap_of.c  |   89 ++++++++++++----------------------------
 drivers/mtd/ofpart.c           |   70 +++++++++++++++++++++++++++++++
 include/linux/mtd/partitions.h |    9 ++++-
 5 files changed, 114 insertions(+), 63 deletions(-)
 create mode 100644 drivers/mtd/ofpart.c
drivers/mtd/Kconfig +8 -0
index 661eac0..e850334 100644
@@ -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
index 7f0b04b..538e33d 100644
@@ -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 +70 -0

70 lines not on this page · raw message

include/linux/mtd/partitions.h +8 -1
index da6b3d6..7c37d7e 100644
@@ -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