diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 54 |
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 e9c6b24361bc..5eb1a77bf0e5 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 | |||
44 | static struct gpio_led gpio_leds[] = { | 47 | static 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 | ||
84 | static 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 | |||
94 | static 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 | |||
126 | error2: | ||
127 | gpio_free(GPIO_HUB_POWER); | ||
128 | error1: | ||
129 | pr_err("Unable to initialize EHCI power/reset\n"); | ||
130 | return; | ||
131 | |||
132 | } | ||
133 | |||
81 | static struct omap_musb_board_data musb_board_data = { | 134 | static 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); |