2 * linux/arch/arm/mach-mmp/aspenite.c
4 * Support for the Marvell PXA168-based Aspenite and Zylonite2
5 * Development Platform.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * publishhed by the Free Software Foundation.
11 #include <linux/gpio.h>
12 #include <linux/gpio-pxa.h>
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/platform_device.h>
16 #include <linux/smc91x.h>
17 #include <linux/mtd/mtd.h>
18 #include <linux/mtd/partitions.h>
19 #include <linux/mtd/nand.h>
20 #include <linux/interrupt.h>
21 #include <linux/platform_data/mv_usb.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <mach/addr-map.h>
26 #include <mach/mfp-pxa168.h>
27 #include <mach/pxa168.h>
28 #include <mach/irqs.h>
29 #include <video/pxa168fb.h>
30 #include <linux/input.h>
31 #include <linux/platform_data/keypad-pxa27x.h>
35 static unsigned long common_pin_config
[] __initdata
= {
36 /* Data Flash Interface */
54 /* Static Memory Controller */
63 GPIO27_GPIO
, /* Ethernet IRQ */
114 static struct pxa_gpio_platform_data pxa168_gpio_pdata
= {
115 .irq_base
= MMP_GPIO_TO_IRQ(0),
118 static struct smc91x_platdata smc91x_info
= {
119 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
122 static struct resource smc91x_resources
[] = {
124 .start
= SMC_CS1_PHYS_BASE
+ 0x300,
125 .end
= SMC_CS1_PHYS_BASE
+ 0xfffff,
126 .flags
= IORESOURCE_MEM
,
129 .start
= MMP_GPIO_TO_IRQ(27),
130 .end
= MMP_GPIO_TO_IRQ(27),
131 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
,
135 static struct platform_device smc91x_device
= {
139 .platform_data
= &smc91x_info
,
141 .num_resources
= ARRAY_SIZE(smc91x_resources
),
142 .resource
= smc91x_resources
,
145 static struct mtd_partition aspenite_nand_partitions
[] = {
147 .name
= "bootloader",
150 .mask_flags
= MTD_WRITEABLE
,
153 .offset
= MTDPART_OFS_APPEND
,
155 .mask_flags
= MTD_WRITEABLE
,
158 .offset
= MTDPART_OFS_APPEND
,
160 .mask_flags
= MTD_WRITEABLE
,
163 .offset
= MTDPART_OFS_APPEND
,
164 .size
= (SZ_2M
+ SZ_1M
),
167 .name
= "filesystem",
168 .offset
= MTDPART_OFS_APPEND
,
169 .size
= SZ_32M
+ SZ_16M
,
174 static struct pxa3xx_nand_platform_data aspenite_nand_info
= {
177 .parts
[0] = aspenite_nand_partitions
,
178 .nr_parts
[0] = ARRAY_SIZE(aspenite_nand_partitions
),
181 static struct i2c_board_info aspenite_i2c_info
[] __initdata
= {
182 { I2C_BOARD_INFO("wm8753", 0x1b), },
185 static struct fb_videomode video_modes
[] = {
197 .sync
= FB_SYNC_VERT_HIGH_ACT
| FB_SYNC_HOR_HIGH_ACT
,
201 struct pxa168fb_mach_info aspenite_lcd_info
= {
202 .id
= "Graphic Frame",
203 .modes
= video_modes
,
204 .num_modes
= ARRAY_SIZE(video_modes
),
205 .pix_fmt
= PIX_FMT_RGB565
,
206 .io_pin_allocation_mode
= PIN_MODE_DUMB_24
,
207 .dumb_mode
= DUMB_MODE_RGB888
,
210 .invert_pixclock
= 0,
213 static unsigned int aspenite_matrix_key_map
[] = {
214 KEY(0, 6, KEY_UP
), /* SW 4 */
215 KEY(0, 7, KEY_DOWN
), /* SW 5 */
216 KEY(1, 6, KEY_LEFT
), /* SW 6 */
217 KEY(1, 7, KEY_RIGHT
), /* SW 7 */
218 KEY(4, 6, KEY_ENTER
), /* SW 8 */
219 KEY(4, 7, KEY_ESC
), /* SW 9 */
222 static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata
= {
223 .matrix_key_rows
= 5,
224 .matrix_key_cols
= 8,
225 .matrix_key_map
= aspenite_matrix_key_map
,
226 .matrix_key_map_size
= ARRAY_SIZE(aspenite_matrix_key_map
),
227 .debounce_interval
= 30,
230 #if defined(CONFIG_USB_EHCI_MV)
231 static struct mv_usb_platform_data pxa168_sph_pdata
= {
232 .mode
= MV_USB_MODE_HOST
,
233 .phy_init
= pxa_usb_phy_init
,
234 .phy_deinit
= pxa_usb_phy_deinit
,
239 static void __init
common_init(void)
241 mfp_config(ARRAY_AND_SIZE(common_pin_config
));
243 /* on-chip devices */
245 pxa168_add_twsi(1, NULL
, ARRAY_AND_SIZE(aspenite_i2c_info
));
247 pxa168_add_nand(&aspenite_nand_info
);
248 pxa168_add_fb(&aspenite_lcd_info
);
249 pxa168_add_keypad(&aspenite_keypad_info
);
250 platform_device_add_data(&pxa168_device_gpio
, &pxa168_gpio_pdata
,
251 sizeof(struct pxa_gpio_platform_data
));
252 platform_device_register(&pxa168_device_gpio
);
254 /* off-chip devices */
255 platform_device_register(&smc91x_device
);
257 #if defined(CONFIG_USB_EHCI_MV)
258 pxa168_add_usb_host(&pxa168_sph_pdata
);
262 MACHINE_START(ASPENITE
, "PXA168-based Aspenite Development Platform")
263 .map_io
= mmp_map_io
,
264 .nr_irqs
= MMP_NR_IRQS
,
265 .init_irq
= pxa168_init_irq
,
266 .init_time
= pxa168_timer_init
,
267 .init_machine
= common_init
,
268 .restart
= pxa168_restart
,
271 MACHINE_START(ZYLONITE2
, "PXA168-based Zylonite2 Development Platform")
272 .map_io
= mmp_map_io
,
273 .nr_irqs
= MMP_NR_IRQS
,
274 .init_irq
= pxa168_init_irq
,
275 .init_time
= pxa168_timer_init
,
276 .init_machine
= common_init
,
277 .restart
= pxa168_restart
,