2 * linux/arch/arm/mach-pxa/littleton.c
4 * Support for the Marvell Littleton Development Platform.
6 * Author: Jason Chagas (largely modified code)
7 * Created: Nov 20, 2006
8 * Copyright: (C) Copyright 2006 Marvell International Ltd.
10 * 2007-11-22 modified to align with latest kernel
11 * eric miao <eric.miao@marvell.com>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * publishhed by the Free Software Foundation.
18 #include <linux/init.h>
19 #include <linux/interrupt.h>
20 #include <linux/delay.h>
21 #include <linux/platform_device.h>
22 #include <linux/clk.h>
23 #include <linux/gpio.h>
24 #include <linux/spi/spi.h>
25 #include <linux/spi/pxa2xx_spi.h>
26 #include <linux/smc91x.h>
27 #include <linux/i2c.h>
28 #include <linux/leds.h>
29 #include <linux/mfd/da903x.h>
30 #include <linux/i2c/max732x.h>
31 #include <linux/i2c/pxa-i2c.h>
33 #include <asm/types.h>
34 #include <asm/setup.h>
35 #include <asm/memory.h>
36 #include <asm/mach-types.h>
37 #include <mach/hardware.h>
40 #include <asm/mach/arch.h>
41 #include <asm/mach/map.h>
42 #include <asm/mach/irq.h>
44 #include <mach/pxa300.h>
45 #include <linux/platform_data/video-pxafb.h>
46 #include <linux/platform_data/mmc-pxamci.h>
47 #include <linux/platform_data/keypad-pxa27x.h>
48 #include <mach/littleton.h>
49 #include <linux/platform_data/mtd-nand-pxa3xx.h>
53 #define GPIO_MMC1_CARD_DETECT mfp_to_gpio(MFP_PIN_GPIO15)
55 /* Littleton MFP configurations */
56 static mfp_cfg_t littleton_mfp_cfg
[] __initdata
= {
84 GPIO17_GPIO
, /* SFRM as chip-select */
111 GPIO15_GPIO
, /* card detect */
120 static struct resource smc91x_resources
[] = {
122 .start
= (LITTLETON_ETH_PHYS
+ 0x300),
123 .end
= (LITTLETON_ETH_PHYS
+ 0xfffff),
124 .flags
= IORESOURCE_MEM
,
127 .start
= PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90
)),
128 .end
= PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90
)),
129 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWEDGE
,
133 static struct smc91x_platdata littleton_smc91x_info
= {
134 .flags
= SMC91X_USE_8BIT
| SMC91X_USE_16BIT
|
135 SMC91X_NOWAIT
| SMC91X_USE_DMA
,
138 static struct platform_device smc91x_device
= {
141 .num_resources
= ARRAY_SIZE(smc91x_resources
),
142 .resource
= smc91x_resources
,
144 .platform_data
= &littleton_smc91x_info
,
148 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
149 static struct pxafb_mode_info tpo_tdo24mtea1_modes
[] = {
180 static struct pxafb_mach_info littleton_lcd_info
= {
181 .modes
= tpo_tdo24mtea1_modes
,
183 .lcd_conn
= LCD_COLOR_TFT_16BPP
,
186 static void littleton_init_lcd(void)
188 pxa_set_fb_info(NULL
, &littleton_lcd_info
);
191 static inline void littleton_init_lcd(void) {};
192 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
194 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
195 static struct pxa2xx_spi_master littleton_spi_info
= {
199 static struct pxa2xx_spi_chip littleton_tdo24m_chip
= {
202 .gpio_cs
= LITTLETON_GPIO_LCD_CS
,
205 static struct spi_board_info littleton_spi_devices
[] __initdata
= {
207 .modalias
= "tdo24m",
208 .max_speed_hz
= 1000000,
211 .controller_data
= &littleton_tdo24m_chip
,
215 static void __init
littleton_init_spi(void)
217 pxa2xx_set_spi_info(2, &littleton_spi_info
);
218 spi_register_board_info(ARRAY_AND_SIZE(littleton_spi_devices
));
221 static inline void littleton_init_spi(void) {}
224 #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
225 static unsigned int littleton_matrix_key_map
[] = {
226 /* KEY(row, col, key_code) */
227 KEY(1, 3, KEY_0
), KEY(0, 0, KEY_1
), KEY(1, 0, KEY_2
), KEY(2, 0, KEY_3
),
228 KEY(0, 1, KEY_4
), KEY(1, 1, KEY_5
), KEY(2, 1, KEY_6
), KEY(0, 2, KEY_7
),
229 KEY(1, 2, KEY_8
), KEY(2, 2, KEY_9
),
231 KEY(0, 3, KEY_KPASTERISK
), /* * */
232 KEY(2, 3, KEY_KPDOT
), /* # */
234 KEY(5, 4, KEY_ENTER
),
239 KEY(5, 3, KEY_RIGHT
),
245 KEY(4, 2, KEY_VOLUMEUP
),
246 KEY(4, 3, KEY_VOLUMEDOWN
),
248 KEY(3, 0, KEY_F22
), /* soft1 */
249 KEY(3, 1, KEY_F23
), /* soft2 */
252 static struct pxa27x_keypad_platform_data littleton_keypad_info
= {
253 .matrix_key_rows
= 6,
254 .matrix_key_cols
= 5,
255 .matrix_key_map
= littleton_matrix_key_map
,
256 .matrix_key_map_size
= ARRAY_SIZE(littleton_matrix_key_map
),
259 .rotary0_up_key
= KEY_UP
,
260 .rotary0_down_key
= KEY_DOWN
,
262 .debounce_interval
= 30,
264 static void __init
littleton_init_keypad(void)
266 pxa_set_keypad_info(&littleton_keypad_info
);
269 static inline void littleton_init_keypad(void) {}
272 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
273 static struct pxamci_platform_data littleton_mci_platform_data
= {
274 .detect_delay_ms
= 200,
275 .ocr_mask
= MMC_VDD_32_33
| MMC_VDD_33_34
,
276 .gpio_card_detect
= GPIO_MMC1_CARD_DETECT
,
281 static void __init
littleton_init_mmc(void)
283 pxa_set_mci_info(&littleton_mci_platform_data
);
286 static inline void littleton_init_mmc(void) {}
289 #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
290 static struct mtd_partition littleton_nand_partitions
[] = {
292 .name
= "Bootloader",
295 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
301 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
304 .name
= "Filesystem",
306 .size
= 0x3000000, /* 48M - rootfs */
309 .name
= "MassStorage",
317 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
319 /* NOTE: we reserve some blocks at the end of the NAND flash for
320 * bad block management, and the max number of relocation blocks
321 * differs on different platforms. Please take care with it when
322 * defining the partition table.
326 static struct pxa3xx_nand_platform_data littleton_nand_info
= {
329 .parts
[0] = littleton_nand_partitions
,
330 .nr_parts
[0] = ARRAY_SIZE(littleton_nand_partitions
),
333 static void __init
littleton_init_nand(void)
335 pxa3xx_set_nand_info(&littleton_nand_info
);
338 static inline void littleton_init_nand(void) {}
339 #endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */
341 #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
342 static struct led_info littleton_da9034_leds
[] = {
344 .name
= "littleton:keypad1",
345 .flags
= DA9034_LED_RAMP
,
348 .name
= "littleton:keypad2",
349 .flags
= DA9034_LED_RAMP
,
352 .name
= "littleton:vibra",
357 static struct da9034_touch_pdata littleton_da9034_touch
= {
362 static struct da903x_subdev_info littleton_da9034_subdevs
[] = {
364 .name
= "da903x-led",
365 .id
= DA9034_ID_LED_1
,
366 .platform_data
= &littleton_da9034_leds
[0],
368 .name
= "da903x-led",
369 .id
= DA9034_ID_LED_2
,
370 .platform_data
= &littleton_da9034_leds
[1],
372 .name
= "da903x-led",
373 .id
= DA9034_ID_VIBRA
,
374 .platform_data
= &littleton_da9034_leds
[2],
376 .name
= "da903x-backlight",
377 .id
= DA9034_ID_WLED
,
379 .name
= "da9034-touch",
380 .id
= DA9034_ID_TOUCH
,
381 .platform_data
= &littleton_da9034_touch
,
385 static struct da903x_platform_data littleton_da9034_info
= {
386 .num_subdevs
= ARRAY_SIZE(littleton_da9034_subdevs
),
387 .subdevs
= littleton_da9034_subdevs
,
390 static struct max732x_platform_data littleton_max7320_info
= {
391 .gpio_base
= EXT0_GPIO_BASE
,
394 static struct i2c_board_info littleton_i2c_info
[] = {
398 .platform_data
= &littleton_da9034_info
,
399 .irq
= PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO18
)),
404 .platform_data
= &littleton_max7320_info
,
408 static void __init
littleton_init_i2c(void)
410 pxa_set_i2c_info(NULL
);
411 i2c_register_board_info(0, ARRAY_AND_SIZE(littleton_i2c_info
));
414 static inline void littleton_init_i2c(void) {}
415 #endif /* CONFIG_I2C_PXA || CONFIG_I2C_PXA_MODULE */
417 static void __init
littleton_init(void)
419 /* initialize MFP configurations */
420 pxa3xx_mfp_config(ARRAY_AND_SIZE(littleton_mfp_cfg
));
422 pxa_set_ffuart_info(NULL
);
423 pxa_set_btuart_info(NULL
);
424 pxa_set_stuart_info(NULL
);
427 * Note: we depend bootloader set the correct
428 * value to MSC register for SMC91x.
430 platform_device_register(&smc91x_device
);
432 littleton_init_spi();
433 littleton_init_i2c();
434 littleton_init_mmc();
435 littleton_init_lcd();
436 littleton_init_keypad();
437 littleton_init_nand();
440 MACHINE_START(LITTLETON
, "Marvell Form Factor Development Platform (aka Littleton)")
441 .atag_offset
= 0x100,
442 .map_io
= pxa3xx_map_io
,
443 .nr_irqs
= LITTLETON_NR_IRQS
,
444 .init_irq
= pxa3xx_init_irq
,
445 .handle_irq
= pxa3xx_handle_irq
,
447 .init_machine
= littleton_init
,
448 .restart
= pxa_restart
,