2 * Hardware definitions for Voipac PXA270
5 * Marek Vasut <marek.vasut@gmail.com>
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 * published by the Free Software Foundation.
13 #include <linux/platform_device.h>
14 #include <linux/delay.h>
15 #include <linux/irq.h>
16 #include <linux/gpio_keys.h>
17 #include <linux/input.h>
18 #include <linux/gpio.h>
19 #include <linux/sysdev.h>
20 #include <linux/mtd/mtd.h>
21 #include <linux/mtd/partitions.h>
22 #include <linux/mtd/physmap.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
27 #include <mach/pxa27x.h>
28 #include <mach/vpac270.h>
30 #include <mach/pxafb.h>
35 /******************************************************************************
37 ******************************************************************************/
38 static unsigned long vpac270_pin_config
[] __initdata
= {
46 GPIO53_GPIO
, /* SD detect */
47 GPIO52_GPIO
, /* SD r/o switch */
50 GPIO1_GPIO
, /* USER BTN */
53 GPIO15_GPIO
, /* orange led */
100 GPIO84_GPIO
, /* PCMCIA CD */
101 GPIO35_GPIO
, /* PCMCIA RDY */
102 GPIO107_GPIO
, /* PCMCIA PPEN */
103 GPIO11_GPIO
, /* PCMCIA RESET */
104 GPIO17_GPIO
, /* CF CD */
105 GPIO12_GPIO
, /* CF RDY */
106 GPIO16_GPIO
, /* CF RESET */
110 /******************************************************************************
112 ******************************************************************************/
113 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
114 static struct mtd_partition vpac270_partitions
[] = {
117 .offset
= 0x00000000,
118 .size
= MTDPART_SIZ_FULL
,
122 static struct physmap_flash_data vpac270_flash_data
[] = {
124 .width
= 2, /* bankwidth in bytes */
125 .parts
= vpac270_partitions
,
126 .nr_parts
= ARRAY_SIZE(vpac270_partitions
)
130 static struct resource vpac270_flash_resource
= {
131 .start
= PXA_CS0_PHYS
,
132 .end
= PXA_CS0_PHYS
+ SZ_64M
- 1,
133 .flags
= IORESOURCE_MEM
,
136 static struct platform_device vpac270_flash
= {
137 .name
= "physmap-flash",
139 .resource
= &vpac270_flash_resource
,
142 .platform_data
= vpac270_flash_data
,
145 static void __init
vpac270_nor_init(void)
147 platform_device_register(&vpac270_flash
);
150 static inline void vpac270_nor_init(void) {}
153 /******************************************************************************
154 * SD/MMC card controller
155 ******************************************************************************/
156 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
157 static struct pxamci_platform_data vpac270_mci_platform_data
= {
158 .ocr_mask
= MMC_VDD_32_33
| MMC_VDD_33_34
,
159 .gpio_card_detect
= GPIO53_VPAC270_SD_DETECT_N
,
160 .gpio_card_ro
= GPIO52_VPAC270_SD_READONLY
,
164 static void __init
vpac270_mmc_init(void)
166 pxa_set_mci_info(&vpac270_mci_platform_data
);
169 static inline void vpac270_mmc_init(void) {}
172 /******************************************************************************
174 ******************************************************************************/
175 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
176 static struct gpio_keys_button vpac270_pxa_buttons
[] = {
177 {KEY_POWER
, GPIO1_VPAC270_USER_BTN
, 0, "USER BTN"},
180 static struct gpio_keys_platform_data vpac270_pxa_keys_data
= {
181 .buttons
= vpac270_pxa_buttons
,
182 .nbuttons
= ARRAY_SIZE(vpac270_pxa_buttons
),
185 static struct platform_device vpac270_pxa_keys
= {
189 .platform_data
= &vpac270_pxa_keys_data
,
193 static void __init
vpac270_keys_init(void)
195 platform_device_register(&vpac270_pxa_keys
);
198 static inline void vpac270_keys_init(void) {}
201 /******************************************************************************
203 ******************************************************************************/
204 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
205 struct gpio_led vpac270_gpio_leds
[] = {
207 .name
= "vpac270:orange:user",
208 .default_trigger
= "none",
209 .gpio
= GPIO15_VPAC270_LED_ORANGE
,
214 static struct gpio_led_platform_data vpac270_gpio_led_info
= {
215 .leds
= vpac270_gpio_leds
,
216 .num_leds
= ARRAY_SIZE(vpac270_gpio_leds
),
219 static struct platform_device vpac270_leds
= {
223 .platform_data
= &vpac270_gpio_led_info
,
227 static void __init
vpac270_leds_init(void)
229 platform_device_register(&vpac270_leds
);
232 static inline void vpac270_leds_init(void) {}
235 /******************************************************************************
237 ******************************************************************************/
238 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
239 static struct pxafb_mode_info vpac270_lcd_modes
[] = {
255 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
259 static struct pxafb_mach_info vpac270_lcd_screen
= {
260 .modes
= vpac270_lcd_modes
,
261 .num_modes
= ARRAY_SIZE(vpac270_lcd_modes
),
262 .lcd_conn
= LCD_COLOR_TFT_18BPP
,
265 static void vpac270_lcd_power(int on
, struct fb_var_screeninfo
*info
)
267 gpio_set_value(GPIO81_VPAC270_BKL_ON
, on
);
270 static void __init
vpac270_lcd_init(void)
274 ret
= gpio_request(GPIO81_VPAC270_BKL_ON
, "BKL-ON");
276 pr_err("Requesting BKL-ON GPIO failed!\n");
280 ret
= gpio_direction_output(GPIO81_VPAC270_BKL_ON
, 1);
282 pr_err("Setting BKL-ON GPIO direction failed!\n");
286 vpac270_lcd_screen
.pxafb_lcd_power
= vpac270_lcd_power
;
287 set_pxa_fb_info(&vpac270_lcd_screen
);
291 gpio_free(GPIO81_VPAC270_BKL_ON
);
296 static inline void vpac270_lcd_init(void) {}
299 /******************************************************************************
301 ******************************************************************************/
302 static void __init
vpac270_init(void)
304 pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config
));
306 pxa_set_ffuart_info(NULL
);
307 pxa_set_btuart_info(NULL
);
308 pxa_set_stuart_info(NULL
);
317 MACHINE_START(VPAC270
, "Voipac PXA270")
318 .phys_io
= 0x40000000,
319 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
320 .boot_params
= 0xa0000100,
321 .map_io
= pxa_map_io
,
322 .init_irq
= pxa27x_init_irq
,
324 .init_machine
= vpac270_init