ehcireg.h revision 1.29 1 1.29 jmorse /* $NetBSD: ehcireg.h,v 1.29 2008/11/28 17:18:21 jmorse Exp $ */
2 1.1 augustss
3 1.1 augustss /*
4 1.20 mycroft * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
5 1.1 augustss * All rights reserved.
6 1.1 augustss *
7 1.1 augustss * This code is derived from software contributed to The NetBSD Foundation
8 1.1 augustss * by Lennart Augustsson (lennart (at) augustsson.net).
9 1.1 augustss *
10 1.1 augustss * Redistribution and use in source and binary forms, with or without
11 1.1 augustss * modification, are permitted provided that the following conditions
12 1.1 augustss * are met:
13 1.1 augustss * 1. Redistributions of source code must retain the above copyright
14 1.1 augustss * notice, this list of conditions and the following disclaimer.
15 1.1 augustss * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 augustss * notice, this list of conditions and the following disclaimer in the
17 1.1 augustss * documentation and/or other materials provided with the distribution.
18 1.1 augustss *
19 1.1 augustss * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 augustss * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 augustss * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 augustss * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 augustss * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 augustss * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 augustss * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 augustss * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 augustss * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 augustss * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 augustss * POSSIBILITY OF SUCH DAMAGE.
30 1.2 augustss */
31 1.2 augustss
32 1.2 augustss /*
33 1.7 augustss * The EHCI 0.96 spec can be found at
34 1.3 gehenna * http://developer.intel.com/technology/usb/download/ehci-r096.pdf
35 1.7 augustss * and the USB 2.0 spec at
36 1.7 augustss * http://www.usb.org/developers/data/usb_20.zip
37 1.1 augustss */
38 1.1 augustss
39 1.1 augustss #ifndef _DEV_PCI_EHCIREG_H_
40 1.1 augustss #define _DEV_PCI_EHCIREG_H_
41 1.1 augustss
42 1.1 augustss /*** PCI config registers ***/
43 1.1 augustss
44 1.4 augustss #define PCI_CBMEM 0x10 /* configuration base MEM */
45 1.4 augustss
46 1.4 augustss #define PCI_INTERFACE_EHCI 0x20
47 1.4 augustss
48 1.4 augustss #define PCI_USBREV 0x60 /* RO USB protocol revision */
49 1.1 augustss #define PCI_USBREV_MASK 0xff
50 1.1 augustss #define PCI_USBREV_PRE_1_0 0x00
51 1.1 augustss #define PCI_USBREV_1_0 0x10
52 1.1 augustss #define PCI_USBREV_1_1 0x11
53 1.1 augustss #define PCI_USBREV_2_0 0x20
54 1.1 augustss
55 1.4 augustss #define PCI_EHCI_FLADJ 0x61 /*RW Frame len adj, SOF=59488+6*fladj */
56 1.1 augustss
57 1.4 augustss #define PCI_EHCI_PORTWAKECAP 0x62 /* RW Port wake caps (opt) */
58 1.1 augustss
59 1.22 augustss /* Regs at EECP + offset */
60 1.4 augustss #define PCI_EHCI_USBLEGSUP 0x00
61 1.23 augustss #define EHCI_LEG_HC_OS_OWNED 0x01000000
62 1.23 augustss #define EHCI_LEG_HC_BIOS_OWNED 0x00010000
63 1.4 augustss #define PCI_EHCI_USBLEGCTLSTS 0x04
64 1.26 jmcneill #define EHCI_LEG_EXT_SMI_BAR 0x80000000
65 1.26 jmcneill #define EHCI_LEG_EXT_SMI_PCICMD 0x40000000
66 1.26 jmcneill #define EHCI_LEG_EXT_SMI_OS_CHANGE 0x20000000
67 1.4 augustss
68 1.23 augustss #define EHCI_CAP_GET_ID(cap) ((cap) & 0xff)
69 1.23 augustss #define EHCI_CAP_GET_NEXT(cap) (((cap) >> 8) & 0xff)
70 1.23 augustss #define EHCI_CAP_ID_LEGACY 1
71 1.23 augustss
72 1.4 augustss /*** EHCI capability registers ***/
73 1.4 augustss
74 1.4 augustss #define EHCI_CAPLENGTH 0x00 /*RO Capability register length field */
75 1.4 augustss /* reserved 0x01 */
76 1.4 augustss #define EHCI_HCIVERSION 0x02 /* RO Interface version number */
77 1.4 augustss
78 1.4 augustss #define EHCI_HCSPARAMS 0x04 /* RO Structural parameters */
79 1.4 augustss #define EHCI_HCS_DEBUGPORT(x) (((x) >> 20) & 0xf)
80 1.18 augustss #define EHCI_HCS_P_INDICATOR(x) ((x) & 0x10000)
81 1.4 augustss #define EHCI_HCS_N_CC(x) (((x) >> 12) & 0xf) /* # of companion ctlrs */
82 1.4 augustss #define EHCI_HCS_N_PCC(x) (((x) >> 8) & 0xf) /* # of ports per comp. */
83 1.4 augustss #define EHCI_HCS_PPC(x) ((x) & 0x10) /* port power control */
84 1.4 augustss #define EHCI_HCS_N_PORTS(x) ((x) & 0xf) /* # of ports */
85 1.4 augustss
86 1.4 augustss #define EHCI_HCCPARAMS 0x08 /* RO Capability parameters */
87 1.4 augustss #define EHCI_HCC_EECP(x) (((x) >> 8) & 0xff) /* extended ports caps */
88 1.4 augustss #define EHCI_HCC_IST(x) (((x) >> 4) & 0xf) /* isoc sched threshold */
89 1.4 augustss #define EHCI_HCC_ASPC(x) ((x) & 0x4) /* async sched park cap */
90 1.4 augustss #define EHCI_HCC_PFLF(x) ((x) & 0x2) /* prog frame list flag */
91 1.4 augustss #define EHCI_HCC_64BIT(x) ((x) & 0x1) /* 64 bit address cap */
92 1.4 augustss
93 1.4 augustss #define EHCI_HCSP_PORTROUTE 0x0c /*RO Companion port route description */
94 1.4 augustss
95 1.4 augustss /* EHCI operational registers. Offset given by EHCI_CAPLENGTH register */
96 1.4 augustss #define EHCI_USBCMD 0x00 /* RO, RW, WO Command register */
97 1.4 augustss #define EHCI_CMD_ITC_M 0x00ff0000 /* RW interrupt threshold ctrl */
98 1.6 augustss #define EHCI_CMD_ITC_1 0x00010000
99 1.6 augustss #define EHCI_CMD_ITC_2 0x00020000
100 1.6 augustss #define EHCI_CMD_ITC_4 0x00040000
101 1.6 augustss #define EHCI_CMD_ITC_8 0x00080000
102 1.6 augustss #define EHCI_CMD_ITC_16 0x00100000
103 1.6 augustss #define EHCI_CMD_ITC_32 0x00200000
104 1.6 augustss #define EHCI_CMD_ITC_64 0x00400000
105 1.4 augustss #define EHCI_CMD_ASPME 0x00000800 /* RW/RO async park enable */
106 1.4 augustss #define EHCI_CMD_ASPMC 0x00000300 /* RW/RO async park count */
107 1.4 augustss #define EHCI_CMD_LHCR 0x00000080 /* RW light host ctrl reset */
108 1.4 augustss #define EHCI_CMD_IAAD 0x00000040 /* RW intr on async adv door bell */
109 1.4 augustss #define EHCI_CMD_ASE 0x00000020 /* RW async sched enable */
110 1.4 augustss #define EHCI_CMD_PSE 0x00000010 /* RW periodic sched enable */
111 1.6 augustss #define EHCI_CMD_FLS_M 0x0000000c /* RW/RO frame list size */
112 1.4 augustss #define EHCI_CMD_FLS(x) (((x) >> 2) & 3) /* RW/RO frame list size */
113 1.4 augustss #define EHCI_CMD_HCRESET 0x00000002 /* RW reset */
114 1.4 augustss #define EHCI_CMD_RS 0x00000001 /* RW run/stop */
115 1.4 augustss
116 1.4 augustss #define EHCI_USBSTS 0x04 /* RO, RW, RWC Status register */
117 1.4 augustss #define EHCI_STS_ASS 0x00008000 /* RO async sched status */
118 1.4 augustss #define EHCI_STS_PSS 0x00004000 /* RO periodic sched status */
119 1.4 augustss #define EHCI_STS_REC 0x00002000 /* RO reclamation */
120 1.4 augustss #define EHCI_STS_HCH 0x00001000 /* RO host controller halted */
121 1.4 augustss #define EHCI_STS_IAA 0x00000020 /* RWC interrupt on async adv */
122 1.4 augustss #define EHCI_STS_HSE 0x00000010 /* RWC host system error */
123 1.4 augustss #define EHCI_STS_FLR 0x00000008 /* RWC frame list rollover */
124 1.4 augustss #define EHCI_STS_PCD 0x00000004 /* RWC port change detect */
125 1.4 augustss #define EHCI_STS_ERRINT 0x00000002 /* RWC error interrupt */
126 1.4 augustss #define EHCI_STS_INT 0x00000001 /* RWC interrupt */
127 1.10 augustss #define EHCI_STS_INTRS(x) ((x) & 0x3f)
128 1.6 augustss
129 1.6 augustss #define EHCI_NORMAL_INTRS (EHCI_STS_IAA | EHCI_STS_HSE | EHCI_STS_PCD | EHCI_STS_ERRINT | EHCI_STS_INT)
130 1.4 augustss
131 1.4 augustss #define EHCI_USBINTR 0x08 /* RW Interrupt register */
132 1.4 augustss #define EHCI_INTR_IAAE 0x00000020 /* interrupt on async advance ena */
133 1.4 augustss #define EHCI_INTR_HSEE 0x00000010 /* host system error ena */
134 1.4 augustss #define EHCI_INTR_FLRE 0x00000008 /* frame list rollover ena */
135 1.4 augustss #define EHCI_INTR_PCIE 0x00000004 /* port change ena */
136 1.4 augustss #define EHCI_INTR_UEIE 0x00000002 /* USB error intr ena */
137 1.4 augustss #define EHCI_INTR_UIE 0x00000001 /* USB intr ena */
138 1.4 augustss
139 1.4 augustss #define EHCI_FRINDEX 0x0c /* RW Frame Index register */
140 1.4 augustss
141 1.4 augustss #define EHCI_CTRLDSSEGMENT 0x10 /* RW Control Data Structure Segment */
142 1.4 augustss
143 1.4 augustss #define EHCI_PERIODICLISTBASE 0x14 /* RW Periodic List Base */
144 1.4 augustss #define EHCI_ASYNCLISTADDR 0x18 /* RW Async List Base */
145 1.4 augustss
146 1.4 augustss #define EHCI_CONFIGFLAG 0x40 /* RW Configure Flag register */
147 1.4 augustss #define EHCI_CONF_CF 0x00000001 /* RW configure flag */
148 1.4 augustss
149 1.4 augustss #define EHCI_PORTSC(n) (0x40+4*(n)) /* RO, RW, RWC Port Status reg */
150 1.4 augustss #define EHCI_PS_WKOC_E 0x00400000 /* RW wake on over current ena */
151 1.4 augustss #define EHCI_PS_WKDSCNNT_E 0x00200000 /* RW wake on disconnect ena */
152 1.4 augustss #define EHCI_PS_WKCNNT_E 0x00100000 /* RW wake on connect ena */
153 1.4 augustss #define EHCI_PS_PTC 0x000f0000 /* RW port test control */
154 1.4 augustss #define EHCI_PS_PIC 0x0000c000 /* RW port indicator control */
155 1.4 augustss #define EHCI_PS_PO 0x00002000 /* RW port owner */
156 1.4 augustss #define EHCI_PS_PP 0x00001000 /* RW,RO port power */
157 1.4 augustss #define EHCI_PS_LS 0x00000c00 /* RO line status */
158 1.6 augustss #define EHCI_PS_IS_LOWSPEED(x) (((x) & EHCI_PS_LS) == 0x00000400)
159 1.4 augustss #define EHCI_PS_PR 0x00000100 /* RW port reset */
160 1.4 augustss #define EHCI_PS_SUSP 0x00000080 /* RW suspend */
161 1.4 augustss #define EHCI_PS_FPR 0x00000040 /* RW force port resume */
162 1.4 augustss #define EHCI_PS_OCC 0x00000020 /* RWC over current change */
163 1.4 augustss #define EHCI_PS_OCA 0x00000010 /* RO over current active */
164 1.4 augustss #define EHCI_PS_PEC 0x00000008 /* RWC port enable change */
165 1.5 augustss #define EHCI_PS_PE 0x00000004 /* RW port enable */
166 1.4 augustss #define EHCI_PS_CSC 0x00000002 /* RWC connect status change */
167 1.4 augustss #define EHCI_PS_CS 0x00000001 /* RO connect status */
168 1.5 augustss #define EHCI_PS_CLEAR (EHCI_PS_OCC|EHCI_PS_PEC|EHCI_PS_CSC)
169 1.8 augustss
170 1.8 augustss #define EHCI_PORT_RESET_COMPLETE 2 /* ms */
171 1.1 augustss
172 1.4 augustss #define EHCI_FLALIGN_ALIGN 0x1000
173 1.22 augustss #define EHCI_MAX_PORTS 16 /* only 4 bits available in EHCI_HCS_N_PORTS */
174 1.7 augustss
175 1.9 augustss /* No data structure may cross a page boundary. */
176 1.11 augustss #define EHCI_PAGE_SIZE 0x1000
177 1.11 augustss #define EHCI_PAGE(x) ((x) &~ 0xfff)
178 1.11 augustss #define EHCI_PAGE_OFFSET(x) ((x) & 0xfff)
179 1.9 augustss
180 1.7 augustss typedef u_int32_t ehci_link_t;
181 1.7 augustss #define EHCI_LINK_TERMINATE 0x00000001
182 1.7 augustss #define EHCI_LINK_TYPE(x) ((x) & 0x00000006)
183 1.7 augustss #define EHCI_LINK_ITD 0x0
184 1.7 augustss #define EHCI_LINK_QH 0x2
185 1.7 augustss #define EHCI_LINK_SITD 0x4
186 1.7 augustss #define EHCI_LINK_FSTN 0x6
187 1.13 augustss #define EHCI_LINK_ADDR(x) ((x) &~ 0x1f)
188 1.7 augustss
189 1.7 augustss typedef u_int32_t ehci_physaddr_t;
190 1.7 augustss
191 1.28 jmcneill typedef u_int32_t ehci_isoc_trans_t;
192 1.28 jmcneill typedef u_int32_t ehci_isoc_bufr_ptr_t;
193 1.28 jmcneill
194 1.7 augustss /* Isochronous Transfer Descriptor */
195 1.7 augustss typedef struct {
196 1.28 jmcneill volatile ehci_link_t itd_next;
197 1.28 jmcneill volatile ehci_isoc_trans_t itd_ctl[8];
198 1.28 jmcneill #define EHCI_ITD_GET_STATUS(x) (((x) >> 28) & 0xf)
199 1.28 jmcneill #define EHCI_ITD_SET_STATUS(x) (((x) & 0xf) << 28)
200 1.28 jmcneill #define EHCI_ITD_ACTIVE 0x80000000
201 1.28 jmcneill #define EHCI_ITD_BUF_ERR 0x40000000
202 1.28 jmcneill #define EHCI_ITD_BABBLE 0x20000000
203 1.28 jmcneill #define EHCI_ITD_ERROR 0x10000000
204 1.28 jmcneill #define EHCI_ITD_GET_LEN(x) (((x) >> 16) & 0xfff)
205 1.28 jmcneill #define EHCI_ITD_SET_LEN(x) (((x) & 0xfff) << 16)
206 1.28 jmcneill #define EHCI_ITD_IOC 0x8000
207 1.28 jmcneill #define EHCI_ITD_GET_IOC(x) (((x) >> 15) & 1)
208 1.28 jmcneill #define EHCI_ITD_SET_IOC(x) (((x) << 15) & EHCI_ITD_IOC)
209 1.29 jmorse #define EHCI_ITD_GET_PG(x) (((x) >> 12) & 0x7)
210 1.29 jmorse #define EHCI_ITD_SET_PG(x) (((x) & 0x7) << 12)
211 1.28 jmcneill #define EHCI_ITD_GET_OFFS(x) (((x) >> 0) & 0xfff)
212 1.28 jmcneill #define EHCI_ITD_SET_OFFS(x) (((x) & 0xfff) << 0)
213 1.28 jmcneill volatile ehci_isoc_bufr_ptr_t itd_bufr[7];
214 1.28 jmcneill #define EHCI_ITD_GET_BPTR(x) ((x) & 0xfffff000)
215 1.28 jmcneill #define EHCI_ITD_SET_BPTR(x) ((x) & 0xfffff000)
216 1.28 jmcneill #define EHCI_ITD_GET_EP(x) (((x) >> 8) & 0xf)
217 1.28 jmcneill #define EHCI_ITD_SET_EP(x) (((x) & 0xf) << 8)
218 1.28 jmcneill #define EHCI_ITD_GET_DADDR(x) ((x) & 0x7f)
219 1.28 jmcneill #define EHCI_ITD_SET_DADDR(x) ((x) & 0x7f)
220 1.28 jmcneill #define EHCI_ITD_GET_DIR(x) (((x) >> 11) & 1)
221 1.28 jmcneill #define EHCI_ITD_SET_DIR(x) (((x) & 1) << 11)
222 1.28 jmcneill #define EHCI_ITD_GET_MAXPKT(x) ((x) & 0x7ff)
223 1.28 jmcneill #define EHCI_ITD_SET_MAXPKT(x) ((x) & 0x7ff)
224 1.28 jmcneill #define EHCI_ITD_GET_MULTI(x) ((x) & 0x3)
225 1.28 jmcneill #define EHCI_ITD_SET_MULTI(x) ((x) & 0x3)
226 1.29 jmorse volatile ehci_isoc_bufr_ptr_t itd_bufr_hi[7];
227 1.7 augustss } ehci_itd_t;
228 1.7 augustss #define EHCI_ITD_ALIGN 32
229 1.7 augustss
230 1.7 augustss /* Split Transaction Isochronous Transfer Descriptor */
231 1.7 augustss typedef struct {
232 1.24 scw volatile ehci_link_t sitd_next;
233 1.7 augustss /* XXX many more */
234 1.7 augustss } ehci_sitd_t;
235 1.7 augustss #define EHCI_SITD_ALIGN 32
236 1.7 augustss
237 1.7 augustss /* Queue Element Transfer Descriptor */
238 1.11 augustss #define EHCI_QTD_NBUFFERS 5
239 1.7 augustss typedef struct {
240 1.24 scw volatile ehci_link_t qtd_next;
241 1.24 scw volatile ehci_link_t qtd_altnext;
242 1.24 scw volatile u_int32_t qtd_status;
243 1.9 augustss #define EHCI_QTD_GET_STATUS(x) (((x) >> 0) & 0xff)
244 1.19 augustss #define EHCI_QTD_SET_STATUS(x) ((x) << 0)
245 1.7 augustss #define EHCI_QTD_ACTIVE 0x80
246 1.7 augustss #define EHCI_QTD_HALTED 0x40
247 1.7 augustss #define EHCI_QTD_BUFERR 0x20
248 1.7 augustss #define EHCI_QTD_BABBLE 0x10
249 1.7 augustss #define EHCI_QTD_XACTERR 0x08
250 1.7 augustss #define EHCI_QTD_MISSEDMICRO 0x04
251 1.7 augustss #define EHCI_QTD_SPLITXSTATE 0x02
252 1.7 augustss #define EHCI_QTD_PINGSTATE 0x01
253 1.21 augustss #define EHCI_QTD_STATERRS 0x3c
254 1.9 augustss #define EHCI_QTD_GET_PID(x) (((x) >> 8) & 0x3)
255 1.9 augustss #define EHCI_QTD_SET_PID(x) ((x) << 8)
256 1.7 augustss #define EHCI_QTD_PID_OUT 0x0
257 1.7 augustss #define EHCI_QTD_PID_IN 0x1
258 1.7 augustss #define EHCI_QTD_PID_SETUP 0x2
259 1.9 augustss #define EHCI_QTD_GET_CERR(x) (((x) >> 10) & 0x3)
260 1.11 augustss #define EHCI_QTD_SET_CERR(x) ((x) << 10)
261 1.9 augustss #define EHCI_QTD_GET_C_PAGE(x) (((x) >> 12) & 0x7)
262 1.11 augustss #define EHCI_QTD_SET_C_PAGE(x) ((x) << 12)
263 1.9 augustss #define EHCI_QTD_GET_IOC(x) (((x) >> 15) & 0x1)
264 1.11 augustss #define EHCI_QTD_IOC 0x00008000
265 1.9 augustss #define EHCI_QTD_GET_BYTES(x) (((x) >> 16) & 0x7fff)
266 1.11 augustss #define EHCI_QTD_SET_BYTES(x) ((x) << 16)
267 1.9 augustss #define EHCI_QTD_GET_TOGGLE(x) (((x) >> 31) & 0x1)
268 1.17 mycroft #define EHCI_QTD_SET_TOGGLE(x) ((x) << 31)
269 1.17 mycroft #define EHCI_QTD_TOGGLE_MASK 0x80000000
270 1.24 scw volatile ehci_physaddr_t qtd_buffer[EHCI_QTD_NBUFFERS];
271 1.24 scw volatile ehci_physaddr_t qtd_buffer_hi[EHCI_QTD_NBUFFERS];
272 1.7 augustss } ehci_qtd_t;
273 1.7 augustss #define EHCI_QTD_ALIGN 32
274 1.7 augustss
275 1.7 augustss /* Queue Head */
276 1.7 augustss typedef struct {
277 1.24 scw volatile ehci_link_t qh_link;
278 1.24 scw volatile u_int32_t qh_endp;
279 1.9 augustss #define EHCI_QH_GET_ADDR(x) (((x) >> 0) & 0x7f) /* endpoint addr */
280 1.9 augustss #define EHCI_QH_SET_ADDR(x) (x)
281 1.11 augustss #define EHCI_QH_ADDRMASK 0x0000007f
282 1.9 augustss #define EHCI_QH_GET_INACT(x) (((x) >> 7) & 0x01) /* inactivate on next */
283 1.9 augustss #define EHCI_QH_INACT 0x00000080
284 1.9 augustss #define EHCI_QH_GET_ENDPT(x) (((x) >> 8) & 0x0f) /* endpoint no */
285 1.9 augustss #define EHCI_QH_SET_ENDPT(x) ((x) << 8)
286 1.10 augustss #define EHCI_QH_GET_EPS(x) (((x) >> 12) & 0x03) /* endpoint speed */
287 1.9 augustss #define EHCI_QH_SET_EPS(x) ((x) << 12)
288 1.9 augustss #define EHCI_QH_SPEED_FULL 0x0
289 1.9 augustss #define EHCI_QH_SPEED_LOW 0x1
290 1.9 augustss #define EHCI_QH_SPEED_HIGH 0x2
291 1.9 augustss #define EHCI_QH_GET_DTC(x) (((x) >> 14) & 0x01) /* data toggle control */
292 1.9 augustss #define EHCI_QH_DTC 0x00004000
293 1.9 augustss #define EHCI_QH_GET_HRECL(x) (((x) >> 15) & 0x01) /* head of reclamation */
294 1.9 augustss #define EHCI_QH_HRECL 0x00008000
295 1.9 augustss #define EHCI_QH_GET_MPL(x) (((x) >> 16) & 0x7ff) /* max packet len */
296 1.9 augustss #define EHCI_QH_SET_MPL(x) ((x) << 16)
297 1.16 mycroft #define EHCI_QH_MPLMASK 0x07ff0000
298 1.15 mycroft #define EHCI_QH_GET_CTL(x) (((x) >> 27) & 0x01) /* control endpoint */
299 1.9 augustss #define EHCI_QH_CTL 0x08000000
300 1.9 augustss #define EHCI_QH_GET_NRL(x) (((x) >> 28) & 0x0f) /* NAK reload */
301 1.9 augustss #define EHCI_QH_SET_NRL(x) ((x) << 28)
302 1.24 scw volatile u_int32_t qh_endphub;
303 1.9 augustss #define EHCI_QH_GET_SMASK(x) (((x) >> 0) & 0xff) /* intr sched mask */
304 1.9 augustss #define EHCI_QH_SET_SMASK(x) ((x) << 0)
305 1.9 augustss #define EHCI_QH_GET_CMASK(x) (((x) >> 8) & 0xff) /* split completion mask */
306 1.9 augustss #define EHCI_QH_SET_CMASK(x) ((x) << 8)
307 1.9 augustss #define EHCI_QH_GET_HUBA(x) (((x) >> 16) & 0x7f) /* hub address */
308 1.9 augustss #define EHCI_QH_SET_HUBA(x) ((x) << 16)
309 1.9 augustss #define EHCI_QH_GET_PORT(x) (((x) >> 23) & 0x7f) /* hub port */
310 1.9 augustss #define EHCI_QH_SET_PORT(x) ((x) << 23)
311 1.9 augustss #define EHCI_QH_GET_MULT(x) (((x) >> 30) & 0x03) /* pipe multiplier */
312 1.9 augustss #define EHCI_QH_SET_MULT(x) ((x) << 30)
313 1.24 scw volatile ehci_link_t qh_curqtd;
314 1.25 mlelstv ehci_qtd_t qh_qtd;
315 1.7 augustss } ehci_qh_t;
316 1.7 augustss #define EHCI_QH_ALIGN 32
317 1.7 augustss
318 1.7 augustss /* Periodic Frame Span Traversal Node */
319 1.7 augustss typedef struct {
320 1.24 scw volatile ehci_link_t fstn_link;
321 1.24 scw volatile ehci_link_t fstn_back;
322 1.7 augustss } ehci_fstn_t;
323 1.7 augustss #define EHCI_FSTN_ALIGN 32
324 1.1 augustss
325 1.1 augustss #endif /* _DEV_PCI_EHCIREG_H_ */
326