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/init.h>
13 #include <linux/kernel.h>
14 #include <linux/platform_device.h>
15 #include <linux/smc91x.h>
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/partitions.h>
18 #include <linux/mtd/nand.h>
19 #include <linux/interrupt.h>
20 #include <linux/platform_data/mv_usb.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <mach/addr-map.h>
25 #include <mach/mfp-pxa168.h>
26 #include <mach/pxa168.h>
27 #include <mach/irqs.h>
28 #include <video/pxa168fb.h>
29 #include <linux/input.h>
30 #include <plat/pxa27x_keypad.h>
34 static unsigned long common_pin_config[] __initdata = {
35 /* Data Flash Interface */
53 /* Static Memory Controller */
62 GPIO27_GPIO, /* Ethernet IRQ */
113 static struct smc91x_platdata smc91x_info = {
114 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
117 static struct resource smc91x_resources[] = {
119 .start = SMC_CS1_PHYS_BASE + 0x300,
120 .end = SMC_CS1_PHYS_BASE + 0xfffff,
121 .flags = IORESOURCE_MEM,
124 .start = MMP_GPIO_TO_IRQ(27),
125 .end = MMP_GPIO_TO_IRQ(27),
126 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
130 static struct platform_device smc91x_device = {
134 .platform_data = &smc91x_info,
136 .num_resources = ARRAY_SIZE(smc91x_resources),
137 .resource = smc91x_resources,
140 static struct mtd_partition aspenite_nand_partitions[] = {
142 .name = "bootloader",
145 .mask_flags = MTD_WRITEABLE,
148 .offset = MTDPART_OFS_APPEND,
150 .mask_flags = MTD_WRITEABLE,
153 .offset = MTDPART_OFS_APPEND,
155 .mask_flags = MTD_WRITEABLE,
158 .offset = MTDPART_OFS_APPEND,
159 .size = (SZ_2M + SZ_1M),
162 .name = "filesystem",
163 .offset = MTDPART_OFS_APPEND,
164 .size = SZ_32M + SZ_16M,
169 static struct pxa3xx_nand_platform_data aspenite_nand_info = {
172 .parts[0] = aspenite_nand_partitions,
173 .nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
176 static struct i2c_board_info aspenite_i2c_info[] __initdata = {
177 { I2C_BOARD_INFO("wm8753", 0x1b), },
180 static struct fb_videomode video_modes[] = {
192 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
196 struct pxa168fb_mach_info aspenite_lcd_info = {
197 .id = "Graphic Frame",
198 .modes = video_modes,
199 .num_modes = ARRAY_SIZE(video_modes),
200 .pix_fmt = PIX_FMT_RGB565,
201 .io_pin_allocation_mode = PIN_MODE_DUMB_24,
202 .dumb_mode = DUMB_MODE_RGB888,
205 .invert_pixclock = 0,
208 static unsigned int aspenite_matrix_key_map[] = {
209 KEY(0, 6, KEY_UP), /* SW 4 */
210 KEY(0, 7, KEY_DOWN), /* SW 5 */
211 KEY(1, 6, KEY_LEFT), /* SW 6 */
212 KEY(1, 7, KEY_RIGHT), /* SW 7 */
213 KEY(4, 6, KEY_ENTER), /* SW 8 */
214 KEY(4, 7, KEY_ESC), /* SW 9 */
217 static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
218 .matrix_key_rows = 5,
219 .matrix_key_cols = 8,
220 .matrix_key_map = aspenite_matrix_key_map,
221 .matrix_key_map_size = ARRAY_SIZE(aspenite_matrix_key_map),
222 .debounce_interval = 30,
225 #if defined(CONFIG_USB_EHCI_MV)
226 static char *pxa168_sph_clock_name[] = {
227 [0] = "PXA168-USBCLK",
230 static struct mv_usb_platform_data pxa168_sph_pdata = {
232 .clkname = pxa168_sph_clock_name,
233 .mode = MV_USB_MODE_HOST,
234 .phy_init = pxa_usb_phy_init,
235 .phy_deinit = pxa_usb_phy_deinit,
240 static void __init common_init(void)
242 mfp_config(ARRAY_AND_SIZE(common_pin_config));
244 /* on-chip devices */
246 pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info));
248 pxa168_add_nand(&aspenite_nand_info);
249 pxa168_add_fb(&aspenite_lcd_info);
250 pxa168_add_keypad(&aspenite_keypad_info);
251 platform_device_register(&pxa168_device_gpio);
253 /* off-chip devices */
254 platform_device_register(&smc91x_device);
256 #if defined(CONFIG_USB_EHCI_MV)
257 pxa168_add_usb_host(&pxa168_sph_pdata);
261 MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
262 .map_io = mmp_map_io,
263 .nr_irqs = MMP_NR_IRQS,
264 .init_irq = pxa168_init_irq,
265 .timer = &pxa168_timer,
266 .init_machine = common_init,
267 .restart = pxa168_restart,
270 MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
271 .map_io = mmp_map_io,
272 .nr_irqs = MMP_NR_IRQS,
273 .init_irq = pxa168_init_irq,
274 .timer = &pxa168_timer,
275 .init_machine = common_init,
276 .restart = pxa168_restart,