public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] use physmap-flash
@ 2009-12-06  0:35 Ladislav Michl
  2009-12-07 18:02 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Ladislav Michl @ 2009-12-06  0:35 UTC (permalink / raw)
  To: linux-omap
  Cc: Imre Deak, Brian Swetland, Kevin Hilman, Syed Mohammed, Khasim,
	Paul Mundt, Dirk Behme, Marek Vasut

Hi!

and sorry for touching ancient stuff again... Also sorry for long Cc list,
which is not even complete, because some projects seem to be dead now.

So, are there any objections to remove drivers/mtd/maps/omap_nor.c entirely
in favour of physmap-flash?

$ rgrep omapflash arch/arm | sed "s/:.*//" | sort | uniq
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-h4.c

Note that list is missing board-voiceblue.c, which is converted by patch bellow.
Function omap_set_vpp should be probably moved somewhere to plat-omap.
Suggestions?

diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 35c75c1..30e6d0d 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -22,11 +22,11 @@
 #include <linux/reboot.h>
 #include <linux/serial_8250.h>
 #include <linux/serial_reg.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 
 #include <plat/common.h>
@@ -85,9 +85,31 @@ static int __init ext_uart_init(void)
 }
 arch_initcall(ext_uart_init);
 
-static struct flash_platform_data voiceblue_flash_data = {
-	.map_name	= "cfi_probe",
+static void omap_set_vpp(struct map_info *map, int enable)
+{
+	static int count;
+	u32 l;
+
+	if (cpu_class_is_omap1()) {
+		if (enable) {
+			if (count++ == 0) {
+				l = omap_readl(EMIFS_CONFIG);
+				l |= OMAP_EMIFS_CONFIG_WP;
+				omap_writel(l, EMIFS_CONFIG);
+			}
+		} else {
+			if (count && (--count == 0)) {
+				l = omap_readl(EMIFS_CONFIG);
+				l &= ~OMAP_EMIFS_CONFIG_WP;
+				omap_writel(l, EMIFS_CONFIG);
+			}
+		}
+	}
+}
+
+static struct physmap_flash_data voiceblue_flash_data = {
 	.width		= 2,
+	.set_vpp	= omap_set_vpp,
 };
 
 static struct resource voiceblue_flash_resource = {
@@ -97,7 +119,7 @@ static struct resource voiceblue_flash_resource = {
 };
 
 static struct platform_device voiceblue_flash_device = {
-	.name		= "omapflash",
+	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
 		.platform_data	= &voiceblue_flash_data,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-07 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-06  0:35 [RFC] use physmap-flash Ladislav Michl
2009-12-07 18:02 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox