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>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
23 #include <mach/addr-map.h>
24 #include <mach/mfp-pxa168.h>
25 #include <mach/pxa168.h>
26 #include <mach/irqs.h>
27 #include <video/pxa168fb.h>
28 #include <linux/input.h>
29 #include <plat/pxa27x_keypad.h>
33 static unsigned long common_pin_config[] __initdata = {
34 /* Data Flash Interface */
52 /* Static Memory Controller */
61 GPIO27_GPIO, /* Ethernet IRQ */
112 static struct smc91x_platdata smc91x_info = {
113 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
116 static struct resource smc91x_resources[] = {
118 .start = SMC_CS1_PHYS_BASE + 0x300,
119 .end = SMC_CS1_PHYS_BASE + 0xfffff,
120 .flags = IORESOURCE_MEM,
123 .start = MMP_GPIO_TO_IRQ(27),
124 .end = MMP_GPIO_TO_IRQ(27),
125 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
129 static struct platform_device smc91x_device = {
133 .platform_data = &smc91x_info,
135 .num_resources = ARRAY_SIZE(smc91x_resources),
136 .resource = smc91x_resources,
139 static struct mtd_partition aspenite_nand_partitions[] = {
141 .name = "bootloader",
144 .mask_flags = MTD_WRITEABLE,
147 .offset = MTDPART_OFS_APPEND,
149 .mask_flags = MTD_WRITEABLE,
152 .offset = MTDPART_OFS_APPEND,
154 .mask_flags = MTD_WRITEABLE,
157 .offset = MTDPART_OFS_APPEND,
158 .size = (SZ_2M + SZ_1M),
161 .name = "filesystem",
162 .offset = MTDPART_OFS_APPEND,
163 .size = SZ_32M + SZ_16M,
168 static struct pxa3xx_nand_platform_data aspenite_nand_info = {
171 .parts[0] = aspenite_nand_partitions,
172 .nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
175 static struct i2c_board_info aspenite_i2c_info[] __initdata = {
176 { I2C_BOARD_INFO("wm8753", 0x1b), },
179 static struct fb_videomode video_modes[] = {
191 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
195 struct pxa168fb_mach_info aspenite_lcd_info = {
196 .id = "Graphic Frame",
197 .modes = video_modes,
198 .num_modes = ARRAY_SIZE(video_modes),
199 .pix_fmt = PIX_FMT_RGB565,
200 .io_pin_allocation_mode = PIN_MODE_DUMB_24,
201 .dumb_mode = DUMB_MODE_RGB888,
204 .invert_pixclock = 0,
207 static unsigned int aspenite_matrix_key_map[] = {
208 KEY(0, 6, KEY_UP), /* SW 4 */
209 KEY(0, 7, KEY_DOWN), /* SW 5 */
210 KEY(1, 6, KEY_LEFT), /* SW 6 */
211 KEY(1, 7, KEY_RIGHT), /* SW 7 */
212 KEY(4, 6, KEY_ENTER), /* SW 8 */
213 KEY(4, 7, KEY_ESC), /* SW 9 */
216 static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
217 .matrix_key_rows = 5,
218 .matrix_key_cols = 8,
219 .matrix_key_map = aspenite_matrix_key_map,
220 .matrix_key_map_size = ARRAY_SIZE(aspenite_matrix_key_map),
221 .debounce_interval = 30,
224 static void __init common_init(void)
226 mfp_config(ARRAY_AND_SIZE(common_pin_config));
228 /* on-chip devices */
230 pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info));
232 pxa168_add_nand(&aspenite_nand_info);
233 pxa168_add_fb(&aspenite_lcd_info);
234 pxa168_add_keypad(&aspenite_keypad_info);
235 platform_device_register(&pxa168_device_gpio);
237 /* off-chip devices */
238 platform_device_register(&smc91x_device);
241 MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
242 .map_io = mmp_map_io,
243 .nr_irqs = MMP_NR_IRQS,
244 .init_irq = pxa168_init_irq,
245 .timer = &pxa168_timer,
246 .init_machine = common_init,
247 .restart = pxa168_restart,
250 MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
251 .map_io = mmp_map_io,
252 .nr_irqs = MMP_NR_IRQS,
253 .init_irq = pxa168_init_irq,
254 .timer = &pxa168_timer,
255 .init_machine = common_init,
256 .restart = pxa168_restart,