omap: convert boards to use physmap-flash
authorLadislav Michl <ladis@linux-mips.org>
Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)
Convert OMAP based boards to use physmap-flash. Refreshed against today's
Linux omap kernel tree

Cc: linux-mtd@lists.infradead.org
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
16 files changed:
arch/arm/mach-omap1/Makefile
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-omap1/board-voiceblue.c
arch/arm/mach-omap1/flash.c [new file with mode: 0644]
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-h4.c
arch/arm/plat-omap/include/plat/flash.h [new file with mode: 0644]

index 9ce17f13d3f1da961bda9d18255b64e51e326f1b..b6a537c875b8cf15f8b502fe2fe9bec566f3a659 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 # Common support
-obj-y := io.o id.o sram.o irq.o mux.o serial.o devices.o
+obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o
 obj-y += clock.o clock_data.o opp_data.o
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
index 7e70c3c08da63b584889ca6b7655859e3539602b..096f2ed102cbe5aa8fff6a3632022f999776c51d 100644 (file)
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/input.h>
 #include <linux/smc91x.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/tc.h>
 #include <mach/gpio.h>
 #include <plat/mux.h>
+#include <plat/flash.h>
 #include <plat/fpga.h>
 #include <plat/keypad.h>
 #include <plat/common.h>
@@ -150,9 +151,9 @@ static struct mtd_partition nor_partitions[] = {
        },
 };
 
-static struct flash_platform_data nor_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data nor_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = nor_partitions,
        .nr_parts       = ARRAY_SIZE(nor_partitions),
 };
@@ -164,7 +165,7 @@ static struct resource nor_resource = {
 };
 
 static struct platform_device nor_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &nor_data,
index fa7cecea19f92800fa520248e074582ff24c6687..d1100e4f65aca736c6113643c1310cff4bc2a9b4 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/input.h>
 #include <linux/i2c/tps65010.h>
 #include <linux/smc91x.h>
@@ -35,7 +36,6 @@
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 
 #include <plat/mux.h>
@@ -45,6 +45,7 @@
 #include <plat/usb.h>
 #include <plat/keypad.h>
 #include <plat/common.h>
+#include <plat/flash.h>
 
 #include "board-h2.h"
 
@@ -121,9 +122,9 @@ static struct mtd_partition h2_nor_partitions[] = {
        }
 };
 
-static struct flash_platform_data h2_nor_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data h2_nor_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = h2_nor_partitions,
        .nr_parts       = ARRAY_SIZE(h2_nor_partitions),
 };
@@ -134,7 +135,7 @@ static struct resource h2_nor_resource = {
 };
 
 static struct platform_device h2_nor_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &h2_nor_data,
index 6a7f9c391cf1ea3c51fc68a3bf23ac4be0a58061..a53ab8297d25eb05185b433d310ab2dd415290bf 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/input.h>
 #include <linux/spi/spi.h>
 #include <linux/i2c/tps65010.h>
@@ -37,7 +38,6 @@
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 
 #include <mach/irqs.h>
@@ -47,6 +47,7 @@
 #include <plat/keypad.h>
 #include <plat/dma.h>
 #include <plat/common.h>
+#include <plat/flash.h>
 
 #include "board-h3.h"
 
@@ -126,9 +127,9 @@ static struct mtd_partition nor_partitions[] = {
        }
 };
 
-static struct flash_platform_data nor_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data nor_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = nor_partitions,
        .nr_parts       = ARRAY_SIZE(nor_partitions),
 };
@@ -139,7 +140,7 @@ static struct resource nor_resource = {
 };
 
 static struct platform_device nor_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &nor_data,
index 2133b006f6a3fe88fe1bd026439e53ea5a9d7179..5d12fd35681b24041695fd3a324bb5a8f2d226bc 100644 (file)
 #include <linux/delay.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/input.h>
 #include <linux/smc91x.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/mux.h>
+#include <plat/flash.h>
 #include <plat/fpga.h>
 #include <mach/gpio.h>
 #include <plat/tc.h>
@@ -94,9 +95,9 @@ static struct mtd_partition innovator_partitions[] = {
        }
 };
 
-static struct flash_platform_data innovator_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data innovator_flash_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = innovator_partitions,
        .nr_parts       = ARRAY_SIZE(innovator_partitions),
 };
@@ -108,7 +109,7 @@ static struct resource innovator_flash_resource = {
 };
 
 static struct platform_device innovator_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &innovator_flash_data,
index ccea4f448e9a18e8d367c50153ef3871b083983e..80d862001def595ef2fada032e909a9bcd9aea01 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 
 #include <linux/i2c/tps65010.h>
 
@@ -46,8 +47,8 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/flash.h>
 
+#include <plat/flash.h>
 #include <plat/usb.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
@@ -94,9 +95,9 @@ static struct mtd_partition osk_partitions[] = {
        }
 };
 
-static struct flash_platform_data osk_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data osk_flash_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = osk_partitions,
        .nr_parts       = ARRAY_SIZE(osk_partitions),
 };
@@ -107,7 +108,7 @@ static struct resource osk_flash_resource = {
 };
 
 static struct platform_device osk5912_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &osk_flash_data,
index 9fe887262bdf3b5e0e33fe9885feb059eea04309..569b4c9085cd8b952f91716ebe7e00984ebe7169 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/spi/spi.h>
 #include <linux/interrupt.h>
 #include <linux/apm-emulation.h>
@@ -31,9 +32,9 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/flash.h>
 
 #include <mach/gpio.h>
+#include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/usb.h>
 #include <plat/tc.h>
@@ -126,9 +127,9 @@ static struct mtd_partition palmte_rom_partitions[] = {
        },
 };
 
-static struct flash_platform_data palmte_rom_data = {
-       .map_name       = "map_rom",
+static struct physmap_flash_data palmte_rom_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = palmte_rom_partitions,
        .nr_parts       = ARRAY_SIZE(palmte_rom_partitions),
 };
@@ -140,7 +141,7 @@ static struct resource palmte_rom_resource = {
 };
 
 static struct platform_device palmte_rom_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = -1,
        .dev            = {
                .platform_data  = &palmte_rom_data,
index af068e3e0fe7e95dc8bc7fb50fbcad35f790024d..6ad49a2cc1a03af4368628ddef06896786d6c3ae 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/leds.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/flash.h>
 
 #include <plat/led.h>
 #include <mach/gpio.h>
+#include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/usb.h>
 #include <plat/dma.h>
@@ -104,9 +105,9 @@ static struct mtd_partition palmtt_partitions[] = {
        }
 };
 
-static struct flash_platform_data palmtt_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data palmtt_flash_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = palmtt_partitions,
        .nr_parts       = ARRAY_SIZE(palmtt_partitions),
 };
@@ -118,7 +119,7 @@ static struct resource palmtt_flash_resource = {
 };
 
 static struct platform_device palmtt_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &palmtt_flash_data,
index c7a3b6f365009cd7a3f6fad537e3844241e55022..6641de9257efa047cbf02d94e37506675913c354 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/flash.h>
 
 #include <mach/gpio.h>
+#include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/usb.h>
 #include <plat/dma.h>
@@ -126,10 +127,9 @@ static struct mtd_partition palmz71_rom_partitions[] = {
        },
 };
 
-static struct flash_platform_data palmz71_rom_data = {
-       .map_name       = "map_rom",
-       .name           = "onboardrom",
+static struct physmap_flash_data palmz71_rom_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = palmz71_rom_partitions,
        .nr_parts       = ARRAY_SIZE(palmz71_rom_partitions),
 };
@@ -141,7 +141,7 @@ static struct resource palmz71_rom_resource = {
 };
 
 static struct platform_device palmz71_rom_device = {
-       .name   = "omapflash",
+       .name   = "physmap-flash",
        .id     = -1,
        .dev = {
                .platform_data = &palmz71_rom_data,
index 1387a4f15da9ddea32db967e32699be93d086353..e854d5741c8889daad675ae230bef5848bdcf6fa 100644 (file)
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/input.h>
 #include <linux/smc91x.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/tc.h>
 #include <mach/gpio.h>
 #include <plat/mux.h>
 #include <plat/fpga.h>
+#include <plat/flash.h>
 #include <plat/keypad.h>
 #include <plat/common.h>
 #include <plat/board.h>
@@ -117,9 +118,9 @@ static struct mtd_partition nor_partitions[] = {
        },
 };
 
-static struct flash_platform_data nor_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data nor_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = nor_partitions,
        .nr_parts       = ARRAY_SIZE(nor_partitions),
 };
