diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2010-10-19 03:08:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:22:16 -0400 |
commit | 3a0d30bcdfa73bd865f29899eb4bf29b58c4f54a (patch) | |
tree | 0f566b569e34af9fab7e22e2feec853b9a5cbfb5 | |
parent | 436a389096e1feda2c382cad83b6a8d6de8615a0 (diff) |
USB: AM35x: Add musb support
AM35x has musb interface (version 1.8) and uses CPPI41 DMA engine.
It has USB phy built inside the IP itself.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | arch/arm/mach-omap2/board-am3517evm.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-omap2/usb-musb.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/usb.h | 21 |
3 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 4d0f58592864..9ac9de6bb970 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -375,6 +375,31 @@ static void __init am3517_evm_init_irq(void) | |||
375 | omap_gpio_init(); | 375 | omap_gpio_init(); |
376 | } | 376 | } |
377 | 377 | ||
378 | static struct omap_musb_board_data musb_board_data = { | ||
379 | .interface_type = MUSB_INTERFACE_ULPI, | ||
380 | .mode = MUSB_OTG, | ||
381 | .power = 500, | ||
382 | }; | ||
383 | |||
384 | static __init void am3517_evm_musb_init(void) | ||
385 | { | ||
386 | u32 devconf2; | ||
387 | |||
388 | /* | ||
389 | * Set up USB clock/mode in the DEVCONF2 register. | ||
390 | */ | ||
391 | devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); | ||
392 | |||
393 | /* USB2.0 PHY reference clock is 13 MHz */ | ||
394 | devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE); | ||
395 | devconf2 |= CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN | ||
396 | | CONF2_DATPOL; | ||
397 | |||
398 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); | ||
399 | |||
400 | usb_musb_init(&musb_board_data); | ||
401 | } | ||
402 | |||
378 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 403 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
379 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | 404 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, |
380 | #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ | 405 | #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ |
@@ -393,6 +418,8 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
393 | 418 | ||
394 | #ifdef CONFIG_OMAP_MUX | 419 | #ifdef CONFIG_OMAP_MUX |
395 | static struct omap_board_mux board_mux[] __initdata = { | 420 | static struct omap_board_mux board_mux[] __initdata = { |
421 | /* USB OTG DRVVBUS offset = 0x212 */ | ||
422 | OMAP3_MUX(SAD2D_MCAD23, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), | ||
396 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 423 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
397 | }; | 424 | }; |
398 | #else | 425 | #else |
@@ -459,6 +486,9 @@ static void __init am3517_evm_init(void) | |||
459 | ARRAY_SIZE(am3517evm_i2c1_boardinfo)); | 486 | ARRAY_SIZE(am3517evm_i2c1_boardinfo)); |
460 | /*Ethernet*/ | 487 | /*Ethernet*/ |
461 | am3517_evm_ethernet_init(&am3517_evm_emac_pdata); | 488 | am3517_evm_ethernet_init(&am3517_evm_emac_pdata); |
489 | |||
490 | /* MUSB */ | ||
491 | am3517_evm_musb_init(); | ||
462 | } | 492 | } |
463 | 493 | ||
464 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") | 494 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") |
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 33a5cde1c227..72605584bfff 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
31 | #include <mach/am35xx.h> | ||
31 | #include <plat/usb.h> | 32 | #include <plat/usb.h> |
32 | 33 | ||
33 | #ifdef CONFIG_USB_MUSB_SOC | 34 | #ifdef CONFIG_USB_MUSB_SOC |
@@ -89,6 +90,9 @@ void __init usb_musb_init(struct omap_musb_board_data *board_data) | |||
89 | { | 90 | { |
90 | if (cpu_is_omap243x()) { | 91 | if (cpu_is_omap243x()) { |
91 | musb_resources[0].start = OMAP243X_HS_BASE; | 92 | musb_resources[0].start = OMAP243X_HS_BASE; |
93 | } else if (cpu_is_omap3517() || cpu_is_omap3505()) { | ||
94 | musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE; | ||
95 | musb_resources[1].start = INT_35XX_USBOTG_IRQ; | ||
92 | } else if (cpu_is_omap34xx()) { | 96 | } else if (cpu_is_omap34xx()) { |
93 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; | 97 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; |
94 | } else if (cpu_is_omap44xx()) { | 98 | } else if (cpu_is_omap44xx()) { |
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index 2a9427c8cc48..9feddacfe850 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h | |||
@@ -218,6 +218,27 @@ static inline omap2_usbfs_init(struct omap_usb_config *pdata) | |||
218 | # define USBT2TLL5PI (1 << 17) | 218 | # define USBT2TLL5PI (1 << 17) |
219 | # define USB0PUENACTLOI (1 << 16) | 219 | # define USB0PUENACTLOI (1 << 16) |
220 | # define USBSTANDBYCTRL (1 << 15) | 220 | # define USBSTANDBYCTRL (1 << 15) |
221 | /* AM35x */ | ||
222 | /* USB 2.0 PHY Control */ | ||
223 | #define CONF2_PHY_GPIOMODE (1 << 23) | ||
224 | #define CONF2_OTGMODE (3 << 14) | ||
225 | #define CONF2_NO_OVERRIDE (0 << 14) | ||
226 | #define CONF2_FORCE_HOST (1 << 14) | ||
227 | #define CONF2_FORCE_DEVICE (2 << 14) | ||
228 | #define CONF2_FORCE_HOST_VBUS_LOW (3 << 14) | ||
229 | #define CONF2_SESENDEN (1 << 13) | ||
230 | #define CONF2_VBDTCTEN (1 << 12) | ||
231 | #define CONF2_REFFREQ_24MHZ (2 << 8) | ||
232 | #define CONF2_REFFREQ_26MHZ (7 << 8) | ||
233 | #define CONF2_REFFREQ_13MHZ (6 << 8) | ||
234 | #define CONF2_REFFREQ (0xf << 8) | ||
235 | #define CONF2_PHYCLKGD (1 << 7) | ||
236 | #define CONF2_VBUSSENSE (1 << 6) | ||
237 | #define CONF2_PHY_PLLON (1 << 5) | ||
238 | #define CONF2_RESET (1 << 4) | ||
239 | #define CONF2_PHYPWRDN (1 << 3) | ||
240 | #define CONF2_OTGPWRDN (1 << 2) | ||
241 | #define CONF2_DATPOL (1 << 1) | ||
221 | 242 | ||
222 | #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB) | 243 | #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB) |
223 | u32 omap1_usb0_init(unsigned nwires, unsigned is_device); | 244 | u32 omap1_usb0_init(unsigned nwires, unsigned is_device); |