diff options
author | Tom Warren <twarren@nvidia.com> | 2011-12-13 14:31:54 -0700 |
---|---|---|
committer | Tom Warren <twarren@nvidia.com> | 2011-12-13 13:36:24 -0800 |
commit | 0e3e256da33f993121a0007666a6f4b6f29b53aa (patch) | |
tree | 6634c294cb928e31266c42b2027f518f2c625799 /drivers | |
parent | e70c9892f2445b073f765187b754630d56f5e18c (diff) |
USB: Add T30 USB support
BUG=chromium-os:23496
TEST=built Seaboard and Waluigi OK
Signed-off-by: Tom Warren <twarren@nvidia.com>
Change-Id: I52fcccc1627d1e9b6e0270e5ba9ab81c5d7fa9b7
Reviewed-on: https://gerrit.chromium.org/gerrit/12444
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 16 |
2 files changed, 33 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index e637a9b956..0ec89dbc7d 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -595,6 +595,10 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, int len, srclen; uint32_t reg; uint32_t *status_reg; +#if defined(CONFIG_EHCI_HAS_STATUS2) + uint32_t *status_reg2; + uint32_t reg2; +#endif struct ehci_ctrl *ctrl = dev->controller; struct ehci_hccr *hccr = ctrl->hccr; volatile struct ehci_hcor *hcor = ctrl->hcor; @@ -698,6 +702,21 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, if (reg & EHCI_PS_PP) tmpbuf[1] |= USB_PORT_STAT_POWER >> 8; +#if defined(CONFIG_EHCI_HAS_STATUS2) + status_reg2 = (uint32_t *)&hcor->hostpc1_devlc; + reg2 = ehci_readl(status_reg2); + switch ((reg2 >> 25) & 3) { + case 0: + break; + case 1: + tmpbuf[1] |= USB_PORT_STAT_LOW_SPEED >> 8; + break; + case 2: + default: + tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8; + break; + } +#else if (ehci_is_TDI()) { switch ((reg >> 26) & 3) { case 0: @@ -713,7 +732,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, } else { tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8; } - +#endif if (reg & EHCI_PS_CSC) tmpbuf[2] |= USB_PORT_STAT_C_CONNECTION; if (reg & EHCI_PS_PEC) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 45b7f90e76..2aa5c25a37 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -89,11 +89,21 @@ struct ehci_hcor { #define FLAG_CF (1 << 0) /* true: we'll support "high speed" */ uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS]; uint32_t or_systune; + uint32_t _reserved_2_[13]; + uint32_t hostpc1_devlc; } __attribute__ ((packed)); -#define USBMODE 0x68 /* USB Device mode */ -#define USBMODE_SDIS (1 << 3) /* Stream disable */ -#define USBMODE_BE (1 << 2) /* BE/LE endiannes select */ +#if defined(CONFIG_TEGRA3) +/* + * Tegra3 USBMODE is at offset 0x1F8, or hcor + 0xC8. + * Tegra2 USBMODE is at offset 0x1A8, or hcor + 0x68. + * hcor is at 0x130 on Tegra3 and 0x140 on Tegra2 + */ +#define USBMODE 0xC8 /* Device Mode reg offset */ +#else +#define USBMODE 0x68 /* Device Mode reg offset */ +#endif +#define USBMODE_BE (1 << 2) /* BE/LE select */ #define USBMODE_CM_HC (3 << 0) /* host controller mode */ #define USBMODE_CM_IDLE (0 << 0) /* idle state */ |