Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/board-omap3evm.c |
| 3 | * |
| 4 | * Copyright (C) 2008 Texas Instruments |
| 5 | * |
| 6 | * Modified from mach-omap2/board-3430sdp.c |
| 7 | * |
| 8 | * Initial code: Syed Mohammed Khasim |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/delay.h> |
| 19 | #include <linux/err.h> |
| 20 | #include <linux/clk.h> |
| 21 | #include <linux/gpio.h> |
| 22 | #include <linux/input.h> |
Janusz Krzysztofik | 6135434 | 2009-10-22 14:43:17 -0700 | [diff] [blame] | 23 | #include <linux/input/matrix_keypad.h> |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 24 | #include <linux/leds.h> |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 25 | #include <linux/interrupt.h> |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 26 | |
| 27 | #include <linux/spi/spi.h> |
| 28 | #include <linux/spi/ads7846.h> |
Balaji T K | ebeb53e | 2009-12-15 20:09:02 +0530 | [diff] [blame] | 29 | #include <linux/i2c/twl.h> |
Gupta, Ajay Kumar | e8e2ff4 | 2009-07-29 11:58:57 +0530 | [diff] [blame] | 30 | #include <linux/usb/otg.h> |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 31 | #include <linux/smsc911x.h> |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 32 | |
Mike Rapoport | 1a7ec13 | 2009-11-22 10:11:29 -0800 | [diff] [blame] | 33 | #include <linux/regulator/machine.h> |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 34 | #include <linux/mmc/host.h> |
Mike Rapoport | 1a7ec13 | 2009-11-22 10:11:29 -0800 | [diff] [blame] | 35 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 36 | #include <mach/hardware.h> |
| 37 | #include <asm/mach-types.h> |
| 38 | #include <asm/mach/arch.h> |
| 39 | #include <asm/mach/map.h> |
| 40 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 41 | #include <plat/board.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 42 | #include <plat/usb.h> |
| 43 | #include <plat/common.h> |
| 44 | #include <plat/mcspi.h> |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 45 | #include <plat/display.h> |
Bryan Wu | 89747c9 | 2010-11-17 13:34:34 +0000 | [diff] [blame] | 46 | #include <plat/panel-generic-dpi.h> |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 47 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 48 | #include "mux.h" |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 49 | #include "sdram-micron-mt46h32m32lf-6.h" |
Adrian Hunter | d02a900 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 50 | #include "hsmmc.h" |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 51 | |
| 52 | #define OMAP3_EVM_TS_GPIO 175 |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 53 | #define OMAP3_EVM_EHCI_VBUS 22 |
| 54 | #define OMAP3_EVM_EHCI_SELECT 61 |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 55 | |
| 56 | #define OMAP3EVM_ETHR_START 0x2c000000 |
| 57 | #define OMAP3EVM_ETHR_SIZE 1024 |
Ajay Kumar Gupta | db40802 | 2009-11-22 10:11:27 -0800 | [diff] [blame] | 58 | #define OMAP3EVM_ETHR_ID_REV 0x50 |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 59 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 60 | #define OMAP3EVM_SMSC911X_CS 5 |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 61 | |
Ajay Kumar Gupta | db40802 | 2009-11-22 10:11:27 -0800 | [diff] [blame] | 62 | static u8 omap3_evm_version; |
| 63 | |
| 64 | u8 get_omap3_evm_rev(void) |
| 65 | { |
| 66 | return omap3_evm_version; |
| 67 | } |
| 68 | EXPORT_SYMBOL(get_omap3_evm_rev); |
| 69 | |
| 70 | static void __init omap3_evm_get_revision(void) |
| 71 | { |
| 72 | void __iomem *ioaddr; |
| 73 | unsigned int smsc_id; |
| 74 | |
| 75 | /* Ethernet PHY ID is stored at ID_REV register */ |
| 76 | ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K); |
| 77 | if (!ioaddr) |
| 78 | return; |
| 79 | smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000; |
| 80 | iounmap(ioaddr); |
| 81 | |
| 82 | switch (smsc_id) { |
| 83 | /*SMSC9115 chipset*/ |
| 84 | case 0x01150000: |
| 85 | omap3_evm_version = OMAP3EVM_BOARD_GEN_1; |
| 86 | break; |
| 87 | /*SMSC 9220 chipset*/ |
| 88 | case 0x92200000: |
| 89 | default: |
| 90 | omap3_evm_version = OMAP3EVM_BOARD_GEN_2; |
| 91 | } |
| 92 | } |
| 93 | |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 94 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
| 95 | static struct resource omap3evm_smsc911x_resources[] = { |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 96 | [0] = { |
| 97 | .start = OMAP3EVM_ETHR_START, |
| 98 | .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1), |
| 99 | .flags = IORESOURCE_MEM, |
| 100 | }, |
| 101 | [1] = { |
| 102 | .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), |
| 103 | .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 104 | .flags = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW), |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 105 | }, |
| 106 | }; |
| 107 | |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 108 | static struct smsc911x_platform_config smsc911x_config = { |
| 109 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 110 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 111 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
| 112 | .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS), |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 113 | }; |
| 114 | |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 115 | static struct platform_device omap3evm_smsc911x_device = { |
| 116 | .name = "smsc911x", |
| 117 | .id = -1, |
| 118 | .num_resources = ARRAY_SIZE(omap3evm_smsc911x_resources), |
| 119 | .resource = &omap3evm_smsc911x_resources[0], |
| 120 | .dev = { |
| 121 | .platform_data = &smsc911x_config, |
| 122 | }, |
| 123 | }; |
| 124 | |
| 125 | static inline void __init omap3evm_init_smsc911x(void) |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 126 | { |
| 127 | int eth_cs; |
| 128 | struct clk *l3ck; |
| 129 | unsigned int rate; |
| 130 | |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 131 | eth_cs = OMAP3EVM_SMSC911X_CS; |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 132 | |
| 133 | l3ck = clk_get(NULL, "l3_ck"); |
| 134 | if (IS_ERR(l3ck)) |
| 135 | rate = 100000000; |
| 136 | else |
| 137 | rate = clk_get_rate(l3ck); |
| 138 | |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 139 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { |
| 140 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 141 | OMAP3EVM_ETHR_GPIO_IRQ); |
| 142 | return; |
| 143 | } |
| 144 | |
| 145 | gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ); |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 146 | platform_device_register(&omap3evm_smsc911x_device); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 147 | } |
| 148 | |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 149 | #else |
| 150 | static inline void __init omap3evm_init_smsc911x(void) { return; } |
| 151 | #endif |
| 152 | |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 153 | /* |
| 154 | * OMAP3EVM LCD Panel control signals |
| 155 | */ |
| 156 | #define OMAP3EVM_LCD_PANEL_LR 2 |
| 157 | #define OMAP3EVM_LCD_PANEL_UD 3 |
| 158 | #define OMAP3EVM_LCD_PANEL_INI 152 |
| 159 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 |
| 160 | #define OMAP3EVM_LCD_PANEL_QVGA 154 |
| 161 | #define OMAP3EVM_LCD_PANEL_RESB 155 |
| 162 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 |
| 163 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 |
| 164 | |
| 165 | static int lcd_enabled; |
| 166 | static int dvi_enabled; |
| 167 | |
| 168 | static void __init omap3_evm_display_init(void) |
| 169 | { |
| 170 | int r; |
| 171 | |
| 172 | r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb"); |
| 173 | if (r) { |
| 174 | printk(KERN_ERR "failed to get lcd_panel_resb\n"); |
| 175 | return; |
| 176 | } |
| 177 | gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1); |
| 178 | |
| 179 | r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini"); |
| 180 | if (r) { |
| 181 | printk(KERN_ERR "failed to get lcd_panel_ini\n"); |
| 182 | goto err_1; |
| 183 | } |
| 184 | gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1); |
| 185 | |
| 186 | r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga"); |
| 187 | if (r) { |
| 188 | printk(KERN_ERR "failed to get lcd_panel_qvga\n"); |
| 189 | goto err_2; |
| 190 | } |
| 191 | gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0); |
| 192 | |
| 193 | r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr"); |
| 194 | if (r) { |
| 195 | printk(KERN_ERR "failed to get lcd_panel_lr\n"); |
| 196 | goto err_3; |
| 197 | } |
| 198 | gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1); |
| 199 | |
| 200 | r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud"); |
| 201 | if (r) { |
| 202 | printk(KERN_ERR "failed to get lcd_panel_ud\n"); |
| 203 | goto err_4; |
| 204 | } |
| 205 | gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1); |
| 206 | |
| 207 | r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd"); |
| 208 | if (r) { |
| 209 | printk(KERN_ERR "failed to get lcd_panel_envdd\n"); |
| 210 | goto err_5; |
| 211 | } |
| 212 | gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0); |
| 213 | |
| 214 | return; |
| 215 | |
| 216 | err_5: |
| 217 | gpio_free(OMAP3EVM_LCD_PANEL_UD); |
| 218 | err_4: |
| 219 | gpio_free(OMAP3EVM_LCD_PANEL_LR); |
| 220 | err_3: |
| 221 | gpio_free(OMAP3EVM_LCD_PANEL_QVGA); |
| 222 | err_2: |
| 223 | gpio_free(OMAP3EVM_LCD_PANEL_INI); |
| 224 | err_1: |
| 225 | gpio_free(OMAP3EVM_LCD_PANEL_RESB); |
| 226 | |
| 227 | } |
| 228 | |
| 229 | static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) |
| 230 | { |
| 231 | if (dvi_enabled) { |
| 232 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); |
| 233 | return -EINVAL; |
| 234 | } |
| 235 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); |
| 236 | |
| 237 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
| 238 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
| 239 | else |
| 240 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
| 241 | |
| 242 | lcd_enabled = 1; |
| 243 | return 0; |
| 244 | } |
| 245 | |
| 246 | static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) |
| 247 | { |
| 248 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); |
| 249 | |
| 250 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
| 251 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
| 252 | else |
| 253 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
| 254 | |
| 255 | lcd_enabled = 0; |
| 256 | } |
| 257 | |
| 258 | static struct omap_dss_device omap3_evm_lcd_device = { |
| 259 | .name = "lcd", |
| 260 | .driver_name = "sharp_ls_panel", |
| 261 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 262 | .phy.dpi.data_lines = 18, |
| 263 | .platform_enable = omap3_evm_enable_lcd, |
| 264 | .platform_disable = omap3_evm_disable_lcd, |
| 265 | }; |
| 266 | |
| 267 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) |
| 268 | { |
| 269 | return 0; |
| 270 | } |
| 271 | |
| 272 | static void omap3_evm_disable_tv(struct omap_dss_device *dssdev) |
| 273 | { |
| 274 | } |
| 275 | |
| 276 | static struct omap_dss_device omap3_evm_tv_device = { |
| 277 | .name = "tv", |
| 278 | .driver_name = "venc", |
| 279 | .type = OMAP_DISPLAY_TYPE_VENC, |
| 280 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, |
| 281 | .platform_enable = omap3_evm_enable_tv, |
| 282 | .platform_disable = omap3_evm_disable_tv, |
| 283 | }; |
| 284 | |
| 285 | static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) |
| 286 | { |
| 287 | if (lcd_enabled) { |
| 288 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); |
| 289 | return -EINVAL; |
| 290 | } |
| 291 | |
| 292 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); |
| 293 | |
| 294 | dvi_enabled = 1; |
| 295 | return 0; |
| 296 | } |
| 297 | |
| 298 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) |
| 299 | { |
| 300 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); |
| 301 | |
| 302 | dvi_enabled = 0; |
| 303 | } |
| 304 | |
Bryan Wu | 89747c9 | 2010-11-17 13:34:34 +0000 | [diff] [blame] | 305 | static struct panel_generic_dpi_data dvi_panel = { |
| 306 | .name = "generic", |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 307 | .platform_enable = omap3_evm_enable_dvi, |
| 308 | .platform_disable = omap3_evm_disable_dvi, |
| 309 | }; |
| 310 | |
Bryan Wu | 89747c9 | 2010-11-17 13:34:34 +0000 | [diff] [blame] | 311 | static struct omap_dss_device omap3_evm_dvi_device = { |
| 312 | .name = "dvi", |
| 313 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 314 | .driver_name = "generic_dpi_panel", |
| 315 | .data = &dvi_panel, |
| 316 | .phy.dpi.data_lines = 24, |
| 317 | }; |
| 318 | |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 319 | static struct omap_dss_device *omap3_evm_dss_devices[] = { |
| 320 | &omap3_evm_lcd_device, |
| 321 | &omap3_evm_tv_device, |
| 322 | &omap3_evm_dvi_device, |
| 323 | }; |
| 324 | |
| 325 | static struct omap_dss_board_info omap3_evm_dss_data = { |
| 326 | .num_devices = ARRAY_SIZE(omap3_evm_dss_devices), |
| 327 | .devices = omap3_evm_dss_devices, |
| 328 | .default_device = &omap3_evm_lcd_device, |
| 329 | }; |
| 330 | |
Mike Rapoport | 1a7ec13 | 2009-11-22 10:11:29 -0800 | [diff] [blame] | 331 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { |
| 332 | .supply = "vmmc", |
| 333 | }; |
| 334 | |
| 335 | static struct regulator_consumer_supply omap3evm_vsim_supply = { |
| 336 | .supply = "vmmc_aux", |
| 337 | }; |
| 338 | |
| 339 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
| 340 | static struct regulator_init_data omap3evm_vmmc1 = { |
| 341 | .constraints = { |
| 342 | .min_uV = 1850000, |
| 343 | .max_uV = 3150000, |
| 344 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 345 | | REGULATOR_MODE_STANDBY, |
| 346 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 347 | | REGULATOR_CHANGE_MODE |
| 348 | | REGULATOR_CHANGE_STATUS, |
| 349 | }, |
| 350 | .num_consumer_supplies = 1, |
| 351 | .consumer_supplies = &omap3evm_vmmc1_supply, |
| 352 | }; |
| 353 | |
| 354 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ |
| 355 | static struct regulator_init_data omap3evm_vsim = { |
| 356 | .constraints = { |
| 357 | .min_uV = 1800000, |
| 358 | .max_uV = 3000000, |
| 359 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 360 | | REGULATOR_MODE_STANDBY, |
| 361 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 362 | | REGULATOR_CHANGE_MODE |
| 363 | | REGULATOR_CHANGE_STATUS, |
| 364 | }, |
| 365 | .num_consumer_supplies = 1, |
| 366 | .consumer_supplies = &omap3evm_vsim_supply, |
| 367 | }; |
| 368 | |
Adrian Hunter | 68ff042 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 369 | static struct omap2_hsmmc_info mmc[] = { |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 370 | { |
| 371 | .mmc = 1, |
Sukumar Ghorai | 3a63833 | 2010-09-15 14:49:23 +0000 | [diff] [blame] | 372 | .caps = MMC_CAP_4_BIT_DATA, |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 373 | .gpio_cd = -EINVAL, |
| 374 | .gpio_wp = 63, |
| 375 | }, |
| 376 | {} /* Terminator */ |
| 377 | }; |
| 378 | |
| 379 | static struct gpio_led gpio_leds[] = { |
| 380 | { |
| 381 | .name = "omap3evm::ledb", |
| 382 | /* normally not visible (board underside) */ |
| 383 | .default_trigger = "default-on", |
| 384 | .gpio = -EINVAL, /* gets replaced */ |
| 385 | .active_low = true, |
| 386 | }, |
| 387 | }; |
| 388 | |
| 389 | static struct gpio_led_platform_data gpio_led_info = { |
| 390 | .leds = gpio_leds, |
| 391 | .num_leds = ARRAY_SIZE(gpio_leds), |
| 392 | }; |
| 393 | |
| 394 | static struct platform_device leds_gpio = { |
| 395 | .name = "leds-gpio", |
| 396 | .id = -1, |
| 397 | .dev = { |
| 398 | .platform_data = &gpio_led_info, |
| 399 | }, |
| 400 | }; |
| 401 | |
| 402 | |
| 403 | static int omap3evm_twl_gpio_setup(struct device *dev, |
| 404 | unsigned gpio, unsigned ngpio) |
| 405 | { |
| 406 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 407 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 408 | mmc[0].gpio_cd = gpio + 0; |
Adrian Hunter | 68ff042 | 2010-02-15 10:03:34 -0800 | [diff] [blame] | 409 | omap2_hsmmc_init(mmc); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 410 | |
Mike Rapoport | 1a7ec13 | 2009-11-22 10:11:29 -0800 | [diff] [blame] | 411 | /* link regulators to MMC adapters */ |
| 412 | omap3evm_vmmc1_supply.dev = mmc[0].dev; |
| 413 | omap3evm_vsim_supply.dev = mmc[0].dev; |
| 414 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 415 | /* |
| 416 | * Most GPIOs are for USB OTG. Some are mostly sent to |
| 417 | * the P2 connector; notably LEDA for the LCD backlight. |
| 418 | */ |
| 419 | |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 420 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ |
| 421 | gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); |
| 422 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); |
| 423 | |
| 424 | /* gpio + 7 == DVI Enable */ |
| 425 | gpio_request(gpio + 7, "EN_DVI"); |
| 426 | gpio_direction_output(gpio + 7, 0); |
| 427 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 428 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ |
| 429 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
| 430 | |
| 431 | platform_device_register(&leds_gpio); |
| 432 | |
| 433 | return 0; |
| 434 | } |
| 435 | |
| 436 | static struct twl4030_gpio_platform_data omap3evm_gpio_data = { |
| 437 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 438 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
| 439 | .irq_end = TWL4030_GPIO_IRQ_END, |
| 440 | .use_leds = true, |
| 441 | .setup = omap3evm_twl_gpio_setup, |
| 442 | }; |
| 443 | |
| 444 | static struct twl4030_usb_data omap3evm_usb_data = { |
| 445 | .usb_mode = T2_USB_MODE_ULPI, |
| 446 | }; |
| 447 | |
Manjunath Kondaiah G | bead437 | 2010-10-08 10:01:13 -0700 | [diff] [blame] | 448 | static uint32_t board_keymap[] = { |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 449 | KEY(0, 0, KEY_LEFT), |
Sanjeev Premi | 0621d75 | 2010-02-17 14:09:24 -0800 | [diff] [blame] | 450 | KEY(0, 1, KEY_DOWN), |
| 451 | KEY(0, 2, KEY_ENTER), |
| 452 | KEY(0, 3, KEY_M), |
| 453 | |
| 454 | KEY(1, 0, KEY_RIGHT), |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 455 | KEY(1, 1, KEY_UP), |
Sanjeev Premi | 0621d75 | 2010-02-17 14:09:24 -0800 | [diff] [blame] | 456 | KEY(1, 2, KEY_I), |
| 457 | KEY(1, 3, KEY_N), |
| 458 | |
| 459 | KEY(2, 0, KEY_A), |
| 460 | KEY(2, 1, KEY_E), |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 461 | KEY(2, 2, KEY_J), |
Sanjeev Premi | 0621d75 | 2010-02-17 14:09:24 -0800 | [diff] [blame] | 462 | KEY(2, 3, KEY_O), |
| 463 | |
| 464 | KEY(3, 0, KEY_B), |
| 465 | KEY(3, 1, KEY_F), |
| 466 | KEY(3, 2, KEY_K), |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 467 | KEY(3, 3, KEY_P) |
| 468 | }; |
| 469 | |
Tony Lindgren | 4f54333 | 2009-09-24 16:23:16 -0700 | [diff] [blame] | 470 | static struct matrix_keymap_data board_map_data = { |
| 471 | .keymap = board_keymap, |
| 472 | .keymap_size = ARRAY_SIZE(board_keymap), |
| 473 | }; |
| 474 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 475 | static struct twl4030_keypad_data omap3evm_kp_data = { |
Tony Lindgren | 4f54333 | 2009-09-24 16:23:16 -0700 | [diff] [blame] | 476 | .keymap_data = &board_map_data, |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 477 | .rows = 4, |
| 478 | .cols = 4, |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 479 | .rep = 1, |
| 480 | }; |
| 481 | |
| 482 | static struct twl4030_madc_platform_data omap3evm_madc_data = { |
| 483 | .irq_line = 1, |
| 484 | }; |
| 485 | |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 486 | static struct twl4030_codec_audio_data omap3evm_audio_data = { |
| 487 | .audio_mclk = 26000000, |
| 488 | }; |
| 489 | |
| 490 | static struct twl4030_codec_data omap3evm_codec_data = { |
Peter Ujfalusi | 6df74ef | 2009-11-04 09:58:18 +0200 | [diff] [blame] | 491 | .audio_mclk = 26000000, |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 492 | .audio = &omap3evm_audio_data, |
| 493 | }; |
| 494 | |
Senthilvadivu Guruswamy | 1dde973 | 2011-01-24 06:21:53 +0000 | [diff] [blame] | 495 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = |
| 496 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 497 | |
| 498 | /* VDAC for DSS driving S-Video */ |
| 499 | static struct regulator_init_data omap3_evm_vdac = { |
| 500 | .constraints = { |
| 501 | .min_uV = 1800000, |
| 502 | .max_uV = 1800000, |
| 503 | .apply_uV = true, |
| 504 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 505 | | REGULATOR_MODE_STANDBY, |
| 506 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 507 | | REGULATOR_CHANGE_STATUS, |
| 508 | }, |
| 509 | .num_consumer_supplies = 1, |
| 510 | .consumer_supplies = &omap3_evm_vdda_dac_supply, |
| 511 | }; |
| 512 | |
| 513 | /* VPLL2 for digital video outputs */ |
Vaibhav Hiremath | f3fe53c | 2010-03-19 11:21:19 +0000 | [diff] [blame] | 514 | static struct regulator_consumer_supply omap3_evm_vpll2_supply = |
| 515 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 516 | |
| 517 | static struct regulator_init_data omap3_evm_vpll2 = { |
| 518 | .constraints = { |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 519 | .min_uV = 1800000, |
| 520 | .max_uV = 1800000, |
| 521 | .apply_uV = true, |
| 522 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 523 | | REGULATOR_MODE_STANDBY, |
| 524 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 525 | | REGULATOR_CHANGE_STATUS, |
| 526 | }, |
| 527 | .num_consumer_supplies = 1, |
| 528 | .consumer_supplies = &omap3_evm_vpll2_supply, |
| 529 | }; |
| 530 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 531 | static struct twl4030_platform_data omap3evm_twldata = { |
| 532 | .irq_base = TWL4030_IRQ_BASE, |
| 533 | .irq_end = TWL4030_IRQ_END, |
| 534 | |
| 535 | /* platform_data for children goes here */ |
| 536 | .keypad = &omap3evm_kp_data, |
| 537 | .madc = &omap3evm_madc_data, |
| 538 | .usb = &omap3evm_usb_data, |
| 539 | .gpio = &omap3evm_gpio_data, |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 540 | .codec = &omap3evm_codec_data, |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 541 | .vdac = &omap3_evm_vdac, |
| 542 | .vpll2 = &omap3_evm_vpll2, |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 543 | }; |
| 544 | |
| 545 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { |
| 546 | { |
| 547 | I2C_BOARD_INFO("twl4030", 0x48), |
| 548 | .flags = I2C_CLIENT_WAKE, |
| 549 | .irq = INT_34XX_SYS_NIRQ, |
| 550 | .platform_data = &omap3evm_twldata, |
| 551 | }, |
| 552 | }; |
| 553 | |
| 554 | static int __init omap3_evm_i2c_init(void) |
| 555 | { |
Mike Rapoport | 1a7ec13 | 2009-11-22 10:11:29 -0800 | [diff] [blame] | 556 | /* |
| 557 | * REVISIT: These entries can be set in omap3evm_twl_data |
| 558 | * after a merge with MFD tree |
| 559 | */ |
| 560 | omap3evm_twldata.vmmc1 = &omap3evm_vmmc1; |
| 561 | omap3evm_twldata.vsim = &omap3evm_vsim; |
| 562 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 563 | omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo, |
| 564 | ARRAY_SIZE(omap3evm_i2c_boardinfo)); |
| 565 | omap_register_i2c_bus(2, 400, NULL, 0); |
| 566 | omap_register_i2c_bus(3, 400, NULL, 0); |
| 567 | return 0; |
| 568 | } |
| 569 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 570 | static void ads7846_dev_init(void) |
| 571 | { |
| 572 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) |
| 573 | printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); |
| 574 | |
| 575 | gpio_direction_input(OMAP3_EVM_TS_GPIO); |
Felipe Balbi | 48feb33 | 2010-05-26 14:42:24 -0700 | [diff] [blame] | 576 | gpio_set_debounce(OMAP3_EVM_TS_GPIO, 310); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 577 | } |
| 578 | |
| 579 | static int ads7846_get_pendown_state(void) |
| 580 | { |
| 581 | return !gpio_get_value(OMAP3_EVM_TS_GPIO); |
| 582 | } |
| 583 | |
Manjunath Kondaiah G | 3881573 | 2010-10-08 09:56:37 -0700 | [diff] [blame] | 584 | static struct ads7846_platform_data ads7846_config = { |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 585 | .x_max = 0x0fff, |
| 586 | .y_max = 0x0fff, |
| 587 | .x_plate_ohms = 180, |
| 588 | .pressure_max = 255, |
| 589 | .debounce_max = 10, |
| 590 | .debounce_tol = 3, |
| 591 | .debounce_rep = 1, |
| 592 | .get_pendown_state = ads7846_get_pendown_state, |
| 593 | .keep_vref_on = 1, |
| 594 | .settle_delay_usecs = 150, |
Ranjith Lohithakshan | 7a44ad2 | 2010-05-08 12:39:21 +0530 | [diff] [blame] | 595 | .wakeup = true, |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 596 | }; |
| 597 | |
| 598 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { |
| 599 | .turbo_mode = 0, |
| 600 | .single_channel = 1, /* 0: slave, 1: master */ |
| 601 | }; |
| 602 | |
Manjunath Kondaiah G | 3881573 | 2010-10-08 09:56:37 -0700 | [diff] [blame] | 603 | static struct spi_board_info omap3evm_spi_board_info[] = { |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 604 | [0] = { |
| 605 | .modalias = "ads7846", |
| 606 | .bus_num = 1, |
| 607 | .chip_select = 0, |
| 608 | .max_speed_hz = 1500000, |
| 609 | .controller_data = &ads7846_mcspi_config, |
| 610 | .irq = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO), |
| 611 | .platform_data = &ads7846_config, |
| 612 | }, |
| 613 | }; |
| 614 | |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 615 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 616 | }; |
| 617 | |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 618 | static void __init omap3_evm_init_early(void) |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 619 | { |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 620 | omap_board_config = omap3_evm_config; |
| 621 | omap_board_config_size = ARRAY_SIZE(omap3_evm_config); |
Paul Walmsley | 4805734 | 2010-12-21 15:25:10 -0700 | [diff] [blame] | 622 | omap2_init_common_infrastructure(); |
| 623 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 624 | } |
| 625 | |
Felipe Balbi | 6f69a18 | 2010-03-04 09:45:53 +0200 | [diff] [blame] | 626 | static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 627 | |
| 628 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 629 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, |
| 630 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 631 | |
| 632 | .phy_reset = true, |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 633 | /* PHY reset GPIO will be runtime programmed based on EVM version */ |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 634 | .reset_gpio_port[0] = -EINVAL, |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 635 | .reset_gpio_port[1] = -EINVAL, |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 636 | .reset_gpio_port[2] = -EINVAL |
| 637 | }; |
| 638 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 639 | #ifdef CONFIG_OMAP_MUX |
| 640 | static struct omap_board_mux board_mux[] __initdata = { |
Sanjeev Premi | aa6912d8 | 2010-02-17 14:09:23 -0800 | [diff] [blame] | 641 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | |
Ranjith Lohithakshan | f3a8cde | 2010-05-03 17:07:51 +0530 | [diff] [blame] | 642 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | |
Sanjeev Premi | aa6912d8 | 2010-02-17 14:09:23 -0800 | [diff] [blame] | 643 | OMAP_PIN_OFF_WAKEUPENABLE), |
Sanjeev Premi | 87520aa | 2010-02-17 14:09:24 -0800 | [diff] [blame] | 644 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | |
Ranjith Lohithakshan | 7a44ad2 | 2010-05-08 12:39:21 +0530 | [diff] [blame] | 645 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 646 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 647 | }; |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 648 | #endif |
| 649 | |
Maulik Mankad | 884b836 | 2010-02-17 14:09:30 -0800 | [diff] [blame] | 650 | static struct omap_musb_board_data musb_board_data = { |
| 651 | .interface_type = MUSB_INTERFACE_ULPI, |
| 652 | .mode = MUSB_OTG, |
| 653 | .power = 100, |
| 654 | }; |
| 655 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 656 | static void __init omap3_evm_init(void) |
| 657 | { |
Ajay Kumar Gupta | db40802 | 2009-11-22 10:11:27 -0800 | [diff] [blame] | 658 | omap3_evm_get_revision(); |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 659 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
Ajay Kumar Gupta | db40802 | 2009-11-22 10:11:27 -0800 | [diff] [blame] | 660 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 661 | omap3_evm_i2c_init(); |
| 662 | |
Senthilvadivu Guruswamy | d5e1322 | 2011-02-22 11:24:50 +0200 | [diff] [blame^] | 663 | omap_display_init(&omap3_evm_dss_data); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 664 | |
| 665 | spi_register_board_info(omap3evm_spi_board_info, |
| 666 | ARRAY_SIZE(omap3evm_spi_board_info)); |
| 667 | |
| 668 | omap_serial_init(); |
Maulik Mankad | 1a4f463 | 2010-02-17 14:09:29 -0800 | [diff] [blame] | 669 | |
Gupta, Ajay Kumar | e8e2ff4 | 2009-07-29 11:58:57 +0530 | [diff] [blame] | 670 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ |
| 671 | usb_nop_xceiv_register(); |
Maulik Mankad | 1a4f463 | 2010-02-17 14:09:29 -0800 | [diff] [blame] | 672 | |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 673 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { |
| 674 | /* enable EHCI VBUS using GPIO22 */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 675 | omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP); |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 676 | gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS"); |
| 677 | gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0); |
| 678 | gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1); |
| 679 | |
| 680 | /* Select EHCI port on main board */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 681 | omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 682 | gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); |
| 683 | gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); |
| 684 | gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); |
| 685 | |
| 686 | /* setup EHCI phy reset config */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 687 | omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 688 | ehci_pdata.reset_gpio_port[1] = 21; |
| 689 | |
Ajay Kumar Gupta | 58815fa | 2010-03-25 13:25:27 +0200 | [diff] [blame] | 690 | /* EVM REV >= E can supply 500mA with EXTVBUS programming */ |
| 691 | musb_board_data.power = 500; |
| 692 | musb_board_data.extvbus = 1; |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 693 | } else { |
| 694 | /* setup EHCI phy reset on MDC */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 695 | omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); |
Ajay Kumar Gupta | e8e51d2 | 2009-11-22 10:11:28 -0800 | [diff] [blame] | 696 | ehci_pdata.reset_gpio_port[1] = 135; |
| 697 | } |
Maulik Mankad | 884b836 | 2010-02-17 14:09:30 -0800 | [diff] [blame] | 698 | usb_musb_init(&musb_board_data); |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 699 | usb_ehci_init(&ehci_pdata); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 700 | ads7846_dev_init(); |
Sriram | 562138a | 2009-11-22 10:11:30 -0800 | [diff] [blame] | 701 | omap3evm_init_smsc911x(); |
Vaibhav Hiremath | 703e306 | 2010-01-04 15:34:16 +0100 | [diff] [blame] | 702 | omap3_evm_display_init(); |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 703 | } |
| 704 | |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 705 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") |
| 706 | /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 707 | .boot_params = 0x80000100, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 708 | .reserve = omap_reserve, |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 709 | .map_io = omap3_map_io, |
| 710 | .init_early = omap3_evm_init_early, |
| 711 | .init_irq = omap_init_irq, |
Syed Mohammed Khasim | 53c5ec3 | 2009-05-28 14:13:28 -0700 | [diff] [blame] | 712 | .init_machine = omap3_evm_init, |
| 713 | .timer = &omap_timer, |
| 714 | MACHINE_END |