aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Anders <x0132446@ti.com>2010-10-07 15:36:30 -0400
committerTony Lindgren <tony@atomide.com>2010-10-08 14:07:00 -0400
commit4415beb6fb519c4e98491666838494a8c46cc3ee (patch)
tree0d5a4a38f138534fb8310dc18909bd8f38273fa4 /arch
parentb9b52620823f84f95f3fd94dd6769b7102d7888a (diff)
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: David Anders <x0132446@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index e9c6b24361b..5eb1a77bf0e 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -41,6 +41,9 @@
41#include "timer-gp.h" 41#include "timer-gp.h"
42 42
43 43
44#define GPIO_HUB_POWER 1
45#define GPIO_HUB_NRESET 62
46
44static struct gpio_led gpio_leds[] = { 47static struct gpio_led gpio_leds[] = {
45 { 48 {
46 .name = "pandaboard::status1", 49 .name = "pandaboard::status1",
@@ -78,6 +81,56 @@ static void __init omap4_panda_init_irq(void)
78 omap_gpio_init(); 81 omap_gpio_init();
79} 82}
80 83
84static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
85 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
86 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
87 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
88 .phy_reset = false,
89 .reset_gpio_port[0] = -EINVAL,
90 .reset_gpio_port[1] = -EINVAL,
91 .reset_gpio_port[2] = -EINVAL
92};
93
94static void __init omap4_ehci_init(void)
95{
96 int ret;
97
98
99 /* disable the power to the usb hub prior to init */
100 ret = gpio_request(GPIO_HUB_POWER, "hub_power");
101 if (ret) {
102 pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER);
103 goto error1;
104 }
105 gpio_export(GPIO_HUB_POWER, 0);
106 gpio_direction_output(GPIO_HUB_POWER, 0);
107 gpio_set_value(GPIO_HUB_POWER, 0);
108
109 /* reset phy+hub */
110 ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");
111 if (ret) {
112 pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET);
113 goto error2;
114 }
115 gpio_export(GPIO_HUB_NRESET, 0);
116 gpio_direction_output(GPIO_HUB_NRESET, 0);
117 gpio_set_value(GPIO_HUB_NRESET, 0);
118 gpio_set_value(GPIO_HUB_NRESET, 1);
119
120 usb_ehci_init(&ehci_pdata);
121
122 /* enable power to hub */
123 gpio_set_value(GPIO_HUB_POWER, 1);
124 return;
125
126error2:
127 gpio_free(GPIO_HUB_POWER);
128error1:
129 pr_err("Unable to initialize EHCI power/reset\n");
130 return;
131
132}
133
81static struct omap_musb_board_data musb_board_data = { 134static struct omap_musb_board_data musb_board_data = {
82 .interface_type = MUSB_INTERFACE_UTMI, 135 .interface_type = MUSB_INTERFACE_UTMI,
83 .mode = MUSB_PERIPHERAL, 136 .mode = MUSB_PERIPHERAL,
@@ -314,6 +367,7 @@ static void __init omap4_panda_init(void)
314 omap4_twl6030_hsmmc_init(mmc); 367 omap4_twl6030_hsmmc_init(mmc);
315 /* OMAP4 Panda uses internal transceiver so register nop transceiver */ 368 /* OMAP4 Panda uses internal transceiver so register nop transceiver */
316 usb_nop_xceiv_register(); 369 usb_nop_xceiv_register();
370 omap4_ehci_init();
317 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ 371 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
318 if (!cpu_is_omap44xx()) 372 if (!cpu_is_omap44xx())
319 usb_musb_init(&musb_board_data); 373 usb_musb_init(&musb_board_data);