aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da850-evm.c
diff options
context:
space:
mode:
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 @@
22#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
23#include <linux/mtd/nand.h> 23#include <linux/mtd/nand.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h>
25 26
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -41,6 +42,39 @@
41#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) 42#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
42#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) 43#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
43 44
45static struct mtd_partition da850_evm_norflash_partition[] = {
46 {
47 .name = "NOR filesystem",
48 .offset = 0,
49 .size = MTDPART_SIZ_FULL,
50 .mask_flags = 0,
51 },
52};
53
54static struct physmap_flash_data da850_evm_norflash_data = {
55 .width = 2,
56 .parts = da850_evm_norflash_partition,
57 .nr_parts = ARRAY_SIZE(da850_evm_norflash_partition),
58};
59
60static struct resource da850_evm_norflash_resource[] = {
61 {
62 .start = DA8XX_AEMIF_CS2_BASE,
63 .end = DA8XX_AEMIF_CS2_BASE + SZ_32M - 1,
64 .flags = IORESOURCE_MEM,
65 },
66};
67
68static struct platform_device da850_evm_norflash_device = {
69 .name = "physmap-flash",
70 .id = 0,
71 .dev = {
72 .platform_data = &da850_evm_norflash_data,
73 },
74 .num_resources = 1,
75 .resource = da850_evm_norflash_resource,
76};
77
44/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash 78/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
45 * (128K blocks). It may be used instead of the (default) SPI flash 79 * (128K blocks). It may be used instead of the (default) SPI flash
46 * to boot, using TI's tools to install the secondary boot loader 80 * 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 = {
120 154
121static struct platform_device *da850_evm_devices[] __initdata = { 155static struct platform_device *da850_evm_devices[] __initdata = {
122 &da850_evm_nandflash_device, 156 &da850_evm_nandflash_device,
157 &da850_evm_norflash_device,
123}; 158};
124 159
125/* davinci da850 evm audio machine driver */ 160/* davinci da850 evm audio machine driver */
@@ -192,6 +227,23 @@ static int da850_lcd_hw_init(void)
192 return 0; 227 return 0;
193} 228}
194 229
230#define DA8XX_AEMIF_CE2CFG_OFFSET 0x10
231#define DA8XX_AEMIF_ASIZE_16BIT 0x1
232
233static void __init da850_evm_init_nor(void)
234{
235 void __iomem *aemif_addr;
236
237 aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
238
239 /* Configure data bus width of CS2 to 16 bit */
240 writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
241 DA8XX_AEMIF_ASIZE_16BIT,
242 aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
243
244 iounmap(aemif_addr);
245}
246
195static __init void da850_evm_init(void) 247static __init void da850_evm_init(void)
196{ 248{
197 struct davinci_soc_info *soc_info = &davinci_soc_info; 249 struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -202,6 +254,13 @@ static __init void da850_evm_init(void)
202 pr_warning("da850_evm_init: nand mux setup failed: %d\n", 254 pr_warning("da850_evm_init: nand mux setup failed: %d\n",
203 ret); 255 ret);
204 256
257 ret = da8xx_pinmux_setup(da850_nor_pins);
258 if (ret)
259 pr_warning("da850_evm_init: nor mux setup failed: %d\n",
260 ret);
261
262 da850_evm_init_nor();
263
205 platform_add_devices(da850_evm_devices, 264 platform_add_devices(da850_evm_devices,
206 ARRAY_SIZE(da850_evm_devices)); 265 ARRAY_SIZE(da850_evm_devices));
207 266