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