aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorJan Andersson <jan@gaisler.com>2011-05-03 14:11:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-03 14:43:21 -0400
commitc430131a02d677aa708f56342c1565edfdacb3c0 (patch)
tree15e9930a2512e4b05b7cfd4684f36dd26b0b990f /include/linux/usb
parent2ce2c3ac8852cfc8f74f4b7b9a2c4cdff007f96a (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 'include/linux/usb')
-rw-r--r--include/linux/usb/ehci_def.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
index 78799432008e..7cc95ee3606b 100644
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
@@ -25,10 +25,15 @@
25struct ehci_caps { 25struct ehci_caps {
26 /* these fields are specified as 8 and 16 bit registers, 26 /* these fields are specified as 8 and 16 bit registers,
27 * but some hosts can't perform 8 or 16 bit PCI accesses. 27 * but some hosts can't perform 8 or 16 bit PCI accesses.
28 * some hosts treat caplength and hciversion as parts of a 32-bit
29 * register, others treat them as two separate registers, this
30 * affects the memory map for big endian controllers.
28 */ 31 */
29 u32 hc_capbase; 32 u32 hc_capbase;
30#define HC_LENGTH(p) (((p)>>00)&0x00ff) /* bits 7:0 */ 33#define HC_LENGTH(ehci, p) (0x00ff&((p) >> /* bits 7:0 / offset 00h */ \
31#define HC_VERSION(p) (((p)>>16)&0xffff) /* bits 31:16 */ 34 (ehci_big_endian_capbase(ehci) ? 24 : 0)))
35#define HC_VERSION(ehci, p) (0xffff&((p) >> /* bits 31:16 / offset 02h */ \
36 (ehci_big_endian_capbase(ehci) ? 0 : 16)))
32 u32 hcs_params; /* HCSPARAMS - offset 0x4 */ 37 u32 hcs_params; /* HCSPARAMS - offset 0x4 */
33#define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */ 38#define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */
34#define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */ 39#define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */