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/platform_data/mv_usb.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/flash.h>
25 #include <mach/addr-map.h>
26 #include <mach/mfp-pxa910.h>
27 #include <mach/pxa910.h>
28 #include <mach/irqs.h>
29 #include <mach/regs-usb.h>
33 #define TTCDKB_GPIO_EXT0(x) (MMP_NR_BUILTIN_GPIO + ((x < 0) ? 0 : \
35 #define TTCDKB_GPIO_EXT1(x) (MMP_NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \
39 * 16 board interrupts -- MAX7312 GPIO expander
40 * 16 board interrupts -- PCA9575 GPIO expander
41 * 24 board interrupts -- 88PM860x PMIC
43 #define TTCDKB_NR_IRQS (MMP_NR_IRQS + 16 + 16 + 24)
45 static unsigned long ttc_dkb_pin_config[] __initdata = {
75 static struct mtd_partition ttc_dkb_onenand_partitions[] = {
80 .mask_flags = MTD_WRITEABLE,
83 .offset = MTDPART_OFS_APPEND,
85 .mask_flags = MTD_WRITEABLE,
88 .offset = MTDPART_OFS_APPEND,
90 .mask_flags = MTD_WRITEABLE,
93 .offset = MTDPART_OFS_APPEND,
94 .size = (SZ_2M + SZ_1M),
98 .offset = MTDPART_OFS_APPEND,
99 .size = SZ_32M + SZ_16M,
104 static struct onenand_platform_data ttc_dkb_onenand_info = {
105 .parts = ttc_dkb_onenand_partitions,
106 .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions),
109 static struct resource ttc_dkb_resource_onenand[] = {
111 .start = SMC_CS0_PHYS_BASE,
112 .end = SMC_CS0_PHYS_BASE + SZ_1M,
113 .flags = IORESOURCE_MEM,
117 static struct platform_device ttc_dkb_device_onenand = {
118 .name = "onenand-flash",
120 .resource = ttc_dkb_resource_onenand,
121 .num_resources = ARRAY_SIZE(ttc_dkb_resource_onenand),
123 .platform_data = &ttc_dkb_onenand_info,
127 static struct platform_device *ttc_dkb_devices[] = {
130 &ttc_dkb_device_onenand,
133 static struct pca953x_platform_data max7312_data[] = {
135 .gpio_base = TTCDKB_GPIO_EXT0(0),
136 .irq_base = MMP_NR_IRQS,
140 static struct i2c_board_info ttc_dkb_i2c_info[] = {
144 .irq = MMP_GPIO_TO_IRQ(80),
145 .platform_data = &max7312_data,
149 #ifdef CONFIG_USB_SUPPORT
150 #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
152 static char *pxa910_usb_clock_name[] = {
156 static struct mv_usb_platform_data ttc_usb_pdata = {
158 .clkname = pxa910_usb_clock_name,
160 .mode = MV_USB_MODE_OTG,
161 .otg_force_a_bus_req = 1,
162 .phy_init = pxa_usb_phy_init,
163 .phy_deinit = pxa_usb_phy_deinit,
169 static void __init ttc_dkb_init(void)
171 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
173 /* on-chip devices */
176 /* off-chip devices */
177 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
178 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
180 #ifdef CONFIG_USB_MV_UDC
181 pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata;
182 platform_device_register(&pxa168_device_u2o);
185 #ifdef CONFIG_USB_EHCI_MV_U2O
186 pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata;
187 platform_device_register(&pxa168_device_u2oehci);
190 #ifdef CONFIG_USB_MV_OTG
191 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
192 platform_device_register(&pxa168_device_u2ootg);
196 MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
197 .map_io = mmp_map_io,
198 .nr_irqs = TTCDKB_NR_IRQS,
199 .init_irq = pxa910_init_irq,
200 .timer = &pxa910_timer,
201 .init_machine = ttc_dkb_init,
202 .restart = mmp_restart,