Commit 4415beb6 authored by David Anders's avatar David Anders Committed by Tony Lindgren

omap4: pandaboard: enable the ehci port on pandaboard

The OMAP4 PandaBoard has EHCI port1 hooked up to an external
SMSC3320 transciever. GPIO 1 is used to power on the transceiver
and GPIO 62 for reset on the transceiver.
Signed-off-by: default avatarDavid Anders <x0132446@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b9b52620
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
#include "timer-gp.h" #include "timer-gp.h"
#define GPIO_HUB_POWER 1
#define GPIO_HUB_NRESET 62
static struct gpio_led gpio_leds[] = { static struct gpio_led gpio_leds[] = {
{ {
.name = "pandaboard::status1", .name = "pandaboard::status1",
...@@ -78,6 +81,56 @@ static void __init omap4_panda_init_irq(void) ...@@ -78,6 +81,56 @@ static void __init omap4_panda_init_irq(void)
omap_gpio_init(); omap_gpio_init();
} }
static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.phy_reset = false,
.reset_gpio_port[0] = -EINVAL,
.reset_gpio_port[1] = -EINVAL,
.reset_gpio_port[2] = -EINVAL
};
static void __init omap4_ehci_init(void)
{
int ret;
/* disable the power to the usb hub prior to init */
ret = gpio_request(GPIO_HUB_POWER, "hub_power");
if (ret) {
pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER);
goto error1;
}
gpio_export(GPIO_HUB_POWER, 0);
gpio_direction_output(GPIO_HUB_POWER, 0);
gpio_set_value(GPIO_HUB_POWER, 0);
/* reset phy+hub */
ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");
if (ret) {
pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET);
goto error2;
}
gpio_export(GPIO_HUB_NRESET, 0);
gpio_direction_output(GPIO_HUB_NRESET, 0);
gpio_set_value(GPIO_HUB_NRESET, 0);
gpio_set_value(GPIO_HUB_NRESET, 1);
usb_ehci_init(&ehci_pdata);
/* enable power to hub */
gpio_set_value(GPIO_HUB_POWER, 1);
return;
error2:
gpio_free(GPIO_HUB_POWER);
error1:
pr_err("Unable to initialize EHCI power/reset\n");
return;
}
static struct omap_musb_board_data musb_board_data = { static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_UTMI, .interface_type = MUSB_INTERFACE_UTMI,
.mode = MUSB_PERIPHERAL, .mode = MUSB_PERIPHERAL,
...@@ -314,6 +367,7 @@ static void __init omap4_panda_init(void) ...@@ -314,6 +367,7 @@ static void __init omap4_panda_init(void)
omap4_twl6030_hsmmc_init(mmc); omap4_twl6030_hsmmc_init(mmc);
/* OMAP4 Panda uses internal transceiver so register nop transceiver */ /* OMAP4 Panda uses internal transceiver so register nop transceiver */
usb_nop_xceiv_register(); usb_nop_xceiv_register();
omap4_ehci_init();
/* FIXME: allow multi-omap to boot until musb is updated for omap4 */ /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
if (!cpu_is_omap44xx()) if (!cpu_is_omap44xx())
usb_musb_init(&musb_board_data); usb_musb_init(&musb_board_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment