aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da850-evm.c
diff options
context:
space:
mode:
authorSudhakar Rajashekhara <sudhakar.raj@ti.com>2009-08-13 17:36:25 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-08-26 11:55:56 +0300
commit7c5ec6095a7d29c89ee050281faa068a374a5ac6 (patch)
tree5ac3611c87a80e6c48fd3dbc39fbd562af624050 /arch/arm/mach-davinci/board-da850-evm.c
parentdavinci: Add NAND flash support for DA850/OMAP-L138 (diff)
downloadlinux-dev-7c5ec6095a7d29c89ee050281faa068a374a5ac6.tar.xz
linux-dev-7c5ec6095a7d29c89ee050281faa068a374a5ac6.zip
davinci: Add NOR flash support for da850/omap-l138
This patch adds platform data for the 8MB NOR flash found on da850/omap-l138 EVM. Both NOR and NAND can co-exist on da850/omap-l138 as they are using different chip selects. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-da850-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 62d37cb6f29d..70a2f487da95 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -22,6 +22,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -41,6 +42,39 @@
#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
+static struct mtd_partition da850_evm_norflash_partition[] = {
+ {
+ .name = "NOR filesystem",
+ .offset = 0,
+ .size = MTDPART_SIZ_FULL,
+ .mask_flags = 0,
+ },
+};
+
+static struct physmap_flash_data da850_evm_norflash_data = {
+ .width = 2,
+ .parts = da850_evm_norflash_partition,
+ .nr_parts = ARRAY_SIZE(da850_evm_norflash_partition),
+};
+
+static struct resource da850_evm_norflash_resource[] = {
+ {
+ .start = DA8XX_AEMIF_CS2_BASE,
+ .end = DA8XX_AEMIF_CS2_BASE + SZ_32M - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device da850_evm_norflash_device = {
+ .name = "physmap-flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &da850_evm_norflash_data,
+ },
+ .num_resources = 1,
+ .resource = da850_evm_norflash_resource,
+};
+
/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
* (128K blocks). It may be used instead of the (default) SPI flash
* to boot, using TI's tools to install the secondary boot loader
@@ -120,6 +154,7 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = {
static struct platform_device *da850_evm_devices[] __initdata = {
&da850_evm_nandflash_device,
+ &da850_evm_norflash_device,
};
/* davinci da850 evm audio machine driver */
@@ -192,6 +227,23 @@ static int da850_lcd_hw_init(void)
return 0;
}
+#define DA8XX_AEMIF_CE2CFG_OFFSET 0x10
+#define DA8XX_AEMIF_ASIZE_16BIT 0x1
+
+static void __init da850_evm_init_nor(void)
+{
+ void __iomem *aemif_addr;
+
+ aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
+
+ /* Configure data bus width of CS2 to 16 bit */
+ writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
+ DA8XX_AEMIF_ASIZE_16BIT,
+ aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
+
+ iounmap(aemif_addr);
+}
+
static __init void da850_evm_init(void)
{
struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -202,6 +254,13 @@ static __init void da850_evm_init(void)
pr_warning("da850_evm_init: nand mux setup failed: %d\n",
ret);
+ ret = da8xx_pinmux_setup(da850_nor_pins);
+ if (ret)
+ pr_warning("da850_evm_init: nor mux setup failed: %d\n",
+ ret);
+
+ da850_evm_init_nor();
+
platform_add_devices(da850_evm_devices,
ARRAY_SIZE(da850_evm_devices));