@@ -131,7 +132,7 @@ static struct resource nor_resource = {
 };
 
 static struct platform_device nor_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &nor_data,
index 7a97fac83d8d10f6131fda3e308f3bc99ee5de6f..2fb1e5f8e2ec5c637a992007123842bf7e48d2f3 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/notifier.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/types.h>
 #include <linux/i2c.h>
 #include <linux/errno.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 <mach/gpio.h>
+#include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/dma.h>
 #include <plat/irda.h>
@@ -287,9 +288,9 @@ static struct mtd_partition sx1_partitions[] = {
        }
 };
 
-static struct flash_platform_data sx1_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data sx1_flash_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
        .parts          = sx1_partitions,
        .nr_parts       = ARRAY_SIZE(sx1_partitions),
 };
@@ -310,7 +311,7 @@ static struct resource sx1_old_flash_resource[] = {
 };
 
 static struct platform_device sx1_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &sx1_flash_data,
@@ -327,7 +328,7 @@ static struct resource sx1_new_flash_resource = {
 };
 
 static struct platform_device sx1_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &sx1_flash_data,
index 169183537997a70153edf212c2f08216631eea4d..87b9436fe7c0c011972fd24b7da43716a5aad5fd 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/irq.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/mtd/physmap.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/serial_8250.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>
 #include <mach/gpio.h>
+#include <plat/flash.h>
 #include <plat/mux.h>
 #include <plat/tc.h>
 #include <plat/usb.h>
@@ -86,9 +87,9 @@ 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 struct physmap_flash_data voiceblue_flash_data = {
        .width          = 2,
+       .set_vpp        = omap1_set_vpp,
 };
 
 static struct resource voiceblue_flash_resource = {
@@ -98,7 +99,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,
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
new file mode 100644 (file)
index 0000000..0b07a78
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Flash support for OMAP1
+ *
+ * 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/mtd.h>
+#include <linux/mtd/map.h>
+
+#include <plat/io.h>
+#include <plat/tc.h>
+
+void omap1_set_vpp(struct map_info *map, int enable)
+{
+       static int count;
+       u32 l;
+
+       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);
+               }
+       }
+}
index 1a619787bd80ff8d90f38ddf14c7659fb0b3cfa0..18497b7a8278f65ad5f6e9c7fb972c45099a809b 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/delay.h>
 #include <linux/i2c/twl.h>
 #include <linux/err.h>
@@ -28,7 +29,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/flash.h>
 
 #include <mach/gpio.h>
 #include <plat/mux.h>
@@ -74,8 +74,7 @@ static struct mtd_partition sdp2430_partitions[] = {
        }
 };
 
-static struct flash_platform_data sdp2430_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data sdp2430_flash_data = {
        .width          = 2,
        .parts          = sdp2430_partitions,
        .nr_parts       = ARRAY_SIZE(sdp2430_partitions),
@@ -88,7 +87,7 @@ static struct resource sdp2430_flash_resource = {
 };
 
 static struct platform_device sdp2430_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev = {
                .platform_data  = &sdp2430_flash_data,
index 5c49c407dd51bd233707a31669b7a5d00c176ff4..0665f2c8dc8e894a1e949baf2a273e7bef104159 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/delay.h>
 #include <linux/workqueue.h>
 #include <linux/i2c.h>
@@ -29,7 +30,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/flash.h>
 
 #include <plat/control.h>
 #include <mach/gpio.h>
@@ -115,8 +115,7 @@ static struct mtd_partition h4_partitions[] = {
        }
 };
 
-static struct flash_platform_data h4_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data h4_flash_data = {
        .width          = 2,
        .parts          = h4_partitions,
        .nr_parts       = ARRAY_SIZE(h4_partitions),
@@ -127,7 +126,7 @@ static struct resource h4_flash_resource = {
 };
 
 static struct platform_device h4_flash_device = {
-       .name           = "omapflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &h4_flash_data,
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/plat-omap/include/plat/flash.h
new file mode 100644 (file)
index 0000000..3e63270
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Flash support for OMAP1
+ *
+ * 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.
+ */
+
+#ifndef __OMAP_FLASH_H
+#define __OMAP_FLASH_H
+
+#include <linux/mtd/map.h>
+
+extern void omap1_set_vpp(struct map_info *map, int enable);
+
+#endif