diff options
author | Jan Andersson <jan@gaisler.com> | 2011-05-03 14:11:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-03 14:43:21 -0400 |
commit | c430131a02d677aa708f56342c1565edfdacb3c0 (patch) | |
tree | 15e9930a2512e4b05b7cfd4684f36dd26b0b990f /drivers/usb/host/ehci-ath79.c | |
parent | 2ce2c3ac8852cfc8f74f4b7b9a2c4cdff007f96a (diff) |
USB: EHCI: Support controllers with big endian capability regs
The two first HC capability registers (CAPLENGTH and HCIVERSION)
are defined as one 8-bit and one 16-bit register. Most HC
implementations have selected to treat these registers as part
of a 32-bit register, giving the same layout for both big and
small endian systems.
This patch adds a new quirk, big_endian_capbase, to support
controllers with big endian register interfaces that treat
HCIVERSION and CAPLENGTH as individual registers.
Signed-off-by: Jan Andersson <jan@gaisler.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-ath79.c')
-rw-r--r-- | drivers/usb/host/ehci-ath79.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-ath79.c b/drivers/usb/host/ehci-ath79.c index 7ea23b50f5d8..98cc8a13169c 100644 --- a/drivers/usb/host/ehci-ath79.c +++ b/drivers/usb/host/ehci-ath79.c | |||
@@ -44,6 +44,7 @@ static int ehci_ath79_init(struct usb_hcd *hcd) | |||
44 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 44 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
45 | struct platform_device *pdev = to_platform_device(hcd->self.controller); | 45 | struct platform_device *pdev = to_platform_device(hcd->self.controller); |
46 | const struct platform_device_id *id; | 46 | const struct platform_device_id *id; |
47 | int hclength; | ||
47 | int ret; | 48 | int ret; |
48 | 49 | ||
49 | id = platform_get_device_id(pdev); | 50 | id = platform_get_device_id(pdev); |
@@ -52,21 +53,20 @@ static int ehci_ath79_init(struct usb_hcd *hcd) | |||
52 | return -EINVAL; | 53 | return -EINVAL; |
53 | } | 54 | } |
54 | 55 | ||
56 | hclength = HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
55 | switch (id->driver_data) { | 57 | switch (id->driver_data) { |
56 | case EHCI_ATH79_IP_V1: | 58 | case EHCI_ATH79_IP_V1: |
57 | ehci->has_synopsys_hc_bug = 1; | 59 | ehci->has_synopsys_hc_bug = 1; |
58 | 60 | ||
59 | ehci->caps = hcd->regs; | 61 | ehci->caps = hcd->regs; |
60 | ehci->regs = hcd->regs + | 62 | ehci->regs = hcd->regs + hclength; |
61 | HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
62 | break; | 63 | break; |
63 | 64 | ||
64 | case EHCI_ATH79_IP_V2: | 65 | case EHCI_ATH79_IP_V2: |
65 | hcd->has_tt = 1; | 66 | hcd->has_tt = 1; |
66 | 67 | ||
67 | ehci->caps = hcd->regs + 0x100; | 68 | ehci->caps = hcd->regs + 0x100; |
68 | ehci->regs = hcd->regs + 0x100 + | 69 | ehci->regs = hcd->regs + 0x100 + hclength; |
69 | HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
70 | break; | 70 | break; |
71 | 71 | ||
72 | default: | 72 | default: |