2 * linux/arch/arm/mach-omap2/board-omap3evm.c
4 * Copyright (C) 2008 Texas Instruments
6 * Modified from mach-omap2/board-3430sdp.c
8 * Initial code: Syed Mohammed Khasim
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.
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>
23 #include <linux/input/matrix_keypad.h>
24 #include <linux/leds.h>
25 #include <linux/interrupt.h>
27 #include <linux/spi/spi.h>
28 #include <linux/spi/ads7846.h>
29 #include <linux/i2c/twl.h>
30 #include <linux/usb/otg.h>
31 #include <linux/smsc911x.h>
33 #include <linux/wl12xx.h>
34 #include <linux/regulator/fixed.h>
35 #include <linux/regulator/machine.h>
36 #include <linux/mmc/host.h>
38 #include <mach/hardware.h>
39 #include <asm/mach-types.h>
40 #include <asm/mach/arch.h>
41 #include <asm/mach/map.h>
43 #include <plat/board.h>
45 #include <plat/common.h>
46 #include <plat/mcspi.h>
47 #include <plat/display.h>
48 #include <plat/panel-generic-dpi.h>
51 #include "sdram-micron-mt46h32m32lf-6.h"
54 #define OMAP3_EVM_TS_GPIO 175
55 #define OMAP3_EVM_EHCI_VBUS 22
56 #define OMAP3_EVM_EHCI_SELECT 61
58 #define OMAP3EVM_ETHR_START 0x2c000000
59 #define OMAP3EVM_ETHR_SIZE 1024
60 #define OMAP3EVM_ETHR_ID_REV 0x50
61 #define OMAP3EVM_ETHR_GPIO_IRQ 176
62 #define OMAP3EVM_SMSC911X_CS 5
65 * 64 = Generation 1 (<=RevD)
66 * 7 = Generation 2 (>=RevE)
68 #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
69 #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
71 static u8 omap3_evm_version;
73 u8 get_omap3_evm_rev(void)
75 return omap3_evm_version;
77 EXPORT_SYMBOL(get_omap3_evm_rev);
79 static void __init omap3_evm_get_revision(void)
84 /* Ethernet PHY ID is stored at ID_REV register */
85 ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K);
88 smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000;
94 omap3_evm_version = OMAP3EVM_BOARD_GEN_1;
99 omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
103 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
104 static struct resource omap3evm_smsc911x_resources[] = {
106 .start = OMAP3EVM_ETHR_START,
107 .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
108 .flags = IORESOURCE_MEM,
111 .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
112 .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
113 .flags = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
117 static struct smsc911x_platform_config smsc911x_config = {
118 .phy_interface = PHY_INTERFACE_MODE_MII,
119 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
120 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
121 .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
124 static struct platform_device omap3evm_smsc911x_device = {
127 .num_resources = ARRAY_SIZE(omap3evm_smsc911x_resources),
128 .resource = &omap3evm_smsc911x_resources[0],
130 .platform_data = &smsc911x_config,
134 static inline void __init omap3evm_init_smsc911x(void)
140 if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
141 eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
143 eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
145 eth_cs = OMAP3EVM_SMSC911X_CS;
147 l3ck = clk_get(NULL, "l3_ck");
151 rate = clk_get_rate(l3ck);
153 /* Configure ethernet controller reset gpio */
154 if (cpu_is_omap3430()) {
155 if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
156 pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
161 if (gpio_direction_output(eth_rst, 1) < 0) {
162 pr_err(KERN_ERR "Failed to set direction of %d for" \
163 " smsc911x\n", eth_rst);
166 /* reset pulse to ethernet controller*/
167 usleep_range(150, 220);
168 gpio_set_value(eth_rst, 0);
169 usleep_range(150, 220);
170 gpio_set_value(eth_rst, 1);
174 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
175 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
176 OMAP3EVM_ETHR_GPIO_IRQ);
180 gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
181 platform_device_register(&omap3evm_smsc911x_device);
185 static inline void __init omap3evm_init_smsc911x(void) { return; }
189 * OMAP3EVM LCD Panel control signals
191 #define OMAP3EVM_LCD_PANEL_LR 2
192 #define OMAP3EVM_LCD_PANEL_UD 3
193 #define OMAP3EVM_LCD_PANEL_INI 152
194 #define OMAP3EVM_LCD_PANEL_ENVDD 153
195 #define OMAP3EVM_LCD_PANEL_QVGA 154
196 #define OMAP3EVM_LCD_PANEL_RESB 155
197 #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210
198 #define OMAP3EVM_DVI_PANEL_EN_GPIO 199
200 static int lcd_enabled;
201 static int dvi_enabled;
203 static void __init omap3_evm_display_init(void)
207 r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb");
209 printk(KERN_ERR "failed to get lcd_panel_resb\n");
212 gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1);
214 r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini");
216 printk(KERN_ERR "failed to get lcd_panel_ini\n");
219 gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1);
221 r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga");
223 printk(KERN_ERR "failed to get lcd_panel_qvga\n");
226 gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0);
228 r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr");
230 printk(KERN_ERR "failed to get lcd_panel_lr\n");
233 gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1);
235 r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud");
237 printk(KERN_ERR "failed to get lcd_panel_ud\n");
240 gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1);
242 r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd");
244 printk(KERN_ERR "failed to get lcd_panel_envdd\n");
247 gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0);
252 gpio_free(OMAP3EVM_LCD_PANEL_UD);
254 gpio_free(OMAP3EVM_LCD_PANEL_LR);
256 gpio_free(OMAP3EVM_LCD_PANEL_QVGA);
258 gpio_free(OMAP3EVM_LCD_PANEL_INI);
260 gpio_free(OMAP3EVM_LCD_PANEL_RESB);
264 static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev)
267 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
270 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0);
272 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
273 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
275 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
281 static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev)
283 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1);
285 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
286 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
288 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
293 static struct omap_dss_device omap3_evm_lcd_device = {
295 .driver_name = "sharp_ls_panel",
296 .type = OMAP_DISPLAY_TYPE_DPI,
297 .phy.dpi.data_lines = 18,
298 .platform_enable = omap3_evm_enable_lcd,
299 .platform_disable = omap3_evm_disable_lcd,
302 static int omap3_evm_enable_tv(struct omap_dss_device *dssdev)
307 static void omap3_evm_disable_tv(struct omap_dss_device *dssdev)
311 static struct omap_dss_device omap3_evm_tv_device = {
313 .driver_name = "venc",
314 .type = OMAP_DISPLAY_TYPE_VENC,
315 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
316 .platform_enable = omap3_evm_enable_tv,
317 .platform_disable = omap3_evm_disable_tv,
320 static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
323 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
327 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1);
333 static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
335 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0);
340 static struct panel_generic_dpi_data dvi_panel = {
342 .platform_enable = omap3_evm_enable_dvi,
343 .platform_disable = omap3_evm_disable_dvi,
346 static struct omap_dss_device omap3_evm_dvi_device = {
348 .type = OMAP_DISPLAY_TYPE_DPI,
349 .driver_name = "generic_dpi_panel",
351 .phy.dpi.data_lines = 24,
354 static struct omap_dss_device *omap3_evm_dss_devices[] = {
355 &omap3_evm_lcd_device,
356 &omap3_evm_tv_device,
357 &omap3_evm_dvi_device,
360 static struct omap_dss_board_info omap3_evm_dss_data = {
361 .num_devices = ARRAY_SIZE(omap3_evm_dss_devices),
362 .devices = omap3_evm_dss_devices,
363 .default_device = &omap3_evm_lcd_device,
366 static struct platform_device omap3_evm_dss_device = {
370 .platform_data = &omap3_evm_dss_data,
374 static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
378 static struct regulator_consumer_supply omap3evm_vsim_supply = {
379 .supply = "vmmc_aux",
382 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
383 static struct regulator_init_data omap3evm_vmmc1 = {
387 .valid_modes_mask = REGULATOR_MODE_NORMAL
388 | REGULATOR_MODE_STANDBY,
389 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
390 | REGULATOR_CHANGE_MODE
391 | REGULATOR_CHANGE_STATUS,
393 .num_consumer_supplies = 1,
394 .consumer_supplies = &omap3evm_vmmc1_supply,
397 /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
398 static struct regulator_init_data omap3evm_vsim = {
402 .valid_modes_mask = REGULATOR_MODE_NORMAL
403 | REGULATOR_MODE_STANDBY,
404 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
405 | REGULATOR_CHANGE_MODE
406 | REGULATOR_CHANGE_STATUS,
408 .num_consumer_supplies = 1,
409 .consumer_supplies = &omap3evm_vsim_supply,
412 static struct omap2_hsmmc_info mmc[] = {
415 .caps = MMC_CAP_4_BIT_DATA,
419 #ifdef CONFIG_WL12XX_PLATFORM_DATA
423 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
426 .nonremovable = true,
432 static struct gpio_led gpio_leds[] = {
434 .name = "omap3evm::ledb",
435 /* normally not visible (board underside) */
436 .default_trigger = "default-on",
437 .gpio = -EINVAL, /* gets replaced */
442 static struct gpio_led_platform_data gpio_led_info = {
444 .num_leds = ARRAY_SIZE(gpio_leds),
447 static struct platform_device leds_gpio = {
451 .platform_data = &gpio_led_info,
456 static int omap3evm_twl_gpio_setup(struct device *dev,
457 unsigned gpio, unsigned ngpio)
459 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
460 omap_mux_init_gpio(63, OMAP_PIN_INPUT);
461 mmc[0].gpio_cd = gpio + 0;
462 omap2_hsmmc_init(mmc);
464 /* link regulators to MMC adapters */
465 omap3evm_vmmc1_supply.dev = mmc[0].dev;
466 omap3evm_vsim_supply.dev = mmc[0].dev;
469 * Most GPIOs are for USB OTG. Some are mostly sent to
470 * the P2 connector; notably LEDA for the LCD backlight.
473 /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
474 gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
475 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
477 /* gpio + 7 == DVI Enable */
478 gpio_request(gpio + 7, "EN_DVI");
479 gpio_direction_output(gpio + 7, 0);
481 /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
482 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
484 platform_device_register(&leds_gpio);
489 static struct twl4030_gpio_platform_data omap3evm_gpio_data = {
490 .gpio_base = OMAP_MAX_GPIO_LINES,
491 .irq_base = TWL4030_GPIO_IRQ_BASE,
492 .irq_end = TWL4030_GPIO_IRQ_END,
494 .setup = omap3evm_twl_gpio_setup,
497 static struct twl4030_usb_data omap3evm_usb_data = {
498 .usb_mode = T2_USB_MODE_ULPI,
501 static uint32_t board_keymap[] = {
504 KEY(0, 2, KEY_ENTER),
507 KEY(1, 0, KEY_RIGHT),
523 static struct matrix_keymap_data board_map_data = {
524 .keymap = board_keymap,
525 .keymap_size = ARRAY_SIZE(board_keymap),
528 static struct twl4030_keypad_data omap3evm_kp_data = {
529 .keymap_data = &board_map_data,
535 static struct twl4030_madc_platform_data omap3evm_madc_data = {
539 static struct twl4030_codec_audio_data omap3evm_audio_data = {
540 .audio_mclk = 26000000,
543 static struct twl4030_codec_data omap3evm_codec_data = {
544 .audio_mclk = 26000000,
545 .audio = &omap3evm_audio_data,
548 static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = {
549 .supply = "vdda_dac",
550 .dev = &omap3_evm_dss_device.dev,
553 /* VDAC for DSS driving S-Video */
554 static struct regulator_init_data omap3_evm_vdac = {
559 .valid_modes_mask = REGULATOR_MODE_NORMAL
560 | REGULATOR_MODE_STANDBY,
561 .valid_ops_mask = REGULATOR_CHANGE_MODE
562 | REGULATOR_CHANGE_STATUS,
564 .num_consumer_supplies = 1,
565 .consumer_supplies = &omap3_evm_vdda_dac_supply,
568 /* VPLL2 for digital video outputs */
569 static struct regulator_consumer_supply omap3_evm_vpll2_supply =
570 REGULATOR_SUPPLY("vdds_dsi", "omapdss");
572 static struct regulator_init_data omap3_evm_vpll2 = {
577 .valid_modes_mask = REGULATOR_MODE_NORMAL
578 | REGULATOR_MODE_STANDBY,
579 .valid_ops_mask = REGULATOR_CHANGE_MODE
580 | REGULATOR_CHANGE_STATUS,
582 .num_consumer_supplies = 1,
583 .consumer_supplies = &omap3_evm_vpll2_supply,
586 #ifdef CONFIG_WL12XX_PLATFORM_DATA
588 #define OMAP3EVM_WLAN_PMENA_GPIO (150)
589 #define OMAP3EVM_WLAN_IRQ_GPIO (149)
591 static struct regulator_consumer_supply omap3evm_vmmc2_supply = {
593 .dev_name = "mmci-omap-hs.1",
596 /* VMMC2 for driving the WL12xx module */
597 static struct regulator_init_data omap3evm_vmmc2 = {
599 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
601 .num_consumer_supplies = 1,
602 .consumer_supplies = &omap3evm_vmmc2_supply,
605 static struct fixed_voltage_config omap3evm_vwlan = {
606 .supply_name = "vwl1271",
607 .microvolts = 1800000, /* 1.80V */
608 .gpio = OMAP3EVM_WLAN_PMENA_GPIO,
609 .startup_delay = 70000, /* 70ms */
611 .enabled_at_boot = 0,
612 .init_data = &omap3evm_vmmc2,
615 static struct platform_device omap3evm_vwlan_device = {
616 .name = "reg-fixed-voltage",
619 .platform_data = &omap3evm_vwlan,
623 struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
624 .irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO),
625 /* ref clock is 38.4 MHz */
626 .board_ref_clock = 2,
630 static struct twl4030_platform_data omap3evm_twldata = {
631 .irq_base = TWL4030_IRQ_BASE,
632 .irq_end = TWL4030_IRQ_END,
634 /* platform_data for children goes here */
635 .keypad = &omap3evm_kp_data,
636 .madc = &omap3evm_madc_data,
637 .usb = &omap3evm_usb_data,
638 .gpio = &omap3evm_gpio_data,
639 .codec = &omap3evm_codec_data,
640 .vdac = &omap3_evm_vdac,
641 .vpll2 = &omap3_evm_vpll2,
644 static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
646 I2C_BOARD_INFO("twl4030", 0x48),
647 .flags = I2C_CLIENT_WAKE,
648 .irq = INT_34XX_SYS_NIRQ,
649 .platform_data = &omap3evm_twldata,
653 static int __init omap3_evm_i2c_init(void)
656 * REVISIT: These entries can be set in omap3evm_twl_data
657 * after a merge with MFD tree
659 omap3evm_twldata.vmmc1 = &omap3evm_vmmc1;
660 omap3evm_twldata.vsim = &omap3evm_vsim;
662 omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo,
663 ARRAY_SIZE(omap3evm_i2c_boardinfo));
664 omap_register_i2c_bus(2, 400, NULL, 0);
665 omap_register_i2c_bus(3, 400, NULL, 0);
669 static void ads7846_dev_init(void)
671 if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
672 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
674 gpio_direction_input(OMAP3_EVM_TS_GPIO);
675 gpio_set_debounce(OMAP3_EVM_TS_GPIO, 310);
678 static int ads7846_get_pendown_state(void)
680 return !gpio_get_value(OMAP3_EVM_TS_GPIO);
683 static struct ads7846_platform_data ads7846_config = {
691 .get_pendown_state = ads7846_get_pendown_state,
693 .settle_delay_usecs = 150,
697 static struct omap2_mcspi_device_config ads7846_mcspi_config = {
699 .single_channel = 1, /* 0: slave, 1: master */
702 static struct spi_board_info omap3evm_spi_board_info[] = {
704 .modalias = "ads7846",
707 .max_speed_hz = 1500000,
708 .controller_data = &ads7846_mcspi_config,
709 .irq = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO),
710 .platform_data = &ads7846_config,
714 static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
717 static void __init omap3_evm_init_early(void)
719 omap_board_config = omap3_evm_config;
720 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
721 omap2_init_common_infrastructure();
722 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
725 static struct platform_device *omap3_evm_devices[] __initdata = {
726 &omap3_evm_dss_device,
729 static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
731 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
732 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
733 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
736 /* PHY reset GPIO will be runtime programmed based on EVM version */
737 .reset_gpio_port[0] = -EINVAL,
738 .reset_gpio_port[1] = -EINVAL,
739 .reset_gpio_port[2] = -EINVAL
742 #ifdef CONFIG_OMAP_MUX
743 static struct omap_board_mux board_mux[] __initdata = {
744 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP |
745 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
746 OMAP_PIN_OFF_WAKEUPENABLE),
747 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
748 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW),
749 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
751 OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
753 #ifdef CONFIG_WL12XX_PLATFORM_DATA
754 /* WLAN IRQ - GPIO 149 */
755 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
757 /* WLAN POWER ENABLE - GPIO 150 */
758 OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
760 /* MMC2 SDIO pin muxes for WL12xx */
761 OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
762 OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
763 OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
764 OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
765 OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
766 OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
768 { .reg_offset = OMAP_MUX_TERMINATOR },
772 static struct omap_musb_board_data musb_board_data = {
773 .interface_type = MUSB_INTERFACE_ULPI,
778 static void __init omap3_evm_init(void)
780 omap3_evm_get_revision();
781 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
783 omap3_evm_i2c_init();
785 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
787 spi_register_board_info(omap3evm_spi_board_info,
788 ARRAY_SIZE(omap3evm_spi_board_info));
792 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
793 usb_nop_xceiv_register();
795 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
796 /* enable EHCI VBUS using GPIO22 */
797 omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP);
798 gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS");
799 gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0);
800 gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1);
802 /* Select EHCI port on main board */
803 omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP);
804 gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port");
805 gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0);
806 gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0);
808 /* setup EHCI phy reset config */
809 omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
810 ehci_pdata.reset_gpio_port[1] = 21;
812 /* EVM REV >= E can supply 500mA with EXTVBUS programming */
813 musb_board_data.power = 500;
814 musb_board_data.extvbus = 1;
816 /* setup EHCI phy reset on MDC */
817 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
818 ehci_pdata.reset_gpio_port[1] = 135;
820 usb_musb_init(&musb_board_data);
821 usb_ehci_init(&ehci_pdata);
823 omap3evm_init_smsc911x();
824 omap3_evm_display_init();
826 #ifdef CONFIG_WL12XX_PLATFORM_DATA
827 /* WL12xx WLAN Init */
828 if (wl12xx_set_platform_data(&omap3evm_wlan_data))
829 pr_err("error setting wl12xx data\n");
830 platform_device_register(&omap3evm_vwlan_device);
834 MACHINE_START(OMAP3EVM, "OMAP3 EVM")
835 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */
836 .boot_params = 0x80000100,
837 .reserve = omap_reserve,
838 .map_io = omap3_map_io,
839 .init_early = omap3_evm_init_early,
840 .init_irq = omap_init_irq,
841 .init_machine = omap3_evm_init,
842 .timer = &omap_timer,