Skip to contentSkip to conversation

mtd: NOR flash driver for OMAP-L137/AM17x

PATCH Superseded Savinay Dharmappa 2 participants 4 messages Nov 12, 2010 – Nov 18, 2010 Memory technology devices (MTD)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 mtd: NOR flash driver for OMAP-L137/AM17x

From: David Griego <[email protected]>

OMAP-L137/AM17x has limited number of dedicated EMIFA address pins, enough to interface directly to an SDRAM. If a device such as an asynchronous flash needs to be attached to the EMIFA, then either GPIO pins or a chip select may be used to control the flash device's upper address lines.

This patch adds support for the NOR flash on the OMAP-L137/ AM17x user interface daughter board using the latch-addr-flash MTD mapping driver which allows flashes to be partially physically addressed. The upper address lines are set by a board specific code which is a separate patch.

---
Since v1:
No modifications. Made v2 because patch 2/2 has changed.

 drivers/mtd/maps/Kconfig             |    9 +
 drivers/mtd/maps/Makefile            |    1 +
 drivers/mtd/maps/latch-addr-flash.c  |  271 ++++++++++++++++++++++++++++++++++
 include/linux/mtd/latch-addr-flash.h |   29 ++++
 4 files changed, 310 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/maps/latch-addr-flash.c
 create mode 100644 include/linux/mtd/latch-addr-flash.h
drivers/mtd/maps/Kconfig +9 -0
index 701d942..b794ea2 100644
@@ -543,4 +543,13 @@ config MTD_PISMO
 
 	  When built as a module, it will be called pismo.ko
 
+config MTD_LATCH_ADDR
+        tristate "Latch-assisted Flash Chip Support"
+        depends on MTD_COMPLEX_MAPPINGS
+        help
+          Map driver which allows flashes to be partially physically addressed
+          and have the upper address lines set by a board specific code.
+
+          If compiled as a module, it will be called latch-addr-flash.
+
 endmenu
drivers/mtd/maps/Makefile +1 -0
index f216bb5..35c3573 100644
@@ -58,3 +58,4 @@ obj-$(CONFIG_MTD_BFIN_ASYNC)	+= bfin-async-flash.o
 obj-$(CONFIG_MTD_RBTX4939)	+= rbtx4939-flash.o
 obj-$(CONFIG_MTD_VMU)		+= vmu-flash.o
 obj-$(CONFIG_MTD_GPIO_ADDR)	+= gpio-addr-flash.o
+obj-$(CONFIG_MTD_LATCH_ADDR)	+= latch-addr-flash.o
drivers/mtd/maps/latch-addr-flash.c new file +271 -0

271 lines not on this page · raw message

include/linux/mtd/latch-addr-flash.h new file +29 -0
new file mode 100644
index 0000000..c77e7c9
@@ -0,0 +1,29 @@
+/*
+ * Interface for NOR flash driver whose high address lines are latched
+ *
+ * Copyright (C) 2008 MontaVista Software, Inc. <[email protected]>
+ *
+ * This file is licensed underthe terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+#ifndef __LATCH_ADDR_FLASH__
+#define __LATCH_ADDR_FLASH__
+
+struct map_info;
+struct mtd_partition;
+
+struct latch_addr_flash_data {
+	unsigned int		width;
+	unsigned int		size;
+
+	int			(*init)(void *data, int cs);
+	void			(*done)(void *data);
+	void			(*set_window)(unsigned long offset, void *data);
+	void			*data;
+
+	unsigned int		nr_parts;
+	struct mtd_partition	*parts;
+};
+
+#endif
Signature · 1 line
1.5.6
#1 lore raw

Hello.

Quoted 9 lines · Savinay Dharmappa

From: David Griego <[email protected]>

OMAP-L137/AM17x has limited number of dedicated EMIFA address pins, enough to interface directly to an SDRAM. If a device such as an asynchronous flash needs to be attached to the EMIFA, then either GPIO pins or a chip select may be used to control the flash device's upper address lines.

Quoted 5 lines

This patch adds support for the NOR flash on the OMAP-L137/ AM17x user interface daughter board using the latch-addr-flash MTD mapping driver which allows flashes to be partially physically addressed. The upper address lines are set by a board specific code which is a separate patch.

Please add back my signoff, omitted in this version. Some of the code,
including a bug fix, was authored by me.

Quoted 1 line
Quoted 8 lines
include/linux/mtd/latch-addr-flash.h new file +0 -0
new file mode 100644
index 0000000..c77e7c9

include/linux/mtd/latch-addr-flash.h line 6

Quoted 6 lines
include/linux/mtd/latch-addr-flash.h new file +6 -0
@@ -0,0 +1,29 @@
+/*
+ * Interface for NOR flash driver whose high address lines are latched
+ *
+ * Copyright (C) 2008 MontaVista Software, Inc.<[email protected]>
+ *
+ * This file is licensed underthe terms of the GNU General Public License
                                 ^

Oops, forgot a space here.

WBR, Sergei

#2 lore raw

Hi Sergei,

Quoted 19 lines · Sergei Shtylyov

Hello.

Quoted 9 lines · Savinay Dharmappa

From: David Griego <[email protected]>

OMAP-L137/AM17x has limited number of dedicated EMIFA address pins, enough to interface directly to an SDRAM. If a device such as an asynchronous flash needs to be attached to the EMIFA, then either GPIO pins or a chip select may be used to control the flash device's upper address lines.

Quoted 5 lines

This patch adds support for the NOR flash on the OMAP-L137/ AM17x user interface daughter board using the latch-addr-flash MTD mapping driver which allows flashes to be partially physically addressed. The upper address lines are set by a board specific code which is a separate patch.

Quoted 4 lines

Please add back my signoff, omitted in this version. Some of the code,

including a bug fix, was authored by me.

I'll surely do this. What about your Sign-off on 2/2 patch? Also shall I add Aleksey's Sign-off on this patch and David's Sign-off on 2/2 patch?

Thanks,
Savinay.

#3 lore raw

Hello.

Quoted 13 lines · Savinay Dharmappa
Quoted 12 lines
Quoted 12 lines

OMAP-L137/AM17x has limited number of dedicated EMIFA address pins, enough to interface directly to an SDRAM. If a device such as an asynchronous flash needs to be attached to the EMIFA, then either GPIO pins or a chip select may be used to control the flash device's upper address lines.

This patch adds support for the NOR flash on the OMAP-L137/ AM17x user interface daughter board using the latch-addr-flash MTD mapping driver which allows flashes to be partially physically addressed. The upper address lines are set by a board specific code which is a separate patch.

Quoted 4 lines
Quoted 2 lines

Please add back my signoff, omitted in this version. Some of the code,
including a bug fix, was authored by me.

I'll surely do this. What about your Sign-off on 2/2 patch?

Already replied.

Quoted 2 lines

Also shall I add
Aleksey's Sign-off on this patch

AFAIR, there was his signoff on it, so yes.

Quoted 1 line

and David's Sign-off on 2/2 patch?

David didn't touch patch 2/2.

Quoted 2 lines

Thanks,
Savinay.

WBR, Sergei