diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2010-09-21 12:03:11 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-27 18:15:04 -0400 |
commit | 525d75b31bc97354870b5991d57b2607d7b88602 (patch) | |
tree | 334d74f3271764abdfcc68b5c67905cde1ab27a0 /arch/arm/mach-omap2/board-cm-t3517.c | |
parent | 46893a56aad011764003703b06303515ea670c57 (diff) |
omap3: cm-t3517: add support for usb host
add support for hsusb host ports 1, 2 and on-module usb hub.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-cm-t3517.c')
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t3517.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 2b41c6de274d..2c7082d6d772 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/delay.h> | ||
28 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
29 | #include <linux/leds.h> | 30 | #include <linux/leds.h> |
30 | #include <linux/rtc-v3020.h> | 31 | #include <linux/rtc-v3020.h> |
@@ -36,6 +37,7 @@ | |||
36 | #include <plat/board.h> | 37 | #include <plat/board.h> |
37 | #include <plat/common.h> | 38 | #include <plat/common.h> |
38 | #include <plat/control.h> | 39 | #include <plat/control.h> |
40 | #include <plat/usb.h> | ||
39 | 41 | ||
40 | #include "mux.h" | 42 | #include "mux.h" |
41 | 43 | ||
@@ -100,6 +102,47 @@ static void __init cm_t3517_init_rtc(void) | |||
100 | static inline void cm_t3517_init_rtc(void) {} | 102 | static inline void cm_t3517_init_rtc(void) {} |
101 | #endif | 103 | #endif |
102 | 104 | ||
105 | #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE) | ||
106 | #define HSUSB1_RESET_GPIO (146) | ||
107 | #define HSUSB2_RESET_GPIO (147) | ||
108 | #define USB_HUB_RESET_GPIO (152) | ||
109 | |||
110 | static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = { | ||
111 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | ||
112 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | ||
113 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
114 | |||
115 | .phy_reset = true, | ||
116 | .reset_gpio_port[0] = HSUSB1_RESET_GPIO, | ||
117 | .reset_gpio_port[1] = HSUSB2_RESET_GPIO, | ||
118 | .reset_gpio_port[2] = -EINVAL, | ||
119 | }; | ||
120 | |||
121 | static int cm_t3517_init_usbh(void) | ||
122 | { | ||
123 | int err; | ||
124 | |||
125 | err = gpio_request(USB_HUB_RESET_GPIO, "usb hub rst"); | ||
126 | if (err) { | ||
127 | pr_err("CM-T3517: usb hub rst gpio request failed: %d\n", err); | ||
128 | } else { | ||
129 | gpio_direction_output(USB_HUB_RESET_GPIO, 0); | ||
130 | udelay(10); | ||
131 | gpio_set_value(USB_HUB_RESET_GPIO, 1); | ||
132 | msleep(1); | ||
133 | } | ||
134 | |||
135 | usb_ehci_init(&cm_t3517_ehci_pdata); | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | #else | ||
140 | static inline int cm_t3517_init_usbh(void) | ||
141 | { | ||
142 | return 0; | ||
143 | } | ||
144 | #endif | ||
145 | |||
103 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | 146 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { |
104 | }; | 147 | }; |
105 | 148 | ||
@@ -121,6 +164,12 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
121 | OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 164 | OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
122 | OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 165 | OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
123 | OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 166 | OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
167 | /* HSUSB1 RESET */ | ||
168 | OMAP3_MUX(UART2_TX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
169 | /* HSUSB2 RESET */ | ||
170 | OMAP3_MUX(UART2_RX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
171 | /* CM-T3517 USB HUB nRESET */ | ||
172 | OMAP3_MUX(MCBSP4_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
124 | 173 | ||
125 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 174 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
126 | }; | 175 | }; |
@@ -131,6 +180,7 @@ static void __init cm_t3517_init(void) | |||
131 | omap_serial_init(); | 180 | omap_serial_init(); |
132 | cm_t3517_init_leds(); | 181 | cm_t3517_init_leds(); |
133 | cm_t3517_init_rtc(); | 182 | cm_t3517_init_rtc(); |
183 | cm_t3517_init_usbh(); | ||
134 | } | 184 | } |
135 | 185 | ||
136 | MACHINE_START(CM_T3517, "Compulab CM-T3517") | 186 | MACHINE_START(CM_T3517, "Compulab CM-T3517") |