2 * linux/arch/arm/mach-mmp/ttc_dkb.c
4 * Support for the Marvell PXA910-based TTC_DKB Development Platform.
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.
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 #include <linux/i2c/pca953x.h>
19 #include <linux/gpio.h>
20 #include <linux/mfd/88pm860x.h>
21 #include <linux/platform_data/mv_usb.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/flash.h>
26 #include <mach/addr-map.h>
27 #include <mach/mfp-pxa910.h>
28 #include <mach/pxa910.h>
29 #include <mach/irqs.h>
30 #include <mach/regs-usb.h>
34 #define TTCDKB_GPIO_EXT0(x) (MMP_NR_BUILTIN_GPIO + ((x < 0) ? 0 : \
36 #define TTCDKB_GPIO_EXT1(x) (MMP_NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \
40 * 16 board interrupts -- MAX7312 GPIO expander
41 * 16 board interrupts -- PCA9575 GPIO expander
42 * 24 board interrupts -- 88PM860x PMIC
44 #define TTCDKB_NR_IRQS (MMP_NR_IRQS + 16 + 16 + 24)
46 static unsigned long ttc_dkb_pin_config
[] __initdata
= {
76 static struct mtd_partition ttc_dkb_onenand_partitions
[] = {
81 .mask_flags
= MTD_WRITEABLE
,
84 .offset
= MTDPART_OFS_APPEND
,
86 .mask_flags
= MTD_WRITEABLE
,
89 .offset
= MTDPART_OFS_APPEND
,
91 .mask_flags
= MTD_WRITEABLE
,
94 .offset
= MTDPART_OFS_APPEND
,
95 .size
= (SZ_2M
+ SZ_1M
),
99 .offset
= MTDPART_OFS_APPEND
,
100 .size
= SZ_32M
+ SZ_16M
,
105 static struct onenand_platform_data ttc_dkb_onenand_info
= {
106 .parts
= ttc_dkb_onenand_partitions
,
107 .nr_parts
= ARRAY_SIZE(ttc_dkb_onenand_partitions
),
110 static struct resource ttc_dkb_resource_onenand
[] = {
112 .start
= SMC_CS0_PHYS_BASE
,
113 .end
= SMC_CS0_PHYS_BASE
+ SZ_1M
,
114 .flags
= IORESOURCE_MEM
,
118 static struct platform_device ttc_dkb_device_onenand
= {
119 .name
= "onenand-flash",
121 .resource
= ttc_dkb_resource_onenand
,
122 .num_resources
= ARRAY_SIZE(ttc_dkb_resource_onenand
),
124 .platform_data
= &ttc_dkb_onenand_info
,
128 static struct platform_device
*ttc_dkb_devices
[] = {
131 &ttc_dkb_device_onenand
,
134 static struct pca953x_platform_data max7312_data
[] = {
136 .gpio_base
= TTCDKB_GPIO_EXT0(0),
137 .irq_base
= MMP_NR_IRQS
,
141 static struct pm860x_platform_data ttc_dkb_pm8607_info
= {
142 .irq_base
= IRQ_BOARD_START
,
145 static struct i2c_board_info ttc_dkb_i2c_info
[] = {
149 .platform_data
= &ttc_dkb_pm8607_info
,
150 .irq
= IRQ_PXA910_PMIC_INT
,
155 .irq
= MMP_GPIO_TO_IRQ(80),
156 .platform_data
= &max7312_data
,
160 #ifdef CONFIG_USB_SUPPORT
161 #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
163 static char *pxa910_usb_clock_name
[] = {
167 static struct mv_usb_platform_data ttc_usb_pdata
= {
169 .clkname
= pxa910_usb_clock_name
,
171 .mode
= MV_USB_MODE_OTG
,
172 .otg_force_a_bus_req
= 1,
173 .phy_init
= pxa_usb_phy_init
,
174 .phy_deinit
= pxa_usb_phy_deinit
,
180 #ifdef CONFIG_MTD_NAND_PXA3xx
181 static struct pxa3xx_nand_platform_data dkb_nand_info
= {
187 static void __init
ttc_dkb_init(void)
189 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config
));
191 /* on-chip devices */
193 #ifdef CONFIG_MTD_NAND_PXA3xx
194 pxa910_add_nand(&dkb_nand_info
);
197 /* off-chip devices */
198 pxa910_add_twsi(0, NULL
, ARRAY_AND_SIZE(ttc_dkb_i2c_info
));
199 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices
));
201 #ifdef CONFIG_USB_MV_UDC
202 pxa168_device_u2o
.dev
.platform_data
= &ttc_usb_pdata
;
203 platform_device_register(&pxa168_device_u2o
);
206 #ifdef CONFIG_USB_EHCI_MV_U2O
207 pxa168_device_u2oehci
.dev
.platform_data
= &ttc_usb_pdata
;
208 platform_device_register(&pxa168_device_u2oehci
);
211 #ifdef CONFIG_USB_MV_OTG
212 pxa168_device_u2ootg
.dev
.platform_data
= &ttc_usb_pdata
;
213 platform_device_register(&pxa168_device_u2ootg
);
217 MACHINE_START(TTC_DKB
, "PXA910-based TTC_DKB Development Platform")
218 .map_io
= mmp_map_io
,
219 .nr_irqs
= TTCDKB_NR_IRQS
,
220 .init_irq
= pxa910_init_irq
,
221 .timer
= &pxa910_timer
,
222 .init_machine
= ttc_dkb_init
,
223 .restart
= mmp_restart
,