Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6
[pandora-kernel.git] / arch / arm / mach-mmp / ttc_dkb.c
1 /*
2  *  linux/arch/arm/mach-mmp/ttc_dkb.c
3  *
4  *  Support for the Marvell PXA910-based TTC_DKB Development Platform.
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  *  publishhed by the Free Software Foundation.
9  */
10
11 #include <linux/init.h>
12 #include <linux/kernel.h>
13 #include <linux/platform_device.h>
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mtd/onenand.h>
17 #include <linux/interrupt.h>
18
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/flash.h>
22 #include <mach/addr-map.h>
23 #include <mach/mfp-pxa910.h>
24 #include <mach/pxa910.h>
25
26 #include "common.h"
27
28 #define TTCDKB_NR_IRQS          (IRQ_BOARD_START + 24)
29
30 static unsigned long ttc_dkb_pin_config[] __initdata = {
31         /* UART2 */
32         GPIO47_UART2_RXD,
33         GPIO48_UART2_TXD,
34
35         /* DFI */
36         DF_IO0_ND_IO0,
37         DF_IO1_ND_IO1,
38         DF_IO2_ND_IO2,
39         DF_IO3_ND_IO3,
40         DF_IO4_ND_IO4,
41         DF_IO5_ND_IO5,
42         DF_IO6_ND_IO6,
43         DF_IO7_ND_IO7,
44         DF_IO8_ND_IO8,
45         DF_IO9_ND_IO9,
46         DF_IO10_ND_IO10,
47         DF_IO11_ND_IO11,
48         DF_IO12_ND_IO12,
49         DF_IO13_ND_IO13,
50         DF_IO14_ND_IO14,
51         DF_IO15_ND_IO15,
52         DF_nCS0_SM_nCS2_nCS0,
53         DF_ALE_SM_WEn_ND_ALE,
54         DF_CLE_SM_OEn_ND_CLE,
55         DF_WEn_DF_WEn,
56         DF_REn_DF_REn,
57         DF_RDY0_DF_RDY0,
58 };
59
60 static struct mtd_partition ttc_dkb_onenand_partitions[] = {
61         {
62                 .name           = "bootloader",
63                 .offset         = 0,
64                 .size           = SZ_1M,
65                 .mask_flags     = MTD_WRITEABLE,
66         }, {
67                 .name           = "reserved",
68                 .offset         = MTDPART_OFS_APPEND,
69                 .size           = SZ_128K,
70                 .mask_flags     = MTD_WRITEABLE,
71         }, {
72                 .name           = "reserved",
73                 .offset         = MTDPART_OFS_APPEND,
74                 .size           = SZ_8M,
75                 .mask_flags     = MTD_WRITEABLE,
76         }, {
77                 .name           = "kernel",
78                 .offset         = MTDPART_OFS_APPEND,
79                 .size           = (SZ_2M + SZ_1M),
80                 .mask_flags     = 0,
81         }, {
82                 .name           = "filesystem",
83                 .offset         = MTDPART_OFS_APPEND,
84                 .size           = SZ_48M,
85                 .mask_flags     = 0,
86         }
87 };
88
89 static struct onenand_platform_data ttc_dkb_onenand_info = {
90         .parts          = ttc_dkb_onenand_partitions,
91         .nr_parts       = ARRAY_SIZE(ttc_dkb_onenand_partitions),
92 };
93
94 static struct resource ttc_dkb_resource_onenand[] = {
95         [0] = {
96                 .start  = SMC_CS0_PHYS_BASE,
97                 .end    = SMC_CS0_PHYS_BASE + SZ_1M,
98                 .flags  = IORESOURCE_MEM,
99         },
100 };
101
102 static struct platform_device ttc_dkb_device_onenand = {
103         .name           = "onenand-flash",
104         .id             = -1,
105         .resource       = ttc_dkb_resource_onenand,
106         .num_resources  = ARRAY_SIZE(ttc_dkb_resource_onenand),
107         .dev            = {
108                 .platform_data  = &ttc_dkb_onenand_info,
109         },
110 };
111
112 static struct platform_device *ttc_dkb_devices[] = {
113         &ttc_dkb_device_onenand,
114 };
115
116 static void __init ttc_dkb_init(void)
117 {
118         mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
119
120         /* on-chip devices */
121         pxa910_add_uart(1);
122
123         /* off-chip devices */
124         platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
125 }
126
127 MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
128         .map_io         = mmp_map_io,
129         .nr_irqs        = TTCDKB_NR_IRQS,
130         .init_irq       = pxa910_init_irq,
131         .timer          = &pxa910_timer,
132         .init_machine   = ttc_dkb_init,
133 MACHINE_END