ehcireg.h revision 1.5 1 1.5 augustss /* $NetBSD: ehcireg.h,v 1.5 2001/11/15 23:25:09 augustss Exp $ */
2 1.1 augustss
3 1.1 augustss /*
4 1.5 augustss * Copyright (c) 2001 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 * 3. All advertising materials mentioning features or use of this software
19 1.1 augustss * must display the following acknowledgement:
20 1.1 augustss * This product includes software developed by the NetBSD
21 1.1 augustss * Foundation, Inc. and its contributors.
22 1.1 augustss * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 augustss * contributors may be used to endorse or promote products derived
24 1.1 augustss * from this software without specific prior written permission.
25 1.1 augustss *
26 1.1 augustss * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 augustss * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 augustss * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 augustss * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 augustss * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 augustss * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 augustss * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 augustss * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 augustss * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 augustss * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 augustss * POSSIBILITY OF SUCH DAMAGE.
37 1.2 augustss */
38 1.2 augustss
39 1.2 augustss /*
40 1.3 gehenna * EHCI 0.96 spec can be found at
41 1.3 gehenna * http://developer.intel.com/technology/usb/download/ehci-r096.pdf
42 1.1 augustss */
43 1.1 augustss
44 1.1 augustss #ifndef _DEV_PCI_EHCIREG_H_
45 1.1 augustss #define _DEV_PCI_EHCIREG_H_
46 1.1 augustss
47 1.1 augustss /*** PCI config registers ***/
48 1.1 augustss
49 1.4 augustss #define PCI_CBMEM 0x10 /* configuration base MEM */
50 1.4 augustss
51 1.4 augustss #define PCI_INTERFACE_EHCI 0x20
52 1.4 augustss
53 1.4 augustss #define PCI_USBREV 0x60 /* RO USB protocol revision */
54 1.1 augustss #define PCI_USBREV_MASK 0xff
55 1.1 augustss #define PCI_USBREV_PRE_1_0 0x00
56 1.1 augustss #define PCI_USBREV_1_0 0x10
57 1.1 augustss #define PCI_USBREV_1_1 0x11
58 1.1 augustss #define PCI_USBREV_2_0 0x20
59 1.1 augustss
60 1.4 augustss #define PCI_EHCI_FLADJ 0x61 /*RW Frame len adj, SOF=59488+6*fladj */
61 1.1 augustss
62 1.4 augustss #define PCI_EHCI_PORTWAKECAP 0x62 /* RW Port wake caps (opt) */
63 1.1 augustss
64 1.4 augustss /* Regs ar EECP + offset */
65 1.4 augustss #define PCI_EHCI_USBLEGSUP 0x00
66 1.4 augustss #define PCI_EHCI_USBLEGCTLSTS 0x04
67 1.4 augustss
68 1.4 augustss /*** EHCI capability registers ***/
69 1.4 augustss
70 1.4 augustss #define EHCI_CAPLENGTH 0x00 /*RO Capability register length field */
71 1.4 augustss /* reserved 0x01 */
72 1.4 augustss #define EHCI_HCIVERSION 0x02 /* RO Interface version number */
73 1.4 augustss
74 1.4 augustss #define EHCI_HCSPARAMS 0x04 /* RO Structural parameters */
75 1.4 augustss #define EHCI_HCS_DEBUGPORT(x) (((x) >> 20) & 0xf)
76 1.4 augustss #define EHCI_HCS_P_INCICATOR(x) ((x) & 0x10000)
77 1.4 augustss #define EHCI_HCS_N_CC(x) (((x) >> 12) & 0xf) /* # of companion ctlrs */
78 1.4 augustss #define EHCI_HCS_N_PCC(x) (((x) >> 8) & 0xf) /* # of ports per comp. */
79 1.4 augustss #define EHCI_HCS_PPC(x) ((x) & 0x10) /* port power control */
80 1.4 augustss #define EHCI_HCS_N_PORTS(x) ((x) & 0xf) /* # of ports */
81 1.4 augustss
82 1.4 augustss #define EHCI_HCCPARAMS 0x08 /* RO Capability parameters */
83 1.4 augustss #define EHCI_HCC_EECP(x) (((x) >> 8) & 0xff) /* extended ports caps */
84 1.4 augustss #define EHCI_HCC_IST(x) (((x) >> 4) & 0xf) /* isoc sched threshold */
85 1.4 augustss #define EHCI_HCC_ASPC(x) ((x) & 0x4) /* async sched park cap */
86 1.4 augustss #define EHCI_HCC_PFLF(x) ((x) & 0x2) /* prog frame list flag */
87 1.4 augustss #define EHCI_HCC_64BIT(x) ((x) & 0x1) /* 64 bit address cap */
88 1.4 augustss
89 1.4 augustss #define EHCI_HCSP_PORTROUTE 0x0c /*RO Companion port route description */
90 1.4 augustss
91 1.4 augustss /* EHCI operational registers. Offset given by EHCI_CAPLENGTH register */
92 1.4 augustss #define EHCI_USBCMD 0x00 /* RO, RW, WO Command register */
93 1.4 augustss #define EHCI_CMD_ITC_M 0x00ff0000 /* RW interrupt threshold ctrl */
94 1.4 augustss #define EHCI_CMD_ASPME 0x00000800 /* RW/RO async park enable */
95 1.4 augustss #define EHCI_CMD_ASPMC 0x00000300 /* RW/RO async park count */
96 1.4 augustss #define EHCI_CMD_LHCR 0x00000080 /* RW light host ctrl reset */
97 1.4 augustss #define EHCI_CMD_IAAD 0x00000040 /* RW intr on async adv door bell */
98 1.4 augustss #define EHCI_CMD_ASE 0x00000020 /* RW async sched enable */
99 1.4 augustss #define EHCI_CMD_PSE 0x00000010 /* RW periodic sched enable */
100 1.4 augustss #define EHCI_CMD_FLS(x) (((x) >> 2) & 3) /* RW/RO frame list size */
101 1.4 augustss #define EHCI_CMD_HCRESET 0x00000002 /* RW reset */
102 1.4 augustss #define EHCI_CMD_RS 0x00000001 /* RW run/stop */
103 1.4 augustss
104 1.4 augustss #define EHCI_USBSTS 0x04 /* RO, RW, RWC Status register */
105 1.4 augustss #define EHCI_STS_ASS 0x00008000 /* RO async sched status */
106 1.4 augustss #define EHCI_STS_PSS 0x00004000 /* RO periodic sched status */
107 1.4 augustss #define EHCI_STS_REC 0x00002000 /* RO reclamation */
108 1.4 augustss #define EHCI_STS_HCH 0x00001000 /* RO host controller halted */
109 1.4 augustss #define EHCI_STS_IAA 0x00000020 /* RWC interrupt on async adv */
110 1.4 augustss #define EHCI_STS_HSE 0x00000010 /* RWC host system error */
111 1.4 augustss #define EHCI_STS_FLR 0x00000008 /* RWC frame list rollover */
112 1.4 augustss #define EHCI_STS_PCD 0x00000004 /* RWC port change detect */
113 1.4 augustss #define EHCI_STS_ERRINT 0x00000002 /* RWC error interrupt */
114 1.4 augustss #define EHCI_STS_INT 0x00000001 /* RWC interrupt */
115 1.4 augustss
116 1.4 augustss #define EHCI_USBINTR 0x08 /* RW Interrupt register */
117 1.4 augustss #define EHCI_INTR_IAAE 0x00000020 /* interrupt on async advance ena */
118 1.4 augustss #define EHCI_INTR_HSEE 0x00000010 /* host system error ena */
119 1.4 augustss #define EHCI_INTR_FLRE 0x00000008 /* frame list rollover ena */
120 1.4 augustss #define EHCI_INTR_PCIE 0x00000004 /* port change ena */
121 1.4 augustss #define EHCI_INTR_UEIE 0x00000002 /* USB error intr ena */
122 1.4 augustss #define EHCI_INTR_UIE 0x00000001 /* USB intr ena */
123 1.4 augustss
124 1.4 augustss #define EHCI_FRINDEX 0x0c /* RW Frame Index register */
125 1.4 augustss
126 1.4 augustss #define EHCI_CTRLDSSEGMENT 0x10 /* RW Control Data Structure Segment */
127 1.4 augustss
128 1.4 augustss #define EHCI_PERIODICLISTBASE 0x14 /* RW Periodic List Base */
129 1.4 augustss #define EHCI_ASYNCLISTADDR 0x18 /* RW Async List Base */
130 1.4 augustss
131 1.4 augustss #define EHCI_CONFIGFLAG 0x40 /* RW Configure Flag register */
132 1.4 augustss #define EHCI_CONF_CF 0x00000001 /* RW configure flag */
133 1.4 augustss
134 1.4 augustss #define EHCI_PORTSC(n) (0x40+4*(n)) /* RO, RW, RWC Port Status reg */
135 1.4 augustss #define EHCI_PS_WKOC_E 0x00400000 /* RW wake on over current ena */
136 1.4 augustss #define EHCI_PS_WKDSCNNT_E 0x00200000 /* RW wake on disconnect ena */
137 1.4 augustss #define EHCI_PS_WKCNNT_E 0x00100000 /* RW wake on connect ena */
138 1.4 augustss #define EHCI_PS_PTC 0x000f0000 /* RW port test control */
139 1.4 augustss #define EHCI_PS_PIC 0x0000c000 /* RW port indicator control */
140 1.4 augustss #define EHCI_PS_PO 0x00002000 /* RW port owner */
141 1.4 augustss #define EHCI_PS_PP 0x00001000 /* RW,RO port power */
142 1.4 augustss #define EHCI_PS_LS 0x00000c00 /* RO line status */
143 1.4 augustss #define EHCI_PS_PR 0x00000100 /* RW port reset */
144 1.4 augustss #define EHCI_PS_SUSP 0x00000080 /* RW suspend */
145 1.4 augustss #define EHCI_PS_FPR 0x00000040 /* RW force port resume */
146 1.4 augustss #define EHCI_PS_OCC 0x00000020 /* RWC over current change */
147 1.4 augustss #define EHCI_PS_OCA 0x00000010 /* RO over current active */
148 1.4 augustss #define EHCI_PS_PEC 0x00000008 /* RWC port enable change */
149 1.5 augustss #define EHCI_PS_PE 0x00000004 /* RW port enable */
150 1.4 augustss #define EHCI_PS_CSC 0x00000002 /* RWC connect status change */
151 1.4 augustss #define EHCI_PS_CS 0x00000001 /* RO connect status */
152 1.5 augustss #define EHCI_PS_CLEAR (EHCI_PS_OCC|EHCI_PS_PEC|EHCI_PS_CSC)
153 1.1 augustss
154 1.4 augustss #define EHCI_FLALIGN_ALIGN 0x1000
155 1.1 augustss
156 1.1 augustss #endif /* _DEV_PCI_EHCIREG_H_ */
157