Skip to contentSkip to conversation

NAND: common driver for ts78xx/ts72xx platforms

RFC PATCH In review Alexander Clouter 1 participant 1 message Dec 29, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/3 NAND: common driver for ts78xx/ts72xx platforms

[PATCH RFC] [MTD] NAND: common driver support for NAND in TS-7800 and TS-72X0

Common driver that both platforms, the ts78xx.c and ts7200.c, can use to access the NAND. All the platform specific bits (such as IO addresses and partitioning schemes) live in the platform code.

---
 drivers/mtd/nand/Kconfig   |    6 +
 drivers/mtd/nand/Makefile  |    1 +
 drivers/mtd/nand/ts7xxx.c  |  334 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mtd/ts7xxx.h |   35 +++++
 4 files changed, 376 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/ts7xxx.c
 create mode 100644 include/linux/mtd/ts7xxx.h
drivers/mtd/nand/Kconfig +6 -0
index f8ae040..c1f3014 100644
@@ -80,6 +80,12 @@ config MTD_NAND_TS7250
 	help
 	  Support for NAND flash on Technologic Systems TS-7250 platform.
 
+config MTD_NAND_TS7XXX
+	tristate "NAND Flash device on TS-7xxx boards"
+	depends on MACH_TS72XX || MACH_TS78XX
+	help
+	  Support for NAND flash on Technologic Systems TS-7xxx platforms.
+
 config MTD_NAND_IDS
 	tristate
 
drivers/mtd/nand/Makefile +1 -0
index b661586..68694c7 100644
@@ -19,6 +19,7 @@ obj-$(CONFIG_MTD_NAND_H1900)		+= h1910.o
 obj-$(CONFIG_MTD_NAND_RTC_FROM4)	+= rtc_from4.o
 obj-$(CONFIG_MTD_NAND_SHARPSL)		+= sharpsl.o
 obj-$(CONFIG_MTD_NAND_TS7250)		+= ts7250.o
+obj-$(CONFIG_MTD_NAND_TS7XXX)		+= ts7xxx.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)		+= nandsim.o
 obj-$(CONFIG_MTD_NAND_CS553X)		+= cs553x_nand.o
 obj-$(CONFIG_MTD_NAND_NDFC)		+= ndfc.o
drivers/mtd/nand/ts7xxx.c new file +334 -0

334 lines not on this page · raw message

include/linux/mtd/ts7xxx.h new file +35 -0
new file mode 100644
index 0000000..955209a
@@ -0,0 +1,35 @@
+/*
+ * linux/include/linux/mtd/ts7xxx.h
+ *
+ * Copyright (c) 2008 Alexander Clouter <[email protected]>
+ *
+ * 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.
+ */
+
+#include <linux/mtd/partitions.h>
+
+struct ts7xxx_ioport_entry {
+	unsigned int			res;
+	unsigned int			offset;
+};
+
+struct ts7xxx_ioports {
+	struct ts7xxx_ioport_entry	ctrl;
+	struct ts7xxx_ioport_entry	data;
+
+	struct ts7xxx_ioport_entry	busy;
+};
+
+/*
+ * struct ts7xxx_nand_data - chip level device structure
+ * @nr_partitions:	number of partitions pointed to by partitions (or zero)
+ * @partitions:		mtd partition list
+ */
+struct ts7xxx_nand_data {
+	int				nr_partitions;
+	struct mtd_partition		*partitions;
+
+	struct ts7xxx_ioports		ioports;
+};
Signature · 1 line
1.5.6.5