]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/board-rx51-flash.c
RX51: Initial support
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-rx51-flash.c
1 /*
2  * linux/arch/arm/mach-omap2/board-rx51-flash.c
3  *
4  * Copyright (C) 2008 Nokia
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/partitions.h>
16 #include <asm/mach/flash.h>
17
18 #include <mach/onenand.h>
19
20 #include "mmc-twl4030.h"
21
22 #define RX51_FLASH_CS   0
23
24 extern struct mtd_partition n800_partitions[ONENAND_MAX_PARTITIONS];
25 extern int n800_onenand_setup(void __iomem *onenand_base, int freq);
26 extern void __init n800_flash_init(void);
27
28 static struct flash_platform_data rx51_flash_data = {
29         .map_name       = "cfi_probe",
30         .width          = 2,
31         .parts          = n800_partitions,
32         .nr_parts       = ARRAY_SIZE(n800_partitions),
33 };
34
35 static struct resource rx51_flash_resource = {
36         .flags          = IORESOURCE_MEM,
37 };
38
39 static struct platform_device rx51_flash_device = {
40         .name           = "omapflash",
41         .id             = 0,
42         .dev            = {
43                 .platform_data  = &rx51_flash_data,
44         },
45         .num_resources  = 1,
46         .resource       = &rx51_flash_resource,
47 };
48
49 static struct platform_device *rx51_flash_devices[] = {
50         &rx51_flash_device,
51 };
52
53 static struct twl4030_hsmmc_info mmc[] __initdata = {
54         {
55                 .mmc            = 1,
56                 .wires          = 8,
57                 .gpio_cd        = 160,
58                 .gpio_wp        = -EINVAL,
59         },
60         {
61                 .mmc            = 2,
62                 .wires          = 8,
63                 .gpio_cd        = -EINVAL,
64                 .gpio_wp        = -EINVAL,
65         },
66         {}      /* Terminator */
67 };
68
69 void __init rx51_flash_init(void)
70 {
71         platform_add_devices(rx51_flash_devices, ARRAY_SIZE(rx51_flash_devices));
72         n800_flash_init();
73         twl4030_mmc_init(mmc);
74 }
75