aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/usb.c')
-rw-r--r--arch/arm/plat-omap/usb.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index 509f2ed99e21..d3bf17cd36f3 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -33,10 +33,10 @@
33#include <asm/system.h> 33#include <asm/system.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35 35
36#include <mach/control.h> 36#include <plat/control.h>
37#include <mach/mux.h> 37#include <plat/mux.h>
38#include <mach/usb.h> 38#include <plat/usb.h>
39#include <mach/board.h> 39#include <plat/board.h>
40 40
41#ifdef CONFIG_ARCH_OMAP1 41#ifdef CONFIG_ARCH_OMAP1
42 42
@@ -137,7 +137,13 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
137 if (is_device) { 137 if (is_device) {
138 if (cpu_is_omap24xx()) 138 if (cpu_is_omap24xx())
139 omap_cfg_reg(J20_24XX_USB0_PUEN); 139 omap_cfg_reg(J20_24XX_USB0_PUEN);
140 else 140 else if (cpu_is_omap7xx()) {
141 omap_cfg_reg(AA17_7XX_USB_DM);
142 omap_cfg_reg(W16_7XX_USB_PU_EN);
143 omap_cfg_reg(W17_7XX_USB_VBUSI);
144 omap_cfg_reg(W18_7XX_USB_DMCK_OUT);
145 omap_cfg_reg(W19_7XX_USB_DCRST);
146 } else
141 omap_cfg_reg(W4_USB_PUEN); 147 omap_cfg_reg(W4_USB_PUEN);
142 } 148 }
143 149
@@ -159,11 +165,14 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
159 * - OTG support on this port not yet written 165 * - OTG support on this port not yet written
160 */ 166 */
161 167
162 l = omap_readl(USB_TRANSCEIVER_CTRL); 168 /* Don't do this for omap7xx -- it causes USB to not work correctly */
163 l &= ~(7 << 4); 169 if (!cpu_is_omap7xx()) {
164 if (!is_device) 170 l = omap_readl(USB_TRANSCEIVER_CTRL);
165 l |= (3 << 1); 171 l &= ~(7 << 4);
166 omap_writel(l, USB_TRANSCEIVER_CTRL); 172 if (!is_device)
173 l |= (3 << 1);
174 omap_writel(l, USB_TRANSCEIVER_CTRL);
175 }
167 176
168 return 3 << 16; 177 return 3 << 16;
169 } 178 }
@@ -603,7 +612,12 @@ omap_otg_init(struct omap_usb_config *config)
603 if (config->otg || config->register_dev) { 612 if (config->otg || config->register_dev) {
604 syscon &= ~DEV_IDLE_EN; 613 syscon &= ~DEV_IDLE_EN;
605 udc_device.dev.platform_data = config; 614 udc_device.dev.platform_data = config;
606 /* FIXME patch IRQ numbers for omap730 */ 615 /* IRQ numbers for omap7xx */
616 if(cpu_is_omap7xx()) {
617 udc_resources[1].start = INT_7XX_USB_GENI;
618 udc_resources[2].start = INT_7XX_USB_NON_ISO;
619 udc_resources[3].start = INT_7XX_USB_ISO;
620 }
607 status = platform_device_register(&udc_device); 621 status = platform_device_register(&udc_device);
608 if (status) 622 if (status)
609 pr_debug("can't register UDC device, %d\n", status); 623 pr_debug("can't register UDC device, %d\n", status);
@@ -614,8 +628,8 @@ omap_otg_init(struct omap_usb_config *config)
614 if (config->otg || config->register_host) { 628 if (config->otg || config->register_host) {
615 syscon &= ~HST_IDLE_EN; 629 syscon &= ~HST_IDLE_EN;
616 ohci_device.dev.platform_data = config; 630 ohci_device.dev.platform_data = config;
617 if (cpu_is_omap730()) 631 if (cpu_is_omap7xx())
618 ohci_resources[1].start = INT_730_USB_HHC_1; 632 ohci_resources[1].start = INT_7XX_USB_HHC_1;
619 status = platform_device_register(&ohci_device); 633 status = platform_device_register(&ohci_device);
620 if (status) 634 if (status)
621 pr_debug("can't register OHCI device, %d\n", status); 635 pr_debug("can't register OHCI device, %d\n", status);
@@ -626,8 +640,8 @@ omap_otg_init(struct omap_usb_config *config)
626 if (config->otg) { 640 if (config->otg) {
627 syscon &= ~OTG_IDLE_EN; 641 syscon &= ~OTG_IDLE_EN;
628 otg_device.dev.platform_data = config; 642 otg_device.dev.platform_data = config;
629 if (cpu_is_omap730()) 643 if (cpu_is_omap7xx())
630 otg_resources[1].start = INT_730_USB_OTG; 644 otg_resources[1].start = INT_7XX_USB_OTG;
631 status = platform_device_register(&otg_device); 645 status = platform_device_register(&otg_device);
632 if (status) 646 if (status)
633 pr_debug("can't register OTG device, %d\n", status); 647 pr_debug("can't register OTG device, %d\n", status);
@@ -731,7 +745,7 @@ static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
731 745
732void __init omap_usb_init(struct omap_usb_config *pdata) 746void __init omap_usb_init(struct omap_usb_config *pdata)
733{ 747{
734 if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx()) 748 if (cpu_is_omap7xx() || cpu_is_omap16xx() || cpu_is_omap24xx())
735 omap_otg_init(pdata); 749 omap_otg_init(pdata);
736 else if (cpu_is_omap15xx()) 750 else if (cpu_is_omap15xx())
737 omap_1510_usb_init(pdata); 751 omap_1510_usb_init(pdata);