23 #define XHCI_MAX_HALT_USEC (16*1000)
25 #define XHCI_STS_HALT (1<<0)
28 #define XHCI_HCC_PARAMS_OFFSET 0x10
30 #define XHCI_HCC_EXT_CAPS(p) (((p)>>16)&0xffff)
33 #define XHCI_CMD_OFFSET 0x00
34 #define XHCI_STS_OFFSET 0x04
36 #define XHCI_MAX_EXT_CAPS 50
40 #define XHCI_HC_LENGTH(p) (((p)>>00)&0x00ff)
43 #define XHCI_EXT_CAPS_ID(p) (((p)>>0)&0xff)
44 #define XHCI_EXT_CAPS_NEXT(p) (((p)>>8)&0xff)
45 #define XHCI_EXT_CAPS_VAL(p) ((p)>>16)
47 #define XHCI_EXT_CAPS_LEGACY 1
48 #define XHCI_EXT_CAPS_PROTOCOL 2
49 #define XHCI_EXT_CAPS_PM 3
50 #define XHCI_EXT_CAPS_VIRT 4
51 #define XHCI_EXT_CAPS_ROUTE 5
53 #define XHCI_EXT_CAPS_DEBUG 10
55 #define XHCI_HC_BIOS_OWNED (1 << 16)
56 #define XHCI_HC_OS_OWNED (1 << 24)
60 #define XHCI_LEGACY_SUPPORT_OFFSET (0x00)
64 #define XHCI_LEGACY_CONTROL_OFFSET (0x04)
66 #define XHCI_LEGACY_DISABLE_SMI ((0x7 << 1) + (0xff << 5) + (0x7 << 17))
67 #define XHCI_LEGACY_SMI_EVENTS (0x7 << 29)
70 #define XHCI_L1C (1 << 16)
73 #define XHCI_HLC (1 << 19)
77 #define XHCI_CMD_RUN (1 << 0)
79 #define XHCI_CMD_EIE (1 << 2)
81 #define XHCI_CMD_HSEIE (1 << 3)
83 #define XHCI_CMD_EWE (1 << 10)
85 #define XHCI_IRQS (XHCI_CMD_EIE | XHCI_CMD_HSEIE | XHCI_CMD_EWE)
88 #define XHCI_STS_CNR (1 << 11)
105 static inline int xhci_find_next_cap_offset(
void __iomem *base,
int ext_offset)
109 next =
readl(base + ext_offset);
126 return ext_offset + (next << 2);
140 static inline int xhci_find_ext_cap_by_id(
void __iomem *base,
int ext_offset,
int id)
145 while (ext_offset && limit > 0) {
146 val =
readl(base + ext_offset);
149 ext_offset = xhci_find_next_cap_offset(base, ext_offset);