1 diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
2 index 489439d..2c6305b 100644
3 --- a/arch/arm/mach-omap2/usb-ehci.c
4 +++ b/arch/arm/mach-omap2/usb-ehci.c
5 @@ -152,9 +152,7 @@ static void setup_ehci_io_mux(void)
6 void __init usb_ehci_init(void)
8 #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
9 - /* Setup Pin IO MUX for EHCI */
10 - if (cpu_is_omap34xx())
11 - setup_ehci_io_mux();
12 + /* TODO: Setup Pin IO MUX for EHCI - moved this temporarily to U-boot */
14 if (platform_device_register(&ehci_device) < 0) {
15 printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
17 diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
18 index 1b3266c..8472996 100644
19 --- a/drivers/usb/host/ehci-omap.c
20 +++ b/drivers/usb/host/ehci-omap.c
22 * to get the PHY state machine in working state
24 #define EXTERNAL_PHY_RESET
25 +#ifdef CONFIG_MACH_OVERO
26 +#define EXT_PHY_RESET_GPIO_PORT2 (183)
28 #define EXT_PHY_RESET_GPIO_PORT1 (57)
29 #define EXT_PHY_RESET_GPIO_PORT2 (61)
31 #define EXT_PHY_RESET_DELAY (10)
33 +#define PHY_STP_PULLUP_ENABLE (0x10)
34 +#define PHY_STP_PULLUP_DISABLE (0x90)
38 * USBHOST supports External charge pump PHYs only
39 * Use the VBUS from Port1 to power VBUS of Port2 externally
40 * So use Port2 as the working ULPI port
42 +#ifndef CONFIG_MACH_OVERO
43 #define VBUS_INTERNAL_CHARGEPUMP_HACK
46 #endif /* CONFIG_OMAP_EHCI_PHY_MODE */
48 @@ -225,14 +235,43 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
50 #ifdef EXTERNAL_PHY_RESET
52 +#ifndef CONFIG_MACH_OVERO
53 gpio_request(EXT_PHY_RESET_GPIO_PORT1, "USB1 PHY reset");
54 gpio_direction_output(EXT_PHY_RESET_GPIO_PORT1, 0);
56 gpio_request(EXT_PHY_RESET_GPIO_PORT2, "USB2 PHY reset");
57 gpio_direction_output(EXT_PHY_RESET_GPIO_PORT2, 0);
58 + gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
59 /* Hold the PHY in RESET for enough time till DIR is high */
60 udelay(EXT_PHY_RESET_DELAY);
64 + * The PHY register 0x7 - Interface Control register is
65 + * configured to disable the integrated STP pull-up resistor
66 + * used for interface protection.
68 + * May not need to be here.
70 + omap_writel((0x7 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* interface reg */
71 + (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
72 + (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
73 + (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
74 + (PHY_STP_PULLUP_DISABLE),
75 + EHCI_INSNREG05_ULPI);
77 + while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
79 + /* Force PHY to HS */
80 + omap_writel((0x4 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) |/* function ctrl */
81 + (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) |/* Write */
82 + (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) |/* Port1 */
83 + (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT) |/* Start */
85 + EHCI_INSNREG05_ULPI);
87 + while (!(omap_readl(EHCI_INSNREG05_ULPI) & (1<<EHCI_INSNREG05_ULPI_CONTROL_SHIFT)));
89 /* Configure TLL for 60Mhz clk for ULPI */
90 ehci_clocks->usbtll_fck_clk = clk_get(&dev->dev, USBHOST_TLL_FCLK);
91 if (IS_ERR(ehci_clocks->usbtll_fck_clk))
92 @@ -307,7 +346,9 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
93 * Hold the PHY in RESET for enough time till PHY is settled and ready
95 udelay(EXT_PHY_RESET_DELAY);
96 +#ifndef CONFIG_MACH_OVERO
97 gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
99 gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
102 @@ -393,7 +434,9 @@ static void omap_stop_ehc(struct platform_device *dev, struct usb_hcd *hcd)
105 #ifdef EXTERNAL_PHY_RESET
106 +#ifndef CONFIG_MACH_OVERO
107 gpio_free(EXT_PHY_RESET_GPIO_PORT1);
109 gpio_free(EXT_PHY_RESET_GPIO_PORT2);