Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Hardware definitions for Voipac PXA270 |
| 3 | * |
| 4 | * Copyright (C) 2010 |
| 5 | * Marek Vasut <marek.vasut@gmail.com> |
| 6 | * |
| 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. |
| 10 | * |
| 11 | */ |
| 12 | |
| 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> |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 20 | #include <linux/usb/gpio_vbus.h> |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 21 | #include <linux/mtd/mtd.h> |
| 22 | #include <linux/mtd/partitions.h> |
| 23 | #include <linux/mtd/physmap.h> |
Marek Vasut | bcc399b | 2010-05-01 06:54:36 +0200 | [diff] [blame] | 24 | #include <linux/mtd/onenand.h> |
Marek Vasut | 947fb57 | 2010-03-10 05:38:54 +0100 | [diff] [blame] | 25 | #include <linux/dm9000.h> |
Marek Vasut | 1a8fb70 | 2010-03-26 04:45:54 +0100 | [diff] [blame] | 26 | #include <linux/ucb1400.h> |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 27 | #include <linux/ata_platform.h> |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 28 | |
| 29 | #include <asm/mach-types.h> |
| 30 | #include <asm/mach/arch.h> |
| 31 | |
| 32 | #include <mach/pxa27x.h> |
Marek Vasut | 1a8fb70 | 2010-03-26 04:45:54 +0100 | [diff] [blame] | 33 | #include <mach/audio.h> |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 34 | #include <mach/vpac270.h> |
| 35 | #include <mach/mmc.h> |
| 36 | #include <mach/pxafb.h> |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 37 | #include <mach/ohci.h> |
| 38 | #include <mach/pxa27x-udc.h> |
| 39 | #include <mach/udc.h> |
Marek Vasut | 9b2dbdc | 2010-05-21 03:12:45 +0200 | [diff] [blame^] | 40 | #include <mach/pata_pxa.h> |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 41 | |
Marek Vasut | 83a4a10 | 2010-03-26 05:38:10 +0100 | [diff] [blame] | 42 | #include <plat/i2c.h> |
| 43 | |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 44 | #include "generic.h" |
| 45 | #include "devices.h" |
| 46 | |
| 47 | /****************************************************************************** |
| 48 | * Pin configuration |
| 49 | ******************************************************************************/ |
| 50 | static unsigned long vpac270_pin_config[] __initdata = { |
| 51 | /* MMC */ |
| 52 | GPIO32_MMC_CLK, |
| 53 | GPIO92_MMC_DAT_0, |
| 54 | GPIO109_MMC_DAT_1, |
| 55 | GPIO110_MMC_DAT_2, |
| 56 | GPIO111_MMC_DAT_3, |
| 57 | GPIO112_MMC_CMD, |
| 58 | GPIO53_GPIO, /* SD detect */ |
| 59 | GPIO52_GPIO, /* SD r/o switch */ |
| 60 | |
| 61 | /* GPIO KEYS */ |
| 62 | GPIO1_GPIO, /* USER BTN */ |
| 63 | |
| 64 | /* LEDs */ |
| 65 | GPIO15_GPIO, /* orange led */ |
| 66 | |
| 67 | /* FFUART */ |
| 68 | GPIO34_FFUART_RXD, |
| 69 | GPIO39_FFUART_TXD, |
| 70 | GPIO27_FFUART_RTS, |
| 71 | GPIO100_FFUART_CTS, |
| 72 | GPIO33_FFUART_DSR, |
| 73 | GPIO40_FFUART_DTR, |
| 74 | GPIO10_FFUART_DCD, |
| 75 | GPIO38_FFUART_RI, |
| 76 | |
| 77 | /* LCD */ |
| 78 | GPIO58_LCD_LDD_0, |
| 79 | GPIO59_LCD_LDD_1, |
| 80 | GPIO60_LCD_LDD_2, |
| 81 | GPIO61_LCD_LDD_3, |
| 82 | GPIO62_LCD_LDD_4, |
| 83 | GPIO63_LCD_LDD_5, |
| 84 | GPIO64_LCD_LDD_6, |
| 85 | GPIO65_LCD_LDD_7, |
| 86 | GPIO66_LCD_LDD_8, |
| 87 | GPIO67_LCD_LDD_9, |
| 88 | GPIO68_LCD_LDD_10, |
| 89 | GPIO69_LCD_LDD_11, |
| 90 | GPIO70_LCD_LDD_12, |
| 91 | GPIO71_LCD_LDD_13, |
| 92 | GPIO72_LCD_LDD_14, |
| 93 | GPIO73_LCD_LDD_15, |
| 94 | GPIO86_LCD_LDD_16, |
| 95 | GPIO87_LCD_LDD_17, |
| 96 | GPIO74_LCD_FCLK, |
| 97 | GPIO75_LCD_LCLK, |
| 98 | GPIO76_LCD_PCLK, |
| 99 | GPIO77_LCD_BIAS, |
Marek Vasut | addff0f | 2010-03-10 04:16:28 +0100 | [diff] [blame] | 100 | |
| 101 | /* PCMCIA */ |
| 102 | GPIO48_nPOE, |
| 103 | GPIO49_nPWE, |
| 104 | GPIO50_nPIOR, |
| 105 | GPIO51_nPIOW, |
| 106 | GPIO85_nPCE_1, |
| 107 | GPIO54_nPCE_2, |
| 108 | GPIO55_nPREG, |
| 109 | GPIO57_nIOIS16, |
| 110 | GPIO56_nPWAIT, |
| 111 | GPIO104_PSKTSEL, |
| 112 | GPIO84_GPIO, /* PCMCIA CD */ |
| 113 | GPIO35_GPIO, /* PCMCIA RDY */ |
| 114 | GPIO107_GPIO, /* PCMCIA PPEN */ |
| 115 | GPIO11_GPIO, /* PCMCIA RESET */ |
| 116 | GPIO17_GPIO, /* CF CD */ |
| 117 | GPIO12_GPIO, /* CF RDY */ |
| 118 | GPIO16_GPIO, /* CF RESET */ |
| 119 | |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 120 | /* UHC */ |
| 121 | GPIO88_USBH1_PWR, |
| 122 | GPIO89_USBH1_PEN, |
| 123 | GPIO119_USBH2_PWR, |
| 124 | GPIO120_USBH2_PEN, |
| 125 | |
| 126 | /* UDC */ |
| 127 | GPIO41_GPIO, |
Marek Vasut | 947fb57 | 2010-03-10 05:38:54 +0100 | [diff] [blame] | 128 | |
| 129 | /* Ethernet */ |
| 130 | GPIO114_GPIO, /* IRQ */ |
Marek Vasut | 1a8fb70 | 2010-03-26 04:45:54 +0100 | [diff] [blame] | 131 | |
| 132 | /* AC97 */ |
| 133 | GPIO28_AC97_BITCLK, |
| 134 | GPIO29_AC97_SDATA_IN_0, |
| 135 | GPIO30_AC97_SDATA_OUT, |
| 136 | GPIO31_AC97_SYNC, |
| 137 | GPIO95_AC97_nRESET, |
| 138 | GPIO98_AC97_SYSCLK, |
| 139 | GPIO113_GPIO, /* TS IRQ */ |
Marek Vasut | 83a4a10 | 2010-03-26 05:38:10 +0100 | [diff] [blame] | 140 | |
| 141 | /* I2C */ |
| 142 | GPIO117_I2C_SCL, |
| 143 | GPIO118_I2C_SDA, |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 144 | |
| 145 | /* IDE */ |
| 146 | GPIO36_GPIO, /* IDE IRQ */ |
| 147 | GPIO80_DREQ_1, |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 148 | }; |
| 149 | |
| 150 | /****************************************************************************** |
| 151 | * NOR Flash |
| 152 | ******************************************************************************/ |
| 153 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Marek Vasut | bcc399b | 2010-05-01 06:54:36 +0200 | [diff] [blame] | 154 | static struct mtd_partition vpac270_nor_partitions[] = { |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 155 | { |
| 156 | .name = "Flash", |
| 157 | .offset = 0x00000000, |
| 158 | .size = MTDPART_SIZ_FULL, |
| 159 | } |
| 160 | }; |
| 161 | |
| 162 | static struct physmap_flash_data vpac270_flash_data[] = { |
| 163 | { |
| 164 | .width = 2, /* bankwidth in bytes */ |
Marek Vasut | bcc399b | 2010-05-01 06:54:36 +0200 | [diff] [blame] | 165 | .parts = vpac270_nor_partitions, |
| 166 | .nr_parts = ARRAY_SIZE(vpac270_nor_partitions) |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 167 | } |
| 168 | }; |
| 169 | |
| 170 | static struct resource vpac270_flash_resource = { |
| 171 | .start = PXA_CS0_PHYS, |
| 172 | .end = PXA_CS0_PHYS + SZ_64M - 1, |
| 173 | .flags = IORESOURCE_MEM, |
| 174 | }; |
| 175 | |
| 176 | static struct platform_device vpac270_flash = { |
| 177 | .name = "physmap-flash", |
| 178 | .id = 0, |
| 179 | .resource = &vpac270_flash_resource, |
| 180 | .num_resources = 1, |
| 181 | .dev = { |
| 182 | .platform_data = vpac270_flash_data, |
| 183 | }, |
| 184 | }; |
| 185 | static void __init vpac270_nor_init(void) |
| 186 | { |
| 187 | platform_device_register(&vpac270_flash); |
| 188 | } |
| 189 | #else |
| 190 | static inline void vpac270_nor_init(void) {} |
| 191 | #endif |
| 192 | |
| 193 | /****************************************************************************** |
Marek Vasut | bcc399b | 2010-05-01 06:54:36 +0200 | [diff] [blame] | 194 | * OneNAND Flash |
| 195 | ******************************************************************************/ |
| 196 | #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) |
| 197 | static struct mtd_partition vpac270_onenand_partitions[] = { |
| 198 | { |
| 199 | .name = "Flash", |
| 200 | .offset = 0x00000000, |
| 201 | .size = MTDPART_SIZ_FULL, |
| 202 | } |
| 203 | }; |
| 204 | |
| 205 | static struct onenand_platform_data vpac270_onenand_info = { |
| 206 | .parts = vpac270_onenand_partitions, |
| 207 | .nr_parts = ARRAY_SIZE(vpac270_onenand_partitions), |
| 208 | }; |
| 209 | |
| 210 | static struct resource vpac270_onenand_resources[] = { |
| 211 | [0] = { |
| 212 | .start = PXA_CS0_PHYS, |
| 213 | .end = PXA_CS0_PHYS + SZ_1M, |
| 214 | .flags = IORESOURCE_MEM, |
| 215 | }, |
| 216 | }; |
| 217 | |
| 218 | static struct platform_device vpac270_onenand = { |
| 219 | .name = "onenand-flash", |
| 220 | .id = -1, |
| 221 | .resource = vpac270_onenand_resources, |
| 222 | .num_resources = ARRAY_SIZE(vpac270_onenand_resources), |
| 223 | .dev = { |
| 224 | .platform_data = &vpac270_onenand_info, |
| 225 | }, |
| 226 | }; |
| 227 | |
| 228 | static void __init vpac270_onenand_init(void) |
| 229 | { |
| 230 | platform_device_register(&vpac270_onenand); |
| 231 | } |
| 232 | #else |
| 233 | static void __init vpac270_onenand_init(void) {} |
| 234 | #endif |
| 235 | |
| 236 | /****************************************************************************** |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 237 | * SD/MMC card controller |
| 238 | ******************************************************************************/ |
| 239 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
| 240 | static struct pxamci_platform_data vpac270_mci_platform_data = { |
| 241 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
| 242 | .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, |
| 243 | .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, |
Eric Miao | f97cab2 | 2010-04-14 07:00:42 +0800 | [diff] [blame] | 244 | .detect_delay_ms = 200, |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | static void __init vpac270_mmc_init(void) |
| 248 | { |
| 249 | pxa_set_mci_info(&vpac270_mci_platform_data); |
| 250 | } |
| 251 | #else |
| 252 | static inline void vpac270_mmc_init(void) {} |
| 253 | #endif |
| 254 | |
| 255 | /****************************************************************************** |
| 256 | * GPIO keys |
| 257 | ******************************************************************************/ |
| 258 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 259 | static struct gpio_keys_button vpac270_pxa_buttons[] = { |
| 260 | {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"}, |
| 261 | }; |
| 262 | |
| 263 | static struct gpio_keys_platform_data vpac270_pxa_keys_data = { |
| 264 | .buttons = vpac270_pxa_buttons, |
| 265 | .nbuttons = ARRAY_SIZE(vpac270_pxa_buttons), |
| 266 | }; |
| 267 | |
| 268 | static struct platform_device vpac270_pxa_keys = { |
| 269 | .name = "gpio-keys", |
| 270 | .id = -1, |
| 271 | .dev = { |
| 272 | .platform_data = &vpac270_pxa_keys_data, |
| 273 | }, |
| 274 | }; |
| 275 | |
| 276 | static void __init vpac270_keys_init(void) |
| 277 | { |
| 278 | platform_device_register(&vpac270_pxa_keys); |
| 279 | } |
| 280 | #else |
| 281 | static inline void vpac270_keys_init(void) {} |
| 282 | #endif |
| 283 | |
| 284 | /****************************************************************************** |
| 285 | * LED |
| 286 | ******************************************************************************/ |
| 287 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
| 288 | struct gpio_led vpac270_gpio_leds[] = { |
| 289 | { |
| 290 | .name = "vpac270:orange:user", |
| 291 | .default_trigger = "none", |
| 292 | .gpio = GPIO15_VPAC270_LED_ORANGE, |
| 293 | .active_low = 1, |
| 294 | } |
| 295 | }; |
| 296 | |
| 297 | static struct gpio_led_platform_data vpac270_gpio_led_info = { |
| 298 | .leds = vpac270_gpio_leds, |
| 299 | .num_leds = ARRAY_SIZE(vpac270_gpio_leds), |
| 300 | }; |
| 301 | |
| 302 | static struct platform_device vpac270_leds = { |
| 303 | .name = "leds-gpio", |
| 304 | .id = -1, |
| 305 | .dev = { |
| 306 | .platform_data = &vpac270_gpio_led_info, |
| 307 | } |
| 308 | }; |
| 309 | |
| 310 | static void __init vpac270_leds_init(void) |
| 311 | { |
| 312 | platform_device_register(&vpac270_leds); |
| 313 | } |
| 314 | #else |
| 315 | static inline void vpac270_leds_init(void) {} |
| 316 | #endif |
| 317 | |
| 318 | /****************************************************************************** |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 319 | * USB Host |
| 320 | ******************************************************************************/ |
| 321 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
| 322 | static int vpac270_ohci_init(struct device *dev) |
| 323 | { |
| 324 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; |
| 325 | return 0; |
| 326 | } |
| 327 | |
| 328 | static struct pxaohci_platform_data vpac270_ohci_info = { |
| 329 | .port_mode = PMM_PERPORT_MODE, |
| 330 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | |
| 331 | POWER_CONTROL_LOW | POWER_SENSE_LOW, |
| 332 | .init = vpac270_ohci_init, |
| 333 | }; |
| 334 | |
| 335 | static void __init vpac270_uhc_init(void) |
| 336 | { |
| 337 | pxa_set_ohci_info(&vpac270_ohci_info); |
| 338 | } |
| 339 | #else |
| 340 | static inline void vpac270_uhc_init(void) {} |
| 341 | #endif |
| 342 | |
| 343 | /****************************************************************************** |
| 344 | * USB Gadget |
| 345 | ******************************************************************************/ |
| 346 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) |
| 347 | static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = { |
| 348 | .gpio_vbus = GPIO41_VPAC270_UDC_DETECT, |
| 349 | .gpio_pullup = -1, |
| 350 | }; |
| 351 | |
| 352 | static struct platform_device vpac270_gpio_vbus = { |
| 353 | .name = "gpio-vbus", |
| 354 | .id = -1, |
| 355 | .dev = { |
| 356 | .platform_data = &vpac270_gpio_vbus_info, |
| 357 | }, |
| 358 | }; |
| 359 | |
| 360 | static void vpac270_udc_command(int cmd) |
| 361 | { |
| 362 | if (cmd == PXA2XX_UDC_CMD_CONNECT) |
Marek Vasut | fb25cb3 | 2010-05-02 06:10:25 +0200 | [diff] [blame] | 363 | UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE; |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 364 | else if (cmd == PXA2XX_UDC_CMD_DISCONNECT) |
Marek Vasut | fb25cb3 | 2010-05-02 06:10:25 +0200 | [diff] [blame] | 365 | UP2OCR = UP2OCR_HXOE; |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = { |
| 369 | .udc_command = vpac270_udc_command, |
| 370 | .gpio_pullup = -1, |
| 371 | }; |
| 372 | |
| 373 | static void __init vpac270_udc_init(void) |
| 374 | { |
| 375 | pxa_set_udc_info(&vpac270_udc_info); |
| 376 | platform_device_register(&vpac270_gpio_vbus); |
| 377 | } |
| 378 | #else |
| 379 | static inline void vpac270_udc_init(void) {} |
| 380 | #endif |
| 381 | |
| 382 | /****************************************************************************** |
Marek Vasut | 947fb57 | 2010-03-10 05:38:54 +0100 | [diff] [blame] | 383 | * Ethernet |
| 384 | ******************************************************************************/ |
| 385 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 386 | static struct resource vpac270_dm9000_resources[] = { |
| 387 | [0] = { |
| 388 | .start = PXA_CS2_PHYS + 0x300, |
| 389 | .end = PXA_CS2_PHYS + 0x303, |
| 390 | .flags = IORESOURCE_MEM, |
| 391 | }, |
| 392 | [1] = { |
| 393 | .start = PXA_CS2_PHYS + 0x304, |
| 394 | .end = PXA_CS2_PHYS + 0x343, |
| 395 | .flags = IORESOURCE_MEM, |
| 396 | }, |
| 397 | [2] = { |
| 398 | .start = IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ), |
| 399 | .end = IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ), |
| 400 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
| 401 | }, |
| 402 | }; |
| 403 | |
| 404 | static struct dm9000_plat_data vpac270_dm9000_platdata = { |
| 405 | .flags = DM9000_PLATF_32BITONLY, |
| 406 | }; |
| 407 | |
| 408 | static struct platform_device vpac270_dm9000_device = { |
| 409 | .name = "dm9000", |
| 410 | .id = -1, |
| 411 | .num_resources = ARRAY_SIZE(vpac270_dm9000_resources), |
| 412 | .resource = vpac270_dm9000_resources, |
| 413 | .dev = { |
| 414 | .platform_data = &vpac270_dm9000_platdata, |
| 415 | } |
| 416 | }; |
| 417 | |
| 418 | static void __init vpac270_eth_init(void) |
| 419 | { |
| 420 | platform_device_register(&vpac270_dm9000_device); |
| 421 | } |
| 422 | #else |
| 423 | static inline void vpac270_eth_init(void) {} |
| 424 | #endif |
| 425 | |
| 426 | /****************************************************************************** |
Marek Vasut | 1a8fb70 | 2010-03-26 04:45:54 +0100 | [diff] [blame] | 427 | * Audio and Touchscreen |
| 428 | ******************************************************************************/ |
| 429 | #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ |
| 430 | defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) |
| 431 | static pxa2xx_audio_ops_t vpac270_ac97_pdata = { |
| 432 | .reset_gpio = 95, |
| 433 | }; |
| 434 | |
| 435 | static struct ucb1400_pdata vpac270_ucb1400_pdata = { |
Marek Vasut | aeec134 | 2010-04-26 23:23:48 +0200 | [diff] [blame] | 436 | .irq = IRQ_GPIO(GPIO113_VPAC270_TS_IRQ), |
Marek Vasut | 1a8fb70 | 2010-03-26 04:45:54 +0100 | [diff] [blame] | 437 | }; |
| 438 | |
| 439 | static struct platform_device vpac270_ucb1400_device = { |
| 440 | .name = "ucb1400_core", |
| 441 | .id = -1, |
| 442 | .dev = { |
| 443 | .platform_data = &vpac270_ucb1400_pdata, |
| 444 | }, |
| 445 | }; |
| 446 | |
| 447 | static void __init vpac270_ts_init(void) |
| 448 | { |
| 449 | pxa_set_ac97_info(&vpac270_ac97_pdata); |
| 450 | platform_device_register(&vpac270_ucb1400_device); |
| 451 | } |
| 452 | #else |
| 453 | static inline void vpac270_ts_init(void) {} |
| 454 | #endif |
| 455 | |
| 456 | /****************************************************************************** |
Marek Vasut | 83a4a10 | 2010-03-26 05:38:10 +0100 | [diff] [blame] | 457 | * RTC |
| 458 | ******************************************************************************/ |
| 459 | #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) |
| 460 | static struct i2c_board_info __initdata vpac270_i2c_devs[] = { |
| 461 | { |
| 462 | I2C_BOARD_INFO("ds1339", 0x68), |
| 463 | }, |
| 464 | }; |
| 465 | |
| 466 | static void __init vpac270_rtc_init(void) |
| 467 | { |
| 468 | pxa_set_i2c_info(NULL); |
| 469 | i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs)); |
| 470 | } |
| 471 | #else |
| 472 | static inline void vpac270_rtc_init(void) {} |
| 473 | #endif |
| 474 | |
| 475 | /****************************************************************************** |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 476 | * Framebuffer |
| 477 | ******************************************************************************/ |
| 478 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
| 479 | static struct pxafb_mode_info vpac270_lcd_modes[] = { |
| 480 | { |
| 481 | .pixclock = 57692, |
| 482 | .xres = 640, |
| 483 | .yres = 480, |
| 484 | .bpp = 32, |
| 485 | .depth = 18, |
| 486 | |
| 487 | .left_margin = 144, |
| 488 | .right_margin = 32, |
| 489 | .upper_margin = 13, |
| 490 | .lower_margin = 30, |
| 491 | |
| 492 | .hsync_len = 32, |
| 493 | .vsync_len = 2, |
| 494 | |
| 495 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
| 496 | }, |
| 497 | }; |
| 498 | |
| 499 | static struct pxafb_mach_info vpac270_lcd_screen = { |
| 500 | .modes = vpac270_lcd_modes, |
| 501 | .num_modes = ARRAY_SIZE(vpac270_lcd_modes), |
| 502 | .lcd_conn = LCD_COLOR_TFT_18BPP, |
| 503 | }; |
| 504 | |
| 505 | static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info) |
| 506 | { |
| 507 | gpio_set_value(GPIO81_VPAC270_BKL_ON, on); |
| 508 | } |
| 509 | |
| 510 | static void __init vpac270_lcd_init(void) |
| 511 | { |
| 512 | int ret; |
| 513 | |
| 514 | ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON"); |
| 515 | if (ret) { |
| 516 | pr_err("Requesting BKL-ON GPIO failed!\n"); |
| 517 | goto err; |
| 518 | } |
| 519 | |
| 520 | ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1); |
| 521 | if (ret) { |
| 522 | pr_err("Setting BKL-ON GPIO direction failed!\n"); |
| 523 | goto err2; |
| 524 | } |
| 525 | |
| 526 | vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power; |
| 527 | set_pxa_fb_info(&vpac270_lcd_screen); |
| 528 | return; |
| 529 | |
| 530 | err2: |
| 531 | gpio_free(GPIO81_VPAC270_BKL_ON); |
| 532 | err: |
| 533 | return; |
| 534 | } |
| 535 | #else |
| 536 | static inline void vpac270_lcd_init(void) {} |
| 537 | #endif |
| 538 | |
| 539 | /****************************************************************************** |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 540 | * PATA IDE |
| 541 | ******************************************************************************/ |
Marek Vasut | 9b2dbdc | 2010-05-21 03:12:45 +0200 | [diff] [blame^] | 542 | #if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE) |
| 543 | static struct pata_pxa_pdata vpac270_pata_pdata = { |
| 544 | .reg_shift = 1, |
| 545 | .dma_dreq = 1, |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 546 | .irq_flags = IRQF_TRIGGER_RISING, |
| 547 | }; |
| 548 | |
| 549 | static struct resource vpac270_ide_resources[] = { |
| 550 | [0] = { /* I/O Base address */ |
| 551 | .start = PXA_CS3_PHYS + 0x120, |
| 552 | .end = PXA_CS3_PHYS + 0x13f, |
| 553 | .flags = IORESOURCE_MEM |
| 554 | }, |
| 555 | [1] = { /* CTL Base address */ |
| 556 | .start = PXA_CS3_PHYS + 0x15c, |
| 557 | .end = PXA_CS3_PHYS + 0x15f, |
| 558 | .flags = IORESOURCE_MEM |
| 559 | }, |
Marek Vasut | 9b2dbdc | 2010-05-21 03:12:45 +0200 | [diff] [blame^] | 560 | [2] = { /* DMA Base address */ |
| 561 | .start = PXA_CS3_PHYS + 0x20, |
| 562 | .end = PXA_CS3_PHYS + 0x2f, |
| 563 | .flags = IORESOURCE_DMA |
| 564 | }, |
| 565 | [3] = { /* IDE IRQ pin */ |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 566 | .start = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ), |
| 567 | .end = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ), |
| 568 | .flags = IORESOURCE_IRQ |
| 569 | } |
| 570 | }; |
| 571 | |
| 572 | static struct platform_device vpac270_ide_device = { |
Marek Vasut | 9b2dbdc | 2010-05-21 03:12:45 +0200 | [diff] [blame^] | 573 | .name = "pata_pxa", |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 574 | .num_resources = ARRAY_SIZE(vpac270_ide_resources), |
| 575 | .resource = vpac270_ide_resources, |
| 576 | .dev = { |
| 577 | .platform_data = &vpac270_pata_pdata, |
Marek Vasut | 9b2dbdc | 2010-05-21 03:12:45 +0200 | [diff] [blame^] | 578 | .coherent_dma_mask = 0xffffffff, |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 579 | } |
| 580 | }; |
| 581 | |
| 582 | static void __init vpac270_ide_init(void) |
| 583 | { |
| 584 | platform_device_register(&vpac270_ide_device); |
| 585 | } |
| 586 | #else |
| 587 | static inline void vpac270_ide_init(void) {} |
| 588 | #endif |
| 589 | |
| 590 | /****************************************************************************** |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 591 | * Machine init |
| 592 | ******************************************************************************/ |
| 593 | static void __init vpac270_init(void) |
| 594 | { |
| 595 | pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config)); |
| 596 | |
| 597 | pxa_set_ffuart_info(NULL); |
| 598 | pxa_set_btuart_info(NULL); |
| 599 | pxa_set_stuart_info(NULL); |
| 600 | |
| 601 | vpac270_lcd_init(); |
| 602 | vpac270_mmc_init(); |
| 603 | vpac270_nor_init(); |
Marek Vasut | bcc399b | 2010-05-01 06:54:36 +0200 | [diff] [blame] | 604 | vpac270_onenand_init(); |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 605 | vpac270_leds_init(); |
| 606 | vpac270_keys_init(); |
Marek Vasut | 3d98f88 | 2010-03-10 05:24:27 +0100 | [diff] [blame] | 607 | vpac270_uhc_init(); |
| 608 | vpac270_udc_init(); |
Marek Vasut | 947fb57 | 2010-03-10 05:38:54 +0100 | [diff] [blame] | 609 | vpac270_eth_init(); |
Marek Vasut | 1a8fb70 | 2010-03-26 04:45:54 +0100 | [diff] [blame] | 610 | vpac270_ts_init(); |
Marek Vasut | 83a4a10 | 2010-03-26 05:38:10 +0100 | [diff] [blame] | 611 | vpac270_rtc_init(); |
Marek Vasut | 052345a | 2010-04-26 21:46:07 +0200 | [diff] [blame] | 612 | vpac270_ide_init(); |
Marek | 543cd84 | 2010-03-09 04:04:12 +0100 | [diff] [blame] | 613 | } |
| 614 | |
| 615 | MACHINE_START(VPAC270, "Voipac PXA270") |
| 616 | .phys_io = 0x40000000, |
| 617 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 618 | .boot_params = 0xa0000100, |
| 619 | .map_io = pxa_map_io, |
| 620 | .init_irq = pxa27x_init_irq, |
| 621 | .timer = &pxa_timer, |
| 622 | .init_machine = vpac270_init |
| 623 | MACHINE_END |