This source file includes following definitions.
- xhci_find_next_ext_cap
1
2
3
4
5
6
7
8
9
10
11 #define XHCI_MAX_HALT_USEC (16*1000)
12
13 #define XHCI_STS_HALT (1<<0)
14
15
16 #define XHCI_HCC_PARAMS_OFFSET 0x10
17
18 #define XHCI_HCC_EXT_CAPS(p) (((p)>>16)&0xffff)
19
20
21 #define XHCI_CMD_OFFSET 0x00
22 #define XHCI_STS_OFFSET 0x04
23
24 #define XHCI_MAX_EXT_CAPS 50
25
26
27
28 #define XHCI_HC_LENGTH(p) (((p)>>00)&0x00ff)
29
30
31 #define XHCI_EXT_CAPS_ID(p) (((p)>>0)&0xff)
32 #define XHCI_EXT_CAPS_NEXT(p) (((p)>>8)&0xff)
33 #define XHCI_EXT_CAPS_VAL(p) ((p)>>16)
34
35 #define XHCI_EXT_CAPS_LEGACY 1
36 #define XHCI_EXT_CAPS_PROTOCOL 2
37 #define XHCI_EXT_CAPS_PM 3
38 #define XHCI_EXT_CAPS_VIRT 4
39 #define XHCI_EXT_CAPS_ROUTE 5
40
41 #define XHCI_EXT_CAPS_DEBUG 10
42
43 #define XHCI_EXT_CAPS_VENDOR_INTEL 192
44
45 #define XHCI_HC_BIOS_OWNED (1 << 16)
46 #define XHCI_HC_OS_OWNED (1 << 24)
47
48
49
50 #define XHCI_LEGACY_SUPPORT_OFFSET (0x00)
51
52
53
54 #define XHCI_LEGACY_CONTROL_OFFSET (0x04)
55
56 #define XHCI_LEGACY_DISABLE_SMI ((0x7 << 1) + (0xff << 5) + (0x7 << 17))
57 #define XHCI_LEGACY_SMI_EVENTS (0x7 << 29)
58
59
60 #define XHCI_L1C (1 << 16)
61
62
63 #define XHCI_HLC (1 << 19)
64 #define XHCI_BLC (1 << 20)
65
66
67
68 #define XHCI_CMD_RUN (1 << 0)
69
70 #define XHCI_CMD_EIE (1 << 2)
71
72 #define XHCI_CMD_HSEIE (1 << 3)
73
74 #define XHCI_CMD_EWE (1 << 10)
75
76 #define XHCI_IRQS (XHCI_CMD_EIE | XHCI_CMD_HSEIE | XHCI_CMD_EWE)
77
78
79 #define XHCI_STS_CNR (1 << 11)
80
81 #include <linux/io.h>
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 static inline int xhci_find_next_ext_cap(void __iomem *base, u32 start, int id)
98 {
99 u32 val;
100 u32 next;
101 u32 offset;
102
103 offset = start;
104 if (!start || start == XHCI_HCC_PARAMS_OFFSET) {
105 val = readl(base + XHCI_HCC_PARAMS_OFFSET);
106 if (val == ~0)
107 return 0;
108 offset = XHCI_HCC_EXT_CAPS(val) << 2;
109 if (!offset)
110 return 0;
111 }
112 do {
113 val = readl(base + offset);
114 if (val == ~0)
115 return 0;
116 if (offset != start && (id == 0 || XHCI_EXT_CAPS_ID(val) == id))
117 return offset;
118
119 next = XHCI_EXT_CAPS_NEXT(val);
120 offset += next << 2;
121 } while (next);
122
123 return 0;
124 }