Commit 19dff119 authored by Komal Shah's avatar Komal Shah Committed by Tony Lindgren

[PATCH] ARM: OMAP: omap24xx Flash support

Flash support for OMAP24xx
Signed-off-by: default avatarKomal Shah <komal_shah802003@yahoo.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 1e281be2
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/arch/gpio.h> #include <asm/arch/gpio.h>
#include <asm/arch/mux.h> #include <asm/arch/mux.h>
...@@ -29,6 +32,60 @@ ...@@ -29,6 +32,60 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/delay.h> #include <asm/delay.h>
static struct mtd_partition h4_partitions[] = {
/* bootloader (U-Boot, etc) in first sector */
{
.name = "bootloader",
.offset = 0,
.size = SZ_128K,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
/* bootloader params in the next sector */
{
.name = "params",
.offset = MTDPART_OFS_APPEND,
.size = SZ_128K,
.mask_flags = 0,
},
/* kernel */
{
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = SZ_2M,
.mask_flags = 0
},
/* file system */
{
.name = "filesystem",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
.mask_flags = 0
}
};
static struct flash_platform_data h4_flash_data = {
.map_name = "cfi_probe",
.width = 2,
.parts = h4_partitions,
.nr_parts = ARRAY_SIZE(h4_partitions),
};
static struct resource h4_flash_resource = {
.start = H4_CS0_BASE,
.end = H4_CS0_BASE + SZ_64M - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device h4_flash_device = {
.name = "omapflash",
.id = 0,
.dev = {
.platform_data = &h4_flash_data,
},
.num_resources = 1,
.resource = &h4_flash_resource,
};
static struct resource h4_smc91x_resources[] = { static struct resource h4_smc91x_resources[] = {
[0] = { [0] = {
.start = OMAP24XX_ETHR_START, /* Physical */ .start = OMAP24XX_ETHR_START, /* Physical */
...@@ -51,6 +108,7 @@ static struct platform_device h4_smc91x_device = { ...@@ -51,6 +108,7 @@ static struct platform_device h4_smc91x_device = {
static struct platform_device *h4_devices[] __initdata = { static struct platform_device *h4_devices[] __initdata = {
&h4_smc91x_device, &h4_smc91x_device,
&h4_flash_device,
}; };
static inline void __init h4_init_smc91x(void) static inline void __init h4_init_smc91x(void)
......
...@@ -59,6 +59,7 @@ static void omap_set_vpp(struct map_info *map, int enable) ...@@ -59,6 +59,7 @@ static void omap_set_vpp(struct map_info *map, int enable)
{ {
static int count; static int count;
if (!cpu_is_omap24xx()) {
if (enable) { if (enable) {
if (count++ == 0) if (count++ == 0)
OMAP_EMIFS_CONFIG_REG |= OMAP_EMIFS_CONFIG_WP; OMAP_EMIFS_CONFIG_REG |= OMAP_EMIFS_CONFIG_WP;
...@@ -66,6 +67,7 @@ static void omap_set_vpp(struct map_info *map, int enable) ...@@ -66,6 +67,7 @@ static void omap_set_vpp(struct map_info *map, int enable)
if (count && (--count == 0)) if (count && (--count == 0))
OMAP_EMIFS_CONFIG_REG &= ~OMAP_EMIFS_CONFIG_WP; OMAP_EMIFS_CONFIG_REG &= ~OMAP_EMIFS_CONFIG_WP;
} }
}
} }
static int __devinit omapflash_probe(struct device *dev) static int __devinit omapflash_probe(struct device *dev)
......
...@@ -34,5 +34,7 @@ ...@@ -34,5 +34,7 @@
#define OMAP24XX_ETHR_START 0x08000300 #define OMAP24XX_ETHR_START 0x08000300
#define OMAP24XX_ETHR_GPIO_IRQ 92 #define OMAP24XX_ETHR_GPIO_IRQ 92
#define H4_CS0_BASE 0x04000000
#endif /* __ASM_ARCH_OMAP_H4_H */ #endif /* __ASM_ARCH_OMAP_H4_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment