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>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/flash.h>
24 #include <mach/addr-map.h>
25 #include <mach/mfp-pxa910.h>
26 #include <mach/pxa910.h>
27 #include <mach/irqs.h>
31 #define TTCDKB_GPIO_EXT0(x) (MMP_NR_BUILTIN_GPIO + ((x < 0) ? 0 : \
33 #define TTCDKB_GPIO_EXT1(x) (MMP_NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \
37 * 16 board interrupts -- MAX7312 GPIO expander
38 * 16 board interrupts -- PCA9575 GPIO expander
39 * 24 board interrupts -- 88PM860x PMIC
41 #define TTCDKB_NR_IRQS (IRQ_BOARD_START + 16 + 16 + 24)
43 static unsigned long ttc_dkb_pin_config
[] __initdata
= {
73 static struct mtd_partition ttc_dkb_onenand_partitions
[] = {
78 .mask_flags
= MTD_WRITEABLE
,
81 .offset
= MTDPART_OFS_APPEND
,
83 .mask_flags
= MTD_WRITEABLE
,
86 .offset
= MTDPART_OFS_APPEND
,
88 .mask_flags
= MTD_WRITEABLE
,
91 .offset
= MTDPART_OFS_APPEND
,
92 .size
= (SZ_2M
+ SZ_1M
),
96 .offset
= MTDPART_OFS_APPEND
,
97 .size
= SZ_32M
+ SZ_16M
,
102 static struct onenand_platform_data ttc_dkb_onenand_info
= {
103 .parts
= ttc_dkb_onenand_partitions
,
104 .nr_parts
= ARRAY_SIZE(ttc_dkb_onenand_partitions
),
107 static struct resource ttc_dkb_resource_onenand
[] = {
109 .start
= SMC_CS0_PHYS_BASE
,
110 .end
= SMC_CS0_PHYS_BASE
+ SZ_1M
,
111 .flags
= IORESOURCE_MEM
,
115 static struct platform_device ttc_dkb_device_onenand
= {
116 .name
= "onenand-flash",
118 .resource
= ttc_dkb_resource_onenand
,
119 .num_resources
= ARRAY_SIZE(ttc_dkb_resource_onenand
),
121 .platform_data
= &ttc_dkb_onenand_info
,
125 static struct platform_device
*ttc_dkb_devices
[] = {
127 &ttc_dkb_device_onenand
,
130 static struct pca953x_platform_data max7312_data
[] = {
132 .gpio_base
= TTCDKB_GPIO_EXT0(0),
133 .irq_base
= IRQ_BOARD_START
,
137 static struct i2c_board_info ttc_dkb_i2c_info
[] = {
141 .irq
= MMP_GPIO_TO_IRQ(80),
142 .platform_data
= &max7312_data
,
146 static void __init
ttc_dkb_init(void)
148 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config
));
150 /* on-chip devices */
153 /* off-chip devices */
154 pxa910_add_twsi(0, NULL
, ARRAY_AND_SIZE(ttc_dkb_i2c_info
));
155 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices
));
158 MACHINE_START(TTC_DKB
, "PXA910-based TTC_DKB Development Platform")
159 .map_io
= mmp_map_io
,
160 .nr_irqs
= TTCDKB_NR_IRQS
,
161 .init_irq
= pxa910_init_irq
,
162 .timer
= &pxa910_timer
,
163 .init_machine
= ttc_dkb_init
,
164 .restart
= mmp_restart
,