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 <video/pxa168fb.h>
27 #include <linux/input.h>
28 #include <plat/pxa27x_keypad.h>
32 static unsigned long common_pin_config
[] __initdata
= {
33 /* Data Flash Interface */
51 /* Static Memory Controller */
60 GPIO27_GPIO
, /* Ethernet IRQ */
111 static struct smc91x_platdata smc91x_info
= {
112 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
115 static struct resource smc91x_resources
[] = {
117 .start
= SMC_CS1_PHYS_BASE
+ 0x300,
118 .end
= SMC_CS1_PHYS_BASE
+ 0xfffff,
119 .flags
= IORESOURCE_MEM
,
122 .start
= gpio_to_irq(27),
123 .end
= gpio_to_irq(27),
124 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
,
128 static struct platform_device smc91x_device
= {
132 .platform_data
= &smc91x_info
,
134 .num_resources
= ARRAY_SIZE(smc91x_resources
),
135 .resource
= smc91x_resources
,
138 static struct mtd_partition aspenite_nand_partitions
[] = {
140 .name
= "bootloader",
143 .mask_flags
= MTD_WRITEABLE
,
146 .offset
= MTDPART_OFS_APPEND
,
148 .mask_flags
= MTD_WRITEABLE
,
151 .offset
= MTDPART_OFS_APPEND
,
153 .mask_flags
= MTD_WRITEABLE
,
156 .offset
= MTDPART_OFS_APPEND
,
157 .size
= (SZ_2M
+ SZ_1M
),
160 .name
= "filesystem",
161 .offset
= MTDPART_OFS_APPEND
,
162 .size
= SZ_32M
+ SZ_16M
,
167 static struct pxa3xx_nand_platform_data aspenite_nand_info
= {
170 .parts
[0] = aspenite_nand_partitions
,
171 .nr_parts
[0] = ARRAY_SIZE(aspenite_nand_partitions
),
174 static struct i2c_board_info aspenite_i2c_info
[] __initdata
= {
175 { I2C_BOARD_INFO("wm8753", 0x1b), },
178 static struct fb_videomode video_modes
[] = {
190 .sync
= FB_SYNC_VERT_HIGH_ACT
| FB_SYNC_HOR_HIGH_ACT
,
194 struct pxa168fb_mach_info aspenite_lcd_info
= {
195 .id
= "Graphic Frame",
196 .modes
= video_modes
,
197 .num_modes
= ARRAY_SIZE(video_modes
),
198 .pix_fmt
= PIX_FMT_RGB565
,
199 .io_pin_allocation_mode
= PIN_MODE_DUMB_24
,
200 .dumb_mode
= DUMB_MODE_RGB888
,
203 .invert_pixclock
= 0,
206 static unsigned int aspenite_matrix_key_map
[] = {
207 KEY(0, 6, KEY_UP
), /* SW 4 */
208 KEY(0, 7, KEY_DOWN
), /* SW 5 */
209 KEY(1, 6, KEY_LEFT
), /* SW 6 */
210 KEY(1, 7, KEY_RIGHT
), /* SW 7 */
211 KEY(4, 6, KEY_ENTER
), /* SW 8 */
212 KEY(4, 7, KEY_ESC
), /* SW 9 */
215 static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata
= {
216 .matrix_key_rows
= 5,
217 .matrix_key_cols
= 8,
218 .matrix_key_map
= aspenite_matrix_key_map
,
219 .matrix_key_map_size
= ARRAY_SIZE(aspenite_matrix_key_map
),
220 .debounce_interval
= 30,
223 static void __init
common_init(void)
225 mfp_config(ARRAY_AND_SIZE(common_pin_config
));
227 /* on-chip devices */
229 pxa168_add_twsi(1, NULL
, ARRAY_AND_SIZE(aspenite_i2c_info
));
231 pxa168_add_nand(&aspenite_nand_info
);
232 pxa168_add_fb(&aspenite_lcd_info
);
233 pxa168_add_keypad(&aspenite_keypad_info
);
235 /* off-chip devices */
236 platform_device_register(&smc91x_device
);
239 MACHINE_START(ASPENITE
, "PXA168-based Aspenite Development Platform")
240 .map_io
= mmp_map_io
,
241 .nr_irqs
= IRQ_BOARD_START
,
242 .init_irq
= pxa168_init_irq
,
243 .timer
= &pxa168_timer
,
244 .init_machine
= common_init
,
247 MACHINE_START(ZYLONITE2
, "PXA168-based Zylonite2 Development Platform")
248 .map_io
= mmp_map_io
,
249 .nr_irqs
= IRQ_BOARD_START
,
250 .init_irq
= pxa168_init_irq
,
251 .timer
= &pxa168_timer
,
252 .init_machine
= common_init
,