xref: /netbsd-src/sys/arch/mips/cavium/dev/octeon_usbcreg.h (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1 /*	$NetBSD: octeon_usbcreg.h,v 1.1 2015/04/29 08:32:01 hikaru Exp $	*/
2 
3 /*
4  * Copyright (c) 2007 Internet Initiative Japan, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 /*
30  * USBC Registers
31  */
32 
33 #ifndef _OCTEON_USBCREG_H_
34 #define _OCTEON_USBCREG_H_
35 
36 /* ---- register addresses */
37 
38 #define USBC_GOTGCTL				0x00016F0010000000ULL
39 #define USBC_GOTGINT				0x00016F0010000004ULL
40 #define USBC_GAHBCFG				0x00016F0010000008ULL
41 #define USBC_GUSBCFG				0x00016F001000000CULL
42 #define USBC_GRSTCTL				0x00016F0010000010ULL
43 #define USBC_GINTSTS				0x00016F0010000014ULL
44 #define USBC_GINTMSK				0x00016F0010000018ULL
45 #define USBC_GRXSTSRH				0x00016F001000001CULL
46 #define USBC_GRXSTSPH				0x00016F0010000020ULL
47 #define USBC_GRXFSIZ				0x00016F0010000024ULL
48 #define USBC_GNPTXFSIZ				0x00016F0010000028ULL
49 #define USBC_GNPTXSTS				0x00016F001000002CULL
50 #define USBC_GSNPSID				0x00016F0010000040ULL
51 #define USBC_GHWCFG1				0x00016F0010000044ULL
52 #define USBC_GHWCFG2				0x00016F0010000048ULL
53 #define USBC_GHWCFG3				0x00016F001000004CULL
54 #define USBC_GHWCFG4				0x00016F0010000050ULL
55 #define USBC_HPTXFSIZ				0x00016F0010000100ULL
56 #define USBC_DPTXFSIZ1				0x00016F0010000104ULL
57 #define USBC_DPTXFSIZ2				0x00016F0010000108ULL
58 #define USBC_DPTXFSIZ3				0x00016F001000010CULL
59 #define USBC_DPTXFSIZ4				0x00016F0010000110ULL
60 #define USBC_HCFG				0x00016F0010000400ULL
61 #define USBC_HFIR				0x00016F0010000404ULL
62 #define USBC_HFNUM				0x00016F0010000408ULL
63 #define USBC_HPTXSTS				0x00016F0010000410ULL
64 #define USBC_HAINT				0x00016F0010000414ULL
65 #define USBC_HAINTMSK				0x00016F0010000418ULL
66 #define USBC_HPRT				0x00016F0010000440ULL
67 #define USBC_HCCHAR0				0x00016F0010000500ULL
68 #define USBC_HCCHAR1				0x00016F0010000520ULL
69 #define USBC_HCCHAR2				0x00016F0010000540ULL
70 #define USBC_HCCHAR3				0x00016F0010000560ULL
71 #define USBC_HCCHAR4				0x00016F0010000580ULL
72 #define USBC_HCCHAR5				0x00016F00100005A0ULL
73 #define USBC_HCCHAR6				0x00016F00100005C0ULL
74 #define USBC_HCCHAR7				0x00016F00100005E0ULL
75 #define USBC_HCSPLT0				0x00016F0010000504ULL
76 #define USBC_HCSPLT1				0x00016F0010000524ULL
77 #define USBC_HCSPLT2				0x00016F0010000544ULL
78 #define USBC_HCSPLT3				0x00016F0010000564ULL
79 #define USBC_HCSPLT4				0x00016F0010000584ULL
80 #define USBC_HCSPLT5				0x00016F00100005A4ULL
81 #define USBC_HCSPLT6				0x00016F00100005C4ULL
82 #define USBC_HCSPLT7				0x00016F00100005E4ULL
83 #define USBC_HCINT0				0x00016F0010000508ULL
84 #define USBC_HCINT1				0x00016F0010000528ULL
85 #define USBC_HCINT2				0x00016F0010000548ULL
86 #define USBC_HCINT3				0x00016F0010000568ULL
87 #define USBC_HCINT4				0x00016F0010000588ULL
88 #define USBC_HCINT5				0x00016F00100005A8ULL
89 #define USBC_HCINT6				0x00016F00100005C8ULL
90 #define USBC_HCINT7				0x00016F00100005E8ULL
91 #define USBC_HCINTMSK0				0x00016F001000050CULL
92 #define USBC_HCINTMSK1				0x00016F001000052CULL
93 #define USBC_HCINTMSK2				0x00016F001000054CULL
94 #define USBC_HCINTMSK3				0x00016F001000056CULL
95 #define USBC_HCINTMSK4				0x00016F001000058CULL
96 #define USBC_HCINTMSK5				0x00016F00100005ACULL
97 #define USBC_HCINTMSK6				0x00016F00100005CCULL
98 #define USBC_HCINTMSK7				0x00016F00100005ECULL
99 #define USBC_HCTSIZ0				0x00016F0010000510ULL
100 #define USBC_HCTSIZ1				0x00016F0010000530ULL
101 #define USBC_HCTSIZ2				0x00016F0010000550ULL
102 #define USBC_HCTSIZ3				0x00016F0010000570ULL
103 #define USBC_HCTSIZ4				0x00016F0010000590ULL
104 #define USBC_HCTSIZ5				0x00016F00100005B0ULL
105 #define USBC_HCTSIZ6				0x00016F00100005D0ULL
106 #define USBC_HCTSIZ7				0x00016F00100005F0ULL
107 #define USBC_DCFG				0x00016F0010000800ULL
108 #define USBC_DCTL				0x00016F0010000804ULL
109 #define USBC_DSTS				0x00016F0010000808ULL
110 #define USBC_DIEPMSK				0x00016F0010000810ULL
111 #define USBC_DOEPMSK				0x00016F0010000814ULL
112 #define USBC_DAINT				0x00016F0010000818ULL
113 #define USBC_DAINTMSK				0x00016F001000081CULL
114 #define USBC_DTKNQR1				0x00016F0010000820ULL
115 #define USBC_DTKNQR2				0x00016F0010000824ULL
116 #define USBC_DTKNQR3				0x00016F0010000830ULL
117 #define USBC_DTKNQR4				0x00016F0010000834ULL
118 #define USBC_DIEPCTL0				0x00016F0010000900ULL
119 #define USBC_DIEPCTL1				0x00016F0010000920ULL
120 #define USBC_DIEPCTL2				0x00016F0010000940ULL
121 #define USBC_DIEPCTL3				0x00016F0010000960ULL
122 #define USBC_DIEPCTL4				0x00016F0010000980ULL
123 #define USBC_DIEPINT0				0x00016F0010000908ULL
124 #define USBC_DIEPINT1				0x00016F0010000928ULL
125 #define USBC_DIEPINT2				0x00016F0010000948ULL
126 #define USBC_DIEPINT3				0x00016F0010000968ULL
127 #define USBC_DIEPINT4				0x00016F0010000988ULL
128 #define USBC_DIEPTSIZ0				0x00016F0010000910ULL
129 #define USBC_DIEPTSIZ1				0x00016F0010000930ULL
130 #define USBC_DIEPTSIZ2				0x00016F0010000950ULL
131 #define USBC_DIEPTSIZ3				0x00016F0010000970ULL
132 #define USBC_DIEPTSIZ4				0x00016F0010000990ULL
133 #define USBC_OEPCTL0				0x00016F0010000B00ULL
134 #define USBC_OEPCTL1				0x00016F0010000B20ULL
135 #define USBC_OEPCTL2				0x00016F0010000B40ULL
136 #define USBC_OEPCTL3				0x00016F0010000B60ULL
137 #define USBC_OEPCTL4				0x00016F0010000B80ULL
138 #define USBC_OEPINT0				0x00016F0010000B08ULL
139 #define USBC_OEPINT1				0x00016F0010000B28ULL
140 #define USBC_OEPINT2				0x00016F0010000B48ULL
141 #define USBC_OEPINT3				0x00016F0010000B68ULL
142 #define USBC_OEPINT4				0x00016F0010000B88ULL
143 #define USBC_OEPTSIZ0				0x00016F0010000B10ULL
144 #define USBC_OEPTSIZ1				0x00016F0010000B30ULL
145 #define USBC_OEPTSIZ2				0x00016F0010000B50ULL
146 #define USBC_OEPTSIZ3				0x00016F0010000B70ULL
147 #define USBC_OEPTSIZ4				0x00016F0010000B90ULL
148 #define USBC_PCGCCTL				0x00016F0010000E00ULL
149 #define USBC_NPTXDFIFO0				0x00016F0010001000ULL
150 #define USBC_NPTXDFIFO1				0x00016F0010002000ULL
151 #define USBC_NPTXDFIFO2				0x00016F0010003000ULL
152 #define USBC_NPTXDFIFO3				0x00016F0010004000ULL
153 #define USBC_NPTXDFIFO4				0x00016F0010005000ULL
154 #define USBC_NPTXDFIFO5				0x00016F0010006000ULL
155 #define USBC_NPTXDFIFO6				0x00016F0010007000ULL
156 #define USBC_NPTXDFIFO7				0x00016F0010008000ULL
157 #define USBC_GRXSTSRD				0x00016F001004001CULL
158 #define USBC_GRXSTSPD				0x00016F0010040020ULL
159 
160 /* ---- register bits */
161 
162 #define USBC_GOTGCTL_XXX_31_21			0xffe00000
163 #define USBC_GOTGCTL_XXX_20			UINT32_C(0x00100000)
164 #define USBC_GOTGCTL_BSESVLD			UINT32_C(0x00080000)
165 #define USBC_GOTGCTL_ASESVLD			UINT32_C(0x00040000)
166 #define USBC_GOTGCTL_DBNCTIME			UINT32_C(0x00020000)
167 #define USBC_GOTGCTL_CONIDSTS			UINT32_C(0x00010000)
168 #define USBC_GOTGCTL_XXX_15_12			0x0000f000
169 #define USBC_GOTGCTL_DEVHNPEN			UINT32_C(0x00000800)
170 #define USBC_GOTGCTL_HSTSETHNPEN		UINT32_C(0x00000400)
171 #define USBC_GOTGCTL_HNPREQ			UINT32_C(0x00000200)
172 #define USBC_GOTGCTL_HSTNEGSCS			UINT32_C(0x00000100)
173 #define USBC_GOTGCTL_XXX_7_2			0x000000fc
174 #define USBC_GOTGCTL_SESREQ			UINT32_C(0x00000002)
175 #define USBC_GOTGCTL_SESREQSCS			UINT32_C(0x00000001)
176 
177 #define USBC_GOTGINT_XXX_31_20			0xfff00000
178 #define USBC_GOTGINT_DBNCEDONE			UINT32_C(0x00080000)
179 #define USBC_GOTGINT_ADEVTOUTCHG		UINT32_C(0x00040000)
180 #define USBC_GOTGINT_HSTNEGDET			UINT32_C(0x00020000)
181 #define USBC_GOTGINT_XXX_16_10			0x0001fc00
182 #define USBC_GOTGINT_HSTNEGSUCSTSCHNG		UINT32_C(0x00000200)
183 #define USBC_GOTGINT_SESREQSUCSTSCHNG		UINT32_C(0x00000100)
184 #define USBC_GOTGINT_XXX_7_3			0x000000f8
185 #define USBC_GOTGINT_SESENDDET			UINT32_C(0x00000004)
186 #define USBC_GOTGINT_XXX_1			UINT32_C(0x00000002)
187 #define USBC_GOTGINT_XXX_0			UINT32_C(0x00000001)
188 
189 #define USBC_GAHBCFG_XXX_31_9			0xfffffe00
190 #define USBC_GAHBCFG_PTXFEMPLVL			UINT32_C(0x00000100)
191 #define USBC_GAHBCFG_NPTXFEMPLVL		UINT32_C(0x00000080)
192 #define USBC_GAHBCFG_XXX_6			UINT32_C(0x00000040)
193 #define USBC_GAHBCFG_DMAEN			UINT32_C(0x00000020)
194 #define USBC_GAHBCFG_HBSTLEN			0x0000001e
195 #define USBC_GAHBCFG_HBSTLEN_OFFSET		1
196 #define USBC_GAHBCFG_GLBLINTRMSK		UINT32_C(0x00000001)
197 
198 #define USBC_GUSBCFG_XXX_31_17			0xfffe0000
199 #define USBC_GUSBCFG_OTGI2CSEL			UINT32_C(0x00010000)
200 #define USBC_GUSBCFG_PHYLPWRCLKSEL		UINT32_C(0x00008000)
201 #define USBC_GUSBCFG_XXX_14			UINT32_C(0x00004000)
202 #define USBC_GUSBCFG_USBTRDTIM			0x00003c00
203 #define USBC_GUSBCFG_USBTRDTIM_OFFSET		10
204 #define USBC_GUSBCFG_HNPCAP			UINT32_C(0x00000200)
205 #define USBC_GUSBCFG_SRPCAP			UINT32_C(0x00000100)
206 #define USBC_GUSBCFG_DDRSEL			UINT32_C(0x00000080)
207 #define USBC_GUSBCFG_PHYSEL			UINT32_C(0x00000040)
208 #define USBC_GUSBCFG_FSINTF			UINT32_C(0x00000020)
209 #define USBC_GUSBCFG_ULPI_UTMI_SEL		UINT32_C(0x00000010)
210 #define USBC_GUSBCFG_PHYIF			UINT32_C(0x00000008)
211 #define USBC_GUSBCFG_TOUTCAL			0x00000007
212 #define USBC_GUSBCFG_TOUTCAL_OFFSET		0
213 
214 #define USBC_GRSTCTL_AHBIDLE			UINT32_C(0x80000000)
215 #define USBC_GRSTCTL_DMAREQ			UINT32_C(0x40000000)
216 #define USBC_GRSTCTL_XXX_29_11			0x3ffff800
217 #define USBC_GRSTCTL_TXFNUM			0x000007c0
218 #define USBC_GRSTCTL_TXFNUM_OFFSET		6
219 #define USBC_GRSTCTL_TXFFLSH			UINT32_C(0x00000020)
220 #define USBC_GRSTCTL_RXFFLSH			UINT32_C(0x00000010)
221 #define USBC_GRSTCTL_INTKNQFLSH			UINT32_C(0x00000008)
222 #define USBC_GRSTCTL_FRMCNTRRST			UINT32_C(0x00000004)
223 #define USBC_GRSTCTL_HSFTRST			UINT32_C(0x00000002)
224 #define USBC_GRSTCTL_CSFTRST			UINT32_C(0x00000001)
225 
226 #define USBC_GINTSTS_WKUPINT			UINT32_C(0x80000000)
227 #define USBC_GINTSTS_SESSREQINT			UINT32_C(0x40000000)
228 #define USBC_GINTSTS_DISCONNINT			UINT32_C(0x20000000)
229 #define USBC_GINTSTS_CONIDSTSCHNG		UINT32_C(0x10000000)
230 #define USBC_GINTSTS_XXX_27			UINT32_C(0x08000000)
231 #define USBC_GINTSTS_PTXFEMP			UINT32_C(0x04000000)
232 #define USBC_GINTSTS_HCHINT			UINT32_C(0x02000000)
233 #define USBC_GINTSTS_PRTINT			UINT32_C(0x01000000)
234 #define USBC_GINTSTS_XXX_23			UINT32_C(0x00800000)
235 #define USBC_GINTSTS_FETSUSP			UINT32_C(0x00400000)
236 #define USBC_GINTSTS_INCOMPLP			UINT32_C(0x00200000)
237 #define USBC_GINTSTS_INCOMPISOIN		UINT32_C(0x00100000)
238 #define USBC_GINTSTS_OEPINT			UINT32_C(0x00080000)
239 #define USBC_GINTSTS_IEPINT			UINT32_C(0x00040000)
240 #define USBC_GINTSTS_EPMIS			UINT32_C(0x00020000)
241 #define USBC_GINTSTS_XXX_16			UINT32_C(0x00010000)
242 #define USBC_GINTSTS_EOPF			UINT32_C(0x00008000)
243 #define USBC_GINTSTS_ISOOUTDROP			UINT32_C(0x00004000)
244 #define USBC_GINTSTS_ENUMDONE			UINT32_C(0x00002000)
245 #define USBC_GINTSTS_USBRST			UINT32_C(0x00001000)
246 #define USBC_GINTSTS_USBSUSP			UINT32_C(0x00000800)
247 #define USBC_GINTSTS_ERLYSUSP			UINT32_C(0x00000400)
248 #define USBC_GINTSTS_I2CINT			UINT32_C(0x00000200)
249 #define USBC_GINTSTS_ULPICKINT			UINT32_C(0x00000100)
250 #define USBC_GINTSTS_GOUTNAKEFF			UINT32_C(0x00000080)
251 #define USBC_GINTSTS_GINNAKEFF			UINT32_C(0x00000040)
252 #define USBC_GINTSTS_NPTXFEMP			UINT32_C(0x00000020)
253 #define USBC_GINTSTS_RXFLVL			UINT32_C(0x00000010)
254 #define USBC_GINTSTS_SOF			UINT32_C(0x00000008)
255 #define USBC_GINTSTS_OTGINT			UINT32_C(0x00000004)
256 #define USBC_GINTSTS_MODEMIS			UINT32_C(0x00000002)
257 #define USBC_GINTSTS_CURMOD			UINT32_C(0x00000001)
258 #define USBC_GINTSTS_CURMOD_OFFSET		0
259 #define  USBC_GINTSTS_CURMOD_DEVICE		0x0
260 #define  USBC_GINTSTS_CURMOD_HOST		0x1
261 
262 #define USBC_GINTMSK_WKUPINTMSK			UINT32_C(0x80000000)
263 #define USBC_GINTMSK_SESSREQINTMSK		UINT32_C(0x40000000)
264 #define USBC_GINTMSK_DISCONNINTMSK		UINT32_C(0x20000000)
265 #define USBC_GINTMSK_CONIDSTSTCHNGMSK		UINT32_C(0x10000000)
266 #define USBC_GINTMSK_XXX_27			UINT32_C(0x08000000)
267 #define USBC_GINTMSK_PTXFEMPMSK			UINT32_C(0x04000000)
268 #define USBC_GINTMSK_HCHINTMSK			UINT32_C(0x02000000)
269 #define USBC_GINTMSK_PRTINTMSK			UINT32_C(0x01000000)
270 #define USBC_GINTMSK_XXX_23			UINT32_C(0x00800000)
271 #define USBC_GINTMSK_FETSUSPMSK			UINT32_C(0x00400000)
272 #define USBC_GINTMSK_INCOMPISOOUTMSK		UINT32_C(0x00200000)
273 #define USBC_GINTMSK_INCOMPISOINMSK		UINT32_C(0x00100000)
274 #define USBC_GINTMSK_OEPINTMSK			UINT32_C(0x00080000)
275 #define USBC_GINTMSK_INEPINTMSK			UINT32_C(0x00040000)
276 #define USBC_GINTMSK_EPMISMSK			UINT32_C(0x00020000)
277 #define USBC_GINTMSK_XXX_16			UINT32_C(0x00010000)
278 #define USBC_GINTMSK_EOPFMSK			UINT32_C(0x00008000)
279 #define USBC_GINTMSK_ISOOUTDROPMSK		UINT32_C(0x00004000)
280 #define USBC_GINTMSK_ENUMDONEMSK		UINT32_C(0x00002000)
281 #define USBC_GINTMSK_USBRSTMSK			UINT32_C(0x00001000)
282 #define USBC_GINTMSK_USBSUSPMSK			UINT32_C(0x00000800)
283 #define USBC_GINTMSK_ERLYSUSPMSK		UINT32_C(0x00000400)
284 #define USBC_GINTMSK_I2CINT			UINT32_C(0x00000200)
285 #define USBC_GINTMSK_ULPICKINTMSK		UINT32_C(0x00000100)
286 #define USBC_GINTMSK_GOUTNAKEFFMSK		UINT32_C(0x00000080)
287 #define USBC_GINTMSK_GINNAKEFFMSK		UINT32_C(0x00000040)
288 #define USBC_GINTMSK_NPTXFEMPMSK		UINT32_C(0x00000020)
289 #define USBC_GINTMSK_RXFLVLMSK			UINT32_C(0x00000010)
290 #define USBC_GINTMSK_SOFMSK			UINT32_C(0x00000008)
291 #define USBC_GINTMSK_OTGINTMSK			UINT32_C(0x00000004)
292 #define USBC_GINTMSK_MODEMISMSK			UINT32_C(0x00000002)
293 #define USBC_GINTMSK_XXX_0			UINT32_C(0x00000001)
294 
295 #define USBC_GRXSTSRH_XXX_31_21			0xffe00000
296 #define USBC_GRXSTSRH_PKTSTS			0x001e0000
297 #define USBC_GRXSTSRH_PKTSTS_OFFSET		17
298 #define USBC_GRXSTSRH_DPID			0x00018000
299 #define USBC_GRXSTSRH_DPID_OFFSET		15
300 #define  USBC_GRXSTSRH_DPID_DATA0		0x00
301 #define  USBC_GRXSTSRH_DPID_DATA1		0x10
302 #define  USBC_GRXSTSRH_DPID_DATA2		0x01
303 #define  USBC_GRXSTSRH_DPID_MDATA		0x11
304 #define USBC_GRXSTSRH_BCNT			0x00007ff0
305 #define USBC_GRXSTSRH_BCNT_OFFSET		4
306 #define USBC_GRXSTSRH_CHNUM			0x0000000f
307 #define USBC_GRXSTSRH_CHNUM_OFFSET		0
308 
309 #define USBC_GRXSTSPH_XXX_31_21			0xffe00000
310 #define USBC_GRXSTSPH_PKTSTS			0x001e0000
311 #define USBC_GRXSTSPH_PKTSTS_OFFSET		17
312 #define  USBC_GRXSTSPH_PKTSTS_IN_DATA_RECV	0x2
313 #define  USBC_GRXSTSPH_PKTSTS_IN_XFER_COMPL	0x3
314 #define  USBC_GRXSTSPH_PKTSTS_TGL_ERR		0x5
315 #define  USBC_GRXSTSPH_PKTSTS_CH_HLTD		0x7
316 #define USBC_GRXSTSPH_DPID			0x00018000
317 #define USBC_GRXSTSPH_DPID_OFFSET		15
318 #define  USBC_GRXSTSPH_DPID_DATA0		0x00
319 #define  USBC_GRXSTSPH_DPID_DATA1		0x10
320 #define  USBC_GRXSTSPH_DPID_DATA2		0x01
321 #define  USBC_GRXSTSPH_DPID_MDATA		0x11
322 #define USBC_GRXSTSPH_BCNT			0x00007ff0
323 #define USBC_GRXSTSPH_BCNT_OFFSET		4
324 #define USBC_GRXSTSPH_CHNUM			0x0000000f
325 #define USBC_GRXSTSPH_CHNUM_OFFSET		0
326 
327 #define USBC_GRXSTSRD_XXX_31_25			0xfe000000
328 #define USBC_GRXSTSRD_FN			0x01e00000
329 #define USBC_GRXSTSRD_PKTSTS			0x001e0000
330 #define USBC_GRXSTSRD_DPID			0x00018000
331 #define USBC_GRXSTSRD_BCNT			0x00007ff0
332 #define USBC_GRXSTSRD_EPNUM			0x0000000f
333 
334 #define USBC_GRXSTSPD_XXX_31_25			0xfe000000
335 #define USBC_GRXSTSPD_FN			0x01e00000
336 #define USBC_GRXSTSPD_PKTSTS			0x001e0000
337 #define USBC_GRXSTSPD_DPID			0x00018000
338 #define USBC_GRXSTSPD_BCNT			0x00007ff0
339 #define USBC_GRXSTSPD_EPNUM			0x0000000f
340 
341 #define USBC_GRXFSIZ_XXX_31_16			0xffff0000
342 #define USBC_GRXFSIZ_RXFDEP			0x0000ffff
343 
344 #define USBC_GNPTXFSIZ_NPTXFEDP			0xffff0000
345 #define USBC_GNPTXFSIZ_NPTXFEDP_OFFSET		16
346 #define USBC_GNPTXFSIZ_NPTXFSTADDR		0x0000ffff
347 
348 #define USBC_GNPTXSTS_XXX_31			UINT32_C(0x80000000)
349 #define USBC_GNPTXSTS_NPTXQTOP_CHNUM		0x78000000
350 #define USBC_GNPTXSTS_NPTXQTOP_ENTRY		0x06000000
351 #define USBC_GNPTXSTS_NPTXQTOP_TERMINATE	UINT32_C(0x01000000)
352 #define USBC_GNPTXSTS_NPTXQSPCAVAIL		0x00ff0000
353 #define USBC_GNPTXSTS_NPTXQSPCAVAIL_OFFSET	16
354 #define USBC_GNPTXSTS_NPTXFSPCAVAIL		0x0000ffff
355 #define USBC_GNPTXSTS_NPTXFSPCAVAIL_OFFSET	0
356 
357 #define USBC_GSNPSID_SYNOPSYSID			0xffffffff
358 
359 #define USBC_GHWCFG1_EPDIR			0xffffffff
360 
361 #define USBC_GHWCFG2_XXX_31			UINT32_C(0x80000000)
362 #define USBC_GHWCFG2_TKNQDEPTH			0x7c000000
363 #define USBC_GHWCFG2_PTXQDEPTH			0x03000000
364 #define USBC_GHWCFG2_PTXQDEPTH_OFFSET		24
365 #define USBC_GHWCFG2_NPTXQDEPTH			0x00c00000
366 #define USBC_GHWCFG2_NPTXQDEPTH_OFFSET		22
367 #define USBC_GHWCFG2_XXX_21_20			0x00300000
368 #define USBC_GHWCFG2_DYNFIFOSIZING		UINT32_C(0x00080000)
369 #define USBC_GHWCFG2_PERIOSUPPORT		UINT32_C(0x00040000)
370 #define USBC_GHWCFG2_NUMHSTCHN1			0x0003c000
371 #define USBC_GHWCFG2_NUMHSTCHN1_OFFSET		14
372 #define USBC_GHWCFG2_NUMDEVEPS			0x00003c00
373 #define USBC_GHWCFG2_FSPHYTYPE			0x00000300
374 #define USBC_GHWCFG2_HSPHYTYPE			0x000000c0
375 #define USBC_GHWCFG2_SINGPNT			UINT32_C(0x00000020)
376 #define USBC_GHWCFG2_OTGARCH			0x00000018
377 #define USBC_GHWCFG2_OTGARCH_OFFSET		3
378 #define  USBC_GHWCFG2_OTGARCH_SLAVEONLY		0x0
379 #define  USBC_GHWCFG2_OTGARCH_EXTERNALDMA	0x1
380 #define  USBC_GHWCFG2_OTGARCH_INTERNALDMA	0x2
381 #define  USBC_GHWCFG2_OTGARCH_RESERVED		0x3
382 #define USBC_GHWCFG2_OTGMODE			0x00000007
383 
384 #define USBC_GHWCFG3_DFIFODEPTH			0xffff0000
385 #define USBC_GHWCFG3_DFIFODEPTH_OFFSET		16
386 #define USBC_GHWCFG3_XXX_15_13			0x0000e000
387 #define USBC_GHWCFG3_AHBPHYSYNC			UINT32_C(0x00001000)
388 #define USBC_GHWCFG3_RSTTYPE			UINT32_C(0x00000800)
389 #define USBC_GHWCFG3_OPTFEATURE			UINT32_C(0x00000400)
390 #define USBC_GHWCFG3_VENDOR_CONTROL_INTERFACE_SUPPORT	UINT32_C(0x00000200)
391 #define USBC_GHWCFG3_I2C_SELECTION		UINT32_C(0x00000100)
392 #define USBC_GHWCFG3_OTGEN			UINT32_C(0x00000080)
393 #define USBC_GHWCFG3_PKTSIZEWIDTH		0x00000070
394 #define USBC_GHWCFG3_XFERSIZEWIDTH		0x0000000f
395 
396 #define USBC_GHWCFG4_XXX_31_25			0xfe000000
397 #define USBC_GHWCFG4_SESSENDFLTR		UINT32_C(0x01000000)
398 #define USBC_GHWCFG4_BVAILDFLTR			UINT32_C(0x01000000)
399 #define USBC_GHWCFG4_AVAILDFLTR			UINT32_C(0x00800000)
400 #define USBC_GHWCFG4_VBUSVALIDFLTR		UINT32_C(0x00400000)
401 #define USBC_GHWCFG4_IDDGFLTR			UINT32_C(0x00200000)
402 #define USBC_GHWCFG4_NUMCTLEPS			0x000f0000
403 #define USBC_GHWCFG4_PHYDATAWIDTH		0x0000c000
404 #define USBC_GHWCFG4_XXX_13_6			0x00003fc0
405 #define USBC_GHWCFG4_AHBFREQ			UINT32_C(0x00000020)
406 #define USBC_GHWCFG4_ENABLEPWROPT		UINT32_C(0x00000010)
407 #define USBC_GHWCFG4_NUMDEVPERIOEPS		0x0000000f
408 
409 #define USBC_HPTXFSIZ_PTXFSIZE			0xffff0000
410 #define USBC_HPTXFSIZ_PTXFSIZE_OFFSET		16
411 #define	USBC_HPTXFSIZ_PTXFSTADDR		0x0000ffff
412 #define USBC_HPTXFSIZ_PTXFSTADDR_OFFSET		0
413 
414 /* for USBC_DPTXFSIZ(1..4) */
415 #define USBC_DPTXFSIZX_DPTXFSIZE		0xffff0000
416 #define USBC_DPTXFSIZX_PTXFSTADDR		0x0000ffff
417 
418 #define USBC_HCFG_XXX_31_3			0xfffffff8
419 #define USBC_HCFG_FSLSSUPP			UINT32_C(0x00000004)
420 #define USBC_HCFG_FSLSPCLKSEL			0x00000003
421 #define USBC_HCFG_FSLSPCLKSEL_OFFSET		0
422 #define  USBC_HCFG_FSLSPCLKSEL_30_60_MHZ	0x00
423 #define  USBC_HCFG_FSLSPCLKSEL_48_MHZ		0x01
424 #define  USBC_HCFG_FSLSPCLKSEL_6_MHZ		0x10
425 
426 #define USBC_HFIR_XXX_31_16			0xffff0000
427 #define USBC_HFIR_FRINT				0x0000ffff
428 #define USBC_HFIR_FRINT_OFFSET			0
429 
430 #define USBC_HFNUM_FRREM			0xffff0000
431 #define USBC_HFNUM_FRNUM			0x0000ffff
432 
433 #define USBC_HPTXSTS_PTXQTOP			0xff000000
434 #define USBC_HPTXSTS_PTXQSPCAVAIL		0x00ff0000
435 #define USBC_HPTXSTS_PTXQSPCAVAIL_OFFSET	16
436 #define USBC_HPTXSTS_PTXFSPCAVAIL		0x0000ffff
437 #define USBC_HPTXSTS_PTXFSPCAVAIL_OFFSET	0
438 
439 #define USBC_HAINT_XXX_31_16			0xffff0000
440 /* #define USBC_HAINT_HAINT			__BITS32(15, 0) */
441 #define USBC_HAINT_HAINT_F			UINT32_C(0x00008000)
442 #define USBC_HAINT_HAINT_E			UINT32_C(0x00004000)
443 #define USBC_HAINT_HAINT_D			UINT32_C(0x00002000)
444 #define USBC_HAINT_HAINT_C			UINT32_C(0x00001000)
445 #define USBC_HAINT_HAINT_B			UINT32_C(0x00000800)
446 #define USBC_HAINT_HAINT_A			UINT32_C(0x00000400)
447 #define USBC_HAINT_HAINT_9			UINT32_C(0x00000200)
448 #define USBC_HAINT_HAINT_8			UINT32_C(0x00000100)
449 #define USBC_HAINT_HAINT_7			UINT32_C(0x00000080)
450 #define USBC_HAINT_HAINT_6			UINT32_C(0x00000040)
451 #define USBC_HAINT_HAINT_5			UINT32_C(0x00000020)
452 #define USBC_HAINT_HAINT_4			UINT32_C(0x00000010)
453 #define USBC_HAINT_HAINT_3			UINT32_C(0x00000008)
454 #define USBC_HAINT_HAINT_2			UINT32_C(0x00000004)
455 #define USBC_HAINT_HAINT_1			UINT32_C(0x00000002)
456 #define USBC_HAINT_HAINT_0			UINT32_C(0x00000001)
457 
458 #define USBC_HAINTMSK_XXX_31_16			0xffff0000
459 /*#define USBC_HAINTMSK_HAINTMSK			__BITS32(15, 0) */
460 #define USBC_HAINTMSK_HAINTMSK_F		UINT32_C(0x00008000)
461 #define USBC_HAINTMSK_HAINTMSK_E		UINT32_C(0x00004000)
462 #define USBC_HAINTMSK_HAINTMSK_D		UINT32_C(0x00002000)
463 #define USBC_HAINTMSK_HAINTMSK_C		UINT32_C(0x00001000)
464 #define USBC_HAINTMSK_HAINTMSK_B		UINT32_C(0x00000800)
465 #define USBC_HAINTMSK_HAINTMSK_A		UINT32_C(0x00000400)
466 #define USBC_HAINTMSK_HAINTMSK_9		UINT32_C(0x00000200)
467 #define USBC_HAINTMSK_HAINTMSK_8		UINT32_C(0x00000100)
468 #define USBC_HAINTMSK_HAINTMSK_7		UINT32_C(0x00000080)
469 #define USBC_HAINTMSK_HAINTMSK_6		UINT32_C(0x00000040)
470 #define USBC_HAINTMSK_HAINTMSK_5		UINT32_C(0x00000020)
471 #define USBC_HAINTMSK_HAINTMSK_4		UINT32_C(0x00000010)
472 #define USBC_HAINTMSK_HAINTMSK_3		UINT32_C(0x00000008)
473 #define USBC_HAINTMSK_HAINTMSK_2		UINT32_C(0x00000004)
474 #define USBC_HAINTMSK_HAINTMSK_1		UINT32_C(0x00000002)
475 #define USBC_HAINTMSK_HAINTMSK_0		UINT32_C(0x00000001)
476 
477 #define USBC_HPRT_XXX_31_19			0xfff80000
478 #define USBC_HPRT_PRTSPD			0x00060000
479 #define USBC_HPRT_PRTSPD_OFFSET			17
480 #define  USBC_HPRT_PRTSPD_HIGH			0x0
481 #define  USBC_HPRT_PRTSPD_FULL			0x1
482 #define  USBC_HPRT_PRTSPD_LOW			0x2
483 #define  USBC_HPRT_PRTSPD_RESERVED		0x3
484 #define USBC_HPRT_PRTTSTCTL			0x0001e000
485 #define USBC_HPRT_PRTPWR			UINT32_C(0x00001000)
486 #define USBC_HPRT_PRTLNSTS			0x00000c00
487 #define USBC_HPRT_XXX_9				UINT32_C(0x00000200)
488 #define USBC_HPRT_PRTRST			UINT32_C(0x00000100)
489 #define USBC_HPRT_PRTSUSP			UINT32_C(0x00000080)
490 #define USBC_HPRT_PRTRES			UINT32_C(0x00000040)
491 #define USBC_HPRT_PRTOVRCURRCHNG		UINT32_C(0x00000020)
492 #define USBC_HPRT_PRTOVRCURRACT			UINT32_C(0x00000010)
493 #define USBC_HPRT_PRTENCHNG			UINT32_C(0x00000008)
494 #define USBC_HPRT_PRTENA			UINT32_C(0x00000004)
495 #define USBC_HPRT_PRTCONNDET			UINT32_C(0x00000002)
496 #define USBC_HPRT_PRTCONNSTS			UINT32_C(0x00000001)
497 
498 /* for USBC_HCCHAR(0..7) */
499 #define USBC_HCCHARX_CHENA			UINT32_C(0x80000000)
500 #define USBC_HCCHARX_CHDIS			UINT32_C(0x40000000)
501 #define USBC_HCCHARX_ODDFRM			UINT32_C(0x20000000)
502 #define USBC_HCCHARX_DEVADDR			0x1fc00000
503 #define USBC_HCCHARX_DEVADDR_OFFSET		22
504 #define USBC_HCCHARX_EC				0x00300000
505 #define USBC_HCCHARX_EC_OFFSET			20
506 #define USBC_HCCHARX_EPTYPE			0x000c0000
507 #define USBC_HCCHARX_EPTYPE_OFFSET		18
508 #define  USBC_HCCHARX_EPTYPE_CONTROL		0x00
509 #define  USBC_HCCHARX_EPTYPE_ISOCHRONOUS	0x01
510 #define  USBC_HCCHARX_EPTYPE_BULK		0x02
511 #define  USBC_HCCHARX_EPTYPE_INTERRUPT		0x03
512 #define USBC_HCCHARX_LSPDDEV			UINT32_C(0x00020000)
513 #define USBC_HCCHARX_XXX_16			UINT32_C(0x00010000)
514 #define USBC_HCCHARX_EPDIR			UINT32_C(0x00008000)
515 #define USBC_HCCHARX_EPNUM			0x00007800
516 #define USBC_HCCHARX_EPNUM_OFFSET		11
517 #define USBC_HCCHARX_MPS			0x000007ff
518 #define USBC_HCCHARX_MPS_OFFSET			0
519 
520 /* for USBC_HCSPLT(0..7) */
521 #define USBC_HCSPLTX_SPLTENA			UINT32_C(0x80000000)
522 #define USBC_HCSPLTX_XXX_30_17			0x7ffe0000
523 #define USBC_HCSPLTX_COMPSPLT			UINT32_C(0x00010000)
524 #define USBC_HCSPLTX_XACTPOS			0x0000c000
525 #define USBC_HCSPLTX_HUBADDR			0x00003f80
526 #define USBC_HCSPLTX_PRTADDR			0x0000007f
527 
528 /* for USBC_HCINT(0..7) */
529 #define USBC_HCINTX_XXX_31_11			0xfffff800
530 #define	USBC_HCINTX_DATATGLERR			UINT32_C(0x00000400)
531 #define	USBC_HCINTX_FRMOVRUN			UINT32_C(0x00000200)
532 #define	USBC_HCINTX_BBLERR			UINT32_C(0x00000100)
533 #define	USBC_HCINTX_XACTERR			UINT32_C(0x00000080)
534 #define	USBC_HCINTX_NYET			UINT32_C(0x00000040)
535 #define	USBC_HCINTX_ACK				UINT32_C(0x00000020)
536 #define	USBC_HCINTX_NAK				UINT32_C(0x00000010)
537 #define	USBC_HCINTX_STALL			UINT32_C(0x00000008)
538 #define	USBC_HCINTX_AHBERR			UINT32_C(0x00000004)
539 #define	USBC_HCINTX_CHHLTD			UINT32_C(0x00000002)
540 #define	USBC_HCINTX_XFERCOMPL			UINT32_C(0x00000001)
541 
542 /* for USBC_HCINTMSK(0..7) */
543 #define USBC_HCINTMSKX_XXX_31_11		0xfffff800
544 #define	USBC_HCINTMSKX_DATATGLERRMSK		UINT32_C(0x00000400)
545 #define	USBC_HCINTMSKX_FRMOVRUNMSK		UINT32_C(0x00000200)
546 #define	USBC_HCINTMSKX_BBLERRMSK		UINT32_C(0x00000100)
547 #define	USBC_HCINTMSKX_XACTERRMSK		UINT32_C(0x00000080)
548 #define	USBC_HCINTMSKX_NYETMSK			UINT32_C(0x00000040)
549 #define	USBC_HCINTMSKX_ACKMSK			UINT32_C(0x00000020)
550 #define	USBC_HCINTMSKX_NAKMSK			UINT32_C(0x00000010)
551 #define	USBC_HCINTMSKX_STALLMSK			UINT32_C(0x00000008)
552 #define	USBC_HCINTMSKX_AHBERRMSK		UINT32_C(0x00000004)
553 #define	USBC_HCINTMSKX_CHHLTDMSK		UINT32_C(0x00000002)
554 #define	USBC_HCINTMSKX_XFERCOMPLMSK		UINT32_C(0x00000001)
555 
556 /* for USBC_HCTSIZ(0..7) */
557 #define USBC_HCTSIZX_DOPNG			UINT32_C(0x80000000)
558 #define USBC_HCTSIZX_PID			0x60000000
559 #define USBC_HCTSIZX_PID_OFFSET			29
560 #define  USBC_HCTSIZX_PID_DATA0			0x00
561 #define  USBC_HCTSIZX_PID_DATA2			0x01
562 #define  USBC_HCTSIZX_PID_DATA1			0x02
563 #define  USBC_HCTSIZX_PID_MDATA_SETUP		0x03
564 #define USBC_HCTSIZX_PKTCNT			0x1ff80000
565 #define USBC_HCTSIZX_PKTCNT_OFFSET		19
566 #define USBC_HCTSIZX_XFERSIZE			0x0007ffff
567 #define USBC_HCTSIZX_XFERSIZE_OFFSET		0
568 
569 /* XXX Device Mode Registers */
570 
571 
572 
573 /* for USBC_NPTXDFIFO(0..7) */
574 #define USBC_NPTXDFIFOX_DATA			0xffffffff
575 
576 /* ---- snprintb */
577 
578 #define	USBC_GOTGINT_BITS \
579 	"\177"		/* new format */ \
580 	"\020"		/* hex display */ \
581 	"\020"		/* %016x format */ \
582 	"b\x13"		"DBNCEDONE\0" \
583 	"b\x12"		"ADEVTOUTCHG\0" \
584 	"b\x11"		"HSTNEGDET\0" \
585 	"b\x09"		"HSTNEGSUCSTSCHNG\0" \
586 	"b\x08"		"SESREQSUCSTSCHNG\0" \
587 	"b\x02"		"SESENDDET\0"
588 
589 #define	USBC_GINTSTS_BITS \
590 	"\177"		/* new format */ \
591 	"\020"		/* hex display */ \
592 	"\020"		/* %016x format */ \
593 	"b\x1f"		"WKUPINT\0" \
594 	"b\x1e"		"SESSREQINT\0" \
595 	"b\x1d"		"DISCONNINT\0" \
596 	"b\x1c"		"CONIDSTSCHNG\0" \
597 	"b\x1a"		"PTXFEMP\0" \
598 	"b\x19"		"HCHINT\0" \
599 	"b\x18"		"PRTINT\0" \
600 	"b\x16"		"FETSUSP\0" \
601 	"b\x15"		"INCOMPLP\0" \
602 	"b\x14"		"INCOMPISOIN\0" \
603 	"b\x13"		"OEPINT\0" \
604 	"b\x12"		"IEPINT\0" \
605 	"b\x11"		"EPMIS\0" \
606 	"b\x0f"		"EOPF\0" \
607 	"b\x0e"		"ISOOUTDROP\0" \
608 	"b\x0d"		"ENUMDONE\0" \
609 	"b\x0c"		"USBRST\0" \
610 	"b\x0b"		"USBSUSP\0" \
611 	"b\x0a"		"ERLYSUSP\0" \
612 	"b\x09"		"I2CINT\0" \
613 	"b\x08"		"ULPICKINT\0" \
614 	"b\x07"		"GOUTNAKEFF\0" \
615 	"b\x06"		"GINNAKEFF\0" \
616 	"b\x05"		"NPTXFEMP\0" \
617 	"b\x04"		"RXFLVL\0" \
618 	"b\x03"		"SOF\0" \
619 	"b\x02"		"OTGINT\0" \
620 	"b\x01"		"MODEMIS\0" \
621 	"b\x00"		"CURMOD\0"
622 
623 #define	USBC_GINTMSK_BITS \
624 	"\177"		/* new format */ \
625 	"\020"		/* hex display */ \
626 	"\020"		/* %016x format */ \
627 	"b\x1f"		"WKUPINTMSK\0" \
628 	"b\x1e"		"SESSREQINTMSK\0" \
629 	"b\x1d"		"DISCONNINTMSK\0" \
630 	"b\x1c"		"CONIDSTSTCHNGMSK\0" \
631 	"b\x1a"		"PTXFEMPMSK\0" \
632 	"b\x19"		"HCHINTMSK\0" \
633 	"b\x18"		"PRTINTMSK\0" \
634 	"b\x16"		"FETSUSPMSK\0" \
635 	"b\x15"		"INCOMPISOOUTMSK\0" \
636 	"b\x14"		"INCOMPISOINMSK\0" \
637 	"b\x13"		"OEPINTMSK\0" \
638 	"b\x12"		"INEPINTMSK\0" \
639 	"b\x11"		"EPMISMSK\0" \
640 	"b\x0f"		"EOPFMSK\0" \
641 	"b\x0e"		"ISOOUTDROPMSK\0" \
642 	"b\x0d"		"ENUMDONEMSK\0" \
643 	"b\x0c"		"USBRSTMSK\0" \
644 	"b\x0b"		"USBSUSPMSK\0" \
645 	"b\x0a"		"ERLYSUSPMSK\0" \
646 	"b\x09"		"I2CINT\0" \
647 	"b\x08"		"ULPICKINTMSK\0" \
648 	"b\x07"		"GOUTNAKEFFMSK\0" \
649 	"b\x06"		"GINNAKEFFMSK\0" \
650 	"b\x05"		"NPTXFEMPMSK\0" \
651 	"b\x04"		"RXFLVLMSK\0" \
652 	"b\x03"		"SOFMSK\0" \
653 	"b\x02"		"OTGINTMSK\0" \
654 	"b\x01"		"MODEMISMSK\0"
655 
656 #define	USBC_GRXSTSRH_BITS \
657 	"\177"		/* new format */ \
658 	"\020"		/* hex display */ \
659 	"\020"		/* %016x format */ \
660 	"f\x11\x04"	"PKTSTS\0" \
661 	"f\x0f\x02"	"DPID\0" \
662 	"f\x04\x0b"	"BCNT\0" \
663 	"f\x00\x04"	"CHNUM\0"
664 
665 #define	USBC_GRXSTSPH_BITS \
666 	"\177"		/* new format */ \
667 	"\020"		/* hex display */ \
668 	"\020"		/* %016x format */ \
669 	"f\x11\x04"	"PKTSTS\0" \
670 	"f\x0f\x02"	"DPID\0" \
671 	"f\x04\x0b"	"BCNT\0" \
672 	"f\x00\x04"	"CHNUM\0"
673 
674 #define	USBC_GUSBCFG_BITS \
675 	"\177"		/* new format */ \
676 	"\020"		/* hex display */ \
677 	"\020"		/* %016x format */ \
678 	"b\x10"		"OTGI2CSEL\0" \
679 	"b\x0f"		"PHYLPWRCLKSEL\0" \
680 	"f\x0a\x04"	"USBTRDTIM\0" \
681 	"b\x09"		"HNPCAP\0" \
682 	"b\x08"		"SRPCAP\0" \
683 	"b\x07"		"DDRSEL\0" \
684 	"b\x06"		"PHYSEL\0" \
685 	"b\x05"		"FSINTF\0" \
686 	"b\x04"		"ULPI_UTMI_SEL\0" \
687 	"b\x03"		"PHYIF\0" \
688 	"f\x00\x03"	"TOUTCAL\0"
689 
690 #define	USBC_GRSTCTL_BITS \
691 	"\177"		/* new format */ \
692 	"\020"		/* hex display */ \
693 	"\020"		/* %016x format */ \
694 	"b\x1f"		"AHBIDLE\0" \
695 	"b\x1e"		"DMAREQ\0" \
696 	"f\x06\x05"	"TXFNUM\0" \
697 	"b\x05"		"TXFFLSH\0" \
698 	"b\x04"		"RXFFLSH\0" \
699 	"b\x03"		"INTKNQFLSH\0" \
700 	"b\x02"		"FRMCNTRRST\0" \
701 	"b\x01"		"HSFTRST\0" \
702 	"b\x00"		"CSFTRST\0"
703 
704 #define	USBC_GAHBCFG_BITS \
705 	"\177"		/* new format */ \
706 	"\020"		/* hex display */ \
707 	"\020"		/* %016x format */ \
708 	"b\x08"		"PTXFEMPLVL\0" \
709 	"b\x07"		"NPTXFEMPLVL\0" \
710 	"b\x05"		"DMAEN\0" \
711 	"f\x01\x04"	"HBSTLEN\0" \
712 	"b\x00"		"GLBLINTRMSK\0"
713 
714 #define	USBC_GRXFSIZ_BITS \
715 	"\177"		/* new format */ \
716 	"\020"		/* hex display */ \
717 	"\020"		/* %016x format */ \
718 	"f\x00\x10"	"RXFDEP\0"
719 
720 #define	USBC_GNPTXFSIZ_BITS \
721 	"\177"		/* new format */ \
722 	"\020"		/* hex display */ \
723 	"\020"		/* %016x format */ \
724 	"f\x10\x10"	"NPTXFEDP\0" \
725 	"f\x00\x10"	"NPTXFSTADDR\0"
726 
727 #define	USBC_GNPTXSTS_BITS \
728 	"\177"		/* new format */ \
729 	"\020"		/* hex display */ \
730 	"\020"		/* %016x format */ \
731 	"f\x1b\x04"	"NPTXQTOP_CHNUM\0" \
732 	"f\x19\x02"	"NPTXQTOP_ENTRY\0" \
733 	"b\x18"		"NPTXQTOP_TERMINATE\0" \
734 	"f\x10\x08"	"NPTXQSPCAVAIL\0" \
735 	"f\x00\x10"	"NPTXFSPCAVAIL\0"
736 
737 #define	USBC_GHWCFG1_BITS \
738 	"\177"		/* new format */ \
739 	"\020"		/* hex display */ \
740 	"\020"		/* %016x format */ \
741 	"f\x00\x20"	"EPDIR\0"
742 
743 #define	USBC_GHWCFG2_BITS \
744 	"\177"		/* new format */ \
745 	"\020"		/* hex display */ \
746 	"\020"		/* %016x format */ \
747 	"f\x1a\x05"	"TKNQDEPTH\0" \
748 	"f\x18\x02"	"PTXQDEPTH\0" \
749 	"f\x16\x02"	"NPTXQDEPTH\0" \
750 	"b\x13"		"DYNFIFOSIZING\0" \
751 	"b\x12"		"PERIOSUPPORT\0" \
752 	"f\x0e\x04"	"NUMHSTCHN1\0" \
753 	"f\x0a\x04"	"NUMDEVEPS\0" \
754 	"f\x08\x02"	"FSPHYTYPE\0" \
755 	"f\x06\x02"	"HSPHYTYPE\0" \
756 	"b\x05"		"SINGPNT\0" \
757 	"f\x03\x02"	"OTGARCH\0" \
758 	"f\x00\x03"	"OTGMODE\0"
759 
760 #define	USBC_GHWCFG3_BITS \
761 	"\177"		/* new format */ \
762 	"\020"		/* hex display */ \
763 	"\020"		/* %016x format */ \
764 	"f\x10\x10"	"DFIFODEPTH\0" \
765 	"b\x0c"		"AHBPHYSYNC\0" \
766 	"b\x0b"		"RSTTYPE\0" \
767 	"b\x0a"		"OPTFEATURE\0" \
768 	"b\x09"		"VENDOR_CONTROL_INTERFACE_SUPPORT\0" \
769 	"b\x08"		"I2C_SELECTION\0" \
770 	"b\x07"		"OTGEN\0" \
771 	"f\x04\x03"	"PKTSIZEWIDTH\0" \
772 	"f\x00\x04"	"XFERSIZEWIDTH\0"
773 
774 #define	USBC_GHWCFG4_BITS \
775 	"\177"		/* new format */ \
776 	"\020"		/* hex display */ \
777 	"\020"		/* %016x format */ \
778 	"b\x18"		"SESSENDFLTR\0" \
779 	"b\x18"		"BVAILDFLTR\0" \
780 	"b\x17"		"AVAILDFLTR\0" \
781 	"b\x16"		"VBUSVALIDFLTR\0" \
782 	"b\x15"		"IDDGFLTR\0" \
783 	"f\x10\x04"	"NUMCTLEPS\0" \
784 	"f\x0e\x02"	"PHYDATAWIDTH\0" \
785 	"b\x05"		"AHBFREQ\0" \
786 	"b\x04"		"ENABLEPWROPT\0" \
787 	"f\x00\x04"	"NUMDEVPERIOEPS\0"
788 
789 #define	USBC_HCFG_BITS \
790 	"\177"		/* new format */ \
791 	"\020"		/* hex display */ \
792 	"\020"		/* %016x format */ \
793 	"b\x02"		"FSLSSUPP\0" \
794 	"f\x00\x02"	"FSLSPCLKSEL\0"
795 
796 #define	USBC_HPRT_BITS \
797 	"\177"		/* new format */ \
798 	"\020"		/* hex display */ \
799 	"\020"		/* %016x format */ \
800 	"f\x11\x02"	"PRTSPD\0" \
801 	"f\x0d\x04"	"PRTTSTCTL\0" \
802 	"b\x0c"		"PRTPWR\0" \
803 	"f\x0a\x02"	"PRTLNSTS\0" \
804 	"b\x08"		"PRTRST\0" \
805 	"b\x07"		"PRTSUSP\0" \
806 	"b\x06"		"PRTRES\0" \
807 	"b\x05"		"PRTOVRCURRCHNG\0" \
808 	"b\x04"		"PRTOVRCURRACT\0" \
809 	"b\x03"		"PRTENCHNG\0" \
810 	"b\x02"		"PRTENA\0" \
811 	"b\x01"		"PRTCONNDET\0" \
812 	"b\x00"		"PRTCONNSTS\0"
813 
814 #define	USBC_HFIR_BITS \
815 	"\177"		/* new format */ \
816 	"\020"		/* hex display */ \
817 	"\020"		/* %016x format */ \
818 	"f\x00\x10"	"FRINT\0"
819 
820 #define	USBC_HAINT_BITS \
821 	"\177"		/* new format */ \
822 	"\020"		/* hex display */ \
823 	"\020"		/* %016x format */ \
824 	"b\x0f"		"HAINT_F\0" \
825 	"b\x0e"		"HAINT_E\0" \
826 	"b\x0d"		"HAINT_D\0" \
827 	"b\x0c"		"HAINT_C\0" \
828 	"b\x0b"		"HAINT_B\0" \
829 	"b\x0a"		"HAINT_A\0" \
830 	"b\x09"		"HAINT_9\0" \
831 	"b\x08"		"HAINT_8\0" \
832 	"b\x07"		"HAINT_7\0" \
833 	"b\x06"		"HAINT_6\0" \
834 	"b\x05"		"HAINT_5\0" \
835 	"b\x04"		"HAINT_4\0" \
836 	"b\x03"		"HAINT_3\0" \
837 	"b\x02"		"HAINT_2\0" \
838 	"b\x01"		"HAINT_1\0" \
839 	"b\x00"		"HAINT_0\0"
840 
841 #define	USBC_HAINTMSK_BITS \
842 	"\177"		/* new format */ \
843 	"\020"		/* hex display */ \
844 	"\020"		/* %016x format */ \
845 	"b\x0f"		"HAINTMSK_F\0" \
846 	"b\x0e"		"HAINTMSK_E\0" \
847 	"b\x0d"		"HAINTMSK_D\0" \
848 	"b\x0c"		"HAINTMSK_C\0" \
849 	"b\x0b"		"HAINTMSK_B\0" \
850 	"b\x0a"		"HAINTMSK_A\0" \
851 	"b\x09"		"HAINTMSK_9\0" \
852 	"b\x08"		"HAINTMSK_8\0" \
853 	"b\x07"		"HAINTMSK_7\0" \
854 	"b\x06"		"HAINTMSK_6\0" \
855 	"b\x05"		"HAINTMSK_5\0" \
856 	"b\x04"		"HAINTMSK_4\0" \
857 	"b\x03"		"HAINTMSK_3\0" \
858 	"b\x02"		"HAINTMSK_2\0" \
859 	"b\x01"		"HAINTMSK_1\0" \
860 	"b\x00"		"HAINTMSK_0\0"
861 
862 #define	USBC_HCINTX_BITS \
863 	"\177"		/* new format */ \
864 	"\020"		/* hex display */ \
865 	"\020"		/* %016x format */ \
866 	"b\x0a"		"DATATGLERR\0" \
867 	"b\x09"		"FRMOVRUN\0" \
868 	"b\x08"		"BBLERR\0" \
869 	"b\x07"		"XACTERR\0" \
870 	"b\x06"		"NYET\0" \
871 	"b\x05"		"ACK\0" \
872 	"b\x04"		"NAK\0" \
873 	"b\x03"		"STALL\0" \
874 	"b\x02"		"AHBERR\0" \
875 	"b\x01"		"CHHLTD\0" \
876 	"b\x00"		"XFERCOMPL\0"
877 #define USBC_HCINT0_BITS	USBC_HCINTX_BITS
878 #define USBC_HCINT1_BITS	USBC_HCINTX_BITS
879 #define USBC_HCINT2_BITS	USBC_HCINTX_BITS
880 #define USBC_HCINT3_BITS	USBC_HCINTX_BITS
881 #define USBC_HCINT4_BITS	USBC_HCINTX_BITS
882 #define USBC_HCINT5_BITS	USBC_HCINTX_BITS
883 #define USBC_HCINT6_BITS	USBC_HCINTX_BITS
884 #define USBC_HCINT7_BITS	USBC_HCINTX_BITS
885 
886 #define	USBC_HCINTMSKX_BITS \
887 	"\177"		/* new format */ \
888 	"\020"		/* hex display */ \
889 	"\020"		/* %016x format */ \
890 	"b\x0a"		"DATATGLERRMSK\0" \
891 	"b\x09"		"FRMOVRUNMSK\0" \
892 	"b\x08"		"BBLERRMSK\0" \
893 	"b\x07"		"XACTERRMSK\0" \
894 	"b\x06"		"NYETMSK\0" \
895 	"b\x05"		"ACKMSK\0" \
896 	"b\x04"		"NAKMSK\0" \
897 	"b\x03"		"STALLMSK\0" \
898 	"b\x02"		"AHBERRMSK\0" \
899 	"b\x01"		"CHHLTDMSK\0" \
900 	"b\x00"		"XFERCOMPLMSK\0"
901 #define USBC_HCINTMSK0_BITS	USBC_HCINTMSKX_BITS
902 #define USBC_HCINTMSK1_BITS	USBC_HCINTMSKX_BITS
903 #define USBC_HCINTMSK2_BITS	USBC_HCINTMSKX_BITS
904 #define USBC_HCINTMSK3_BITS	USBC_HCINTMSKX_BITS
905 #define USBC_HCINTMSK4_BITS	USBC_HCINTMSKX_BITS
906 #define USBC_HCINTMSK5_BITS	USBC_HCINTMSKX_BITS
907 #define USBC_HCINTMSK6_BITS	USBC_HCINTMSKX_BITS
908 #define USBC_HCINTMSK7_BITS	USBC_HCINTMSKX_BITS
909 
910 #define	USBC_HCCHARX_BITS \
911 	"\177"		/* new format */ \
912 	"\020"		/* hex display */ \
913 	"\020"		/* %016x format */ \
914 	"b\x1f"		"CHENA\0" \
915 	"b\x1e"		"CHDIS\0" \
916 	"b\x1d"		"ODDFRM\0" \
917 	"f\x16\x07"	"DEVADDR\0" \
918 	"f\x14\x02"	"EC\0" \
919 	"f\x12\x02"	"EPTYPE\0" \
920 	"b\x11"		"LSPDDEV\0" \
921 	"b\x0f"		"EPDIR\0" \
922 	"f\x0b\x04"	"EPNUM\0" \
923 	"f\x00\x0b"	"MPS\0"
924 #define USBC_HCCHAR0_BITS	USBC_HCCHARX_BITS
925 #define USBC_HCCHAR1_BITS	USBC_HCCHARX_BITS
926 #define USBC_HCCHAR2_BITS	USBC_HCCHARX_BITS
927 #define USBC_HCCHAR3_BITS	USBC_HCCHARX_BITS
928 #define USBC_HCCHAR4_BITS	USBC_HCCHARX_BITS
929 #define USBC_HCCHAR5_BITS	USBC_HCCHARX_BITS
930 #define USBC_HCCHAR6_BITS	USBC_HCCHARX_BITS
931 #define USBC_HCCHAR7_BITS	USBC_HCCHARX_BITS
932 
933 #define	USBC_HCTSIZX_BITS \
934 	"\177"		/* new format */ \
935 	"\020"		/* hex display */ \
936 	"\020"		/* %016x format */ \
937 	"b\x1f"		"DOPNG\0" \
938 	"f\x1d\x02"	"PID\0" \
939 	"f\x13\x0a"	"PKTCNT\0" \
940 	"f\x00\x13"	"XFERSIZE\0"
941 #define USBC_HCTSIZ0_BITS	USBC_HCTSIZX_BITS
942 #define USBC_HCTSIZ1_BITS	USBC_HCTSIZX_BITS
943 #define USBC_HCTSIZ2_BITS	USBC_HCTSIZX_BITS
944 #define USBC_HCTSIZ3_BITS	USBC_HCTSIZX_BITS
945 #define USBC_HCTSIZ4_BITS	USBC_HCTSIZX_BITS
946 #define USBC_HCTSIZ5_BITS	USBC_HCTSIZX_BITS
947 #define USBC_HCTSIZ6_BITS	USBC_HCTSIZX_BITS
948 #define USBC_HCTSIZ7_BITS	USBC_HCTSIZX_BITS
949 
950 /* ---- bus_space */
951 
952 #define	USBC_BASE				0x00016F0010000000ULL
953 #define USBC_SIZE				0x40020
954 
955 #define USBC_GOTGCTL_OFFSET			0x00000000
956 #define USBC_GOTGINT_OFFSET			0x00000004
957 #define USBC_GAHBCFG_OFFSET			0x00000008
958 #define USBC_GUSBCFG_OFFSET			0x0000000C
959 #define USBC_GRSTCTL_OFFSET			0x00000010
960 #define USBC_GINTSTS_OFFSET			0x00000014
961 #define USBC_GINTMSK_OFFSET			0x00000018
962 #define USBC_GRXSTSRH_OFFSET			0x0000001C
963 #define USBC_GRXSTSPH_OFFSET			0x00000020
964 #define USBC_GRXFSIZ_OFFSET			0x00000024
965 #define USBC_GNPTXFSIZ_OFFSET			0x00000028
966 #define USBC_GNPTXSTS_OFFSET			0x0000002C
967 #define USBC_GSNPSID_OFFSET			0x00000040
968 #define USBC_GHWCFG1_OFFSET			0x00000044
969 #define USBC_GHWCFG2_OFFSET			0x00000048
970 #define USBC_GHWCFG3_OFFSET			0x0000004C
971 #define USBC_GHWCFG4_OFFSET			0x00000050
972 #define USBC_HPTXFSIZ_OFFSET			0x00000100
973 #define USBC_DPTXFSIZ1_OFFSET			0x00000104
974 #define USBC_DPTXFSIZ2_OFFSET			0x00000108
975 #define USBC_DPTXFSIZ3_OFFSET			0x0000010C
976 #define USBC_DPTXFSIZ4_OFFSET			0x00000110
977 #define USBC_HCFG_OFFSET			0x00000400
978 #define USBC_HFIR_OFFSET			0x00000404
979 #define USBC_HFNUM_OFFSET			0x00000408
980 #define USBC_HPTXSTS_OFFSET			0x00000410
981 #define USBC_HAINT_OFFSET			0x00000414
982 #define USBC_HAINTMSK_OFFSET			0x00000418
983 #define USBC_HPRT_OFFSET			0x00000440
984 #define USBC_HCCHAR0_OFFSET			0x00000500
985 #define USBC_HCCHAR1_OFFSET			0x00000520
986 #define USBC_HCCHAR2_OFFSET			0x00000540
987 #define USBC_HCCHAR3_OFFSET			0x00000560
988 #define USBC_HCCHAR4_OFFSET			0x00000580
989 #define USBC_HCCHAR5_OFFSET			0x000005A0
990 #define USBC_HCCHAR6_OFFSET			0x000005C0
991 #define USBC_HCCHAR7_OFFSET			0x000005E0
992 #define USBC_HCSPLT0_OFFSET			0x00000504
993 #define USBC_HCSPLT1_OFFSET			0x00000524
994 #define USBC_HCSPLT2_OFFSET			0x00000544
995 #define USBC_HCSPLT3_OFFSET			0x00000564
996 #define USBC_HCSPLT4_OFFSET			0x00000584
997 #define USBC_HCSPLT5_OFFSET			0x000005A4
998 #define USBC_HCSPLT6_OFFSET			0x000005C4
999 #define USBC_HCSPLT7_OFFSET			0x000005E4
1000 #define USBC_HCINT0_OFFSET			0x00000508
1001 #define USBC_HCINT1_OFFSET			0x00000528
1002 #define USBC_HCINT2_OFFSET			0x00000548
1003 #define USBC_HCINT3_OFFSET			0x00000568
1004 #define USBC_HCINT4_OFFSET			0x00000588
1005 #define USBC_HCINT5_OFFSET			0x000005A8
1006 #define USBC_HCINT6_OFFSET			0x000005C8
1007 #define USBC_HCINT7_OFFSET			0x000005E8
1008 #define USBC_HCINTMSK0_OFFSET			0x0000050C
1009 #define USBC_HCINTMSK1_OFFSET			0x0000052C
1010 #define USBC_HCINTMSK2_OFFSET			0x0000054C
1011 #define USBC_HCINTMSK3_OFFSET			0x0000056C
1012 #define USBC_HCINTMSK4_OFFSET			0x0000058C
1013 #define USBC_HCINTMSK5_OFFSET			0x000005AC
1014 #define USBC_HCINTMSK6_OFFSET			0x000005CC
1015 #define USBC_HCINTMSK7_OFFSET			0x000005EC
1016 #define USBC_HCTSIZ0_OFFSET			0x00000510
1017 #define USBC_HCTSIZ1_OFFSET			0x00000530
1018 #define USBC_HCTSIZ2_OFFSET			0x00000550
1019 #define USBC_HCTSIZ3_OFFSET			0x00000570
1020 #define USBC_HCTSIZ4_OFFSET			0x00000590
1021 #define USBC_HCTSIZ5_OFFSET			0x000005B0
1022 #define USBC_HCTSIZ6_OFFSET			0x000005D0
1023 #define USBC_HCTSIZ7_OFFSET			0x000005F0
1024 #define USBC_DCFG_OFFSET			0x00000800
1025 #define USBC_DCTL_OFFSET			0x00000804
1026 #define USBC_DSTS_OFFSET			0x00000808
1027 #define USBC_DIEPMSK_OFFSET			0x00000810
1028 #define USBC_DOEPMSK_OFFSET			0x00000814
1029 #define USBC_DAINT_OFFSET			0x00000818
1030 #define USBC_DAINTMSK_OFFSET			0x0000081C
1031 #define USBC_DTKNQR1_OFFSET			0x00000820
1032 #define USBC_DTKNQR2_OFFSET			0x00000824
1033 #define USBC_DTKNQR3_OFFSET			0x00000830
1034 #define USBC_DTKNQR4_OFFSET			0x00000834
1035 #define USBC_DIEPCTL0_OFFSET			0x00000900
1036 #define USBC_DIEPCTL1_OFFSET			0x00000920
1037 #define USBC_DIEPCTL2_OFFSET			0x00000940
1038 #define USBC_DIEPCTL3_OFFSET			0x00000960
1039 #define USBC_DIEPCTL4_OFFSET			0x00000980
1040 #define USBC_DIEPINT0_OFFSET			0x00000908
1041 #define USBC_DIEPINT1_OFFSET			0x00000928
1042 #define USBC_DIEPINT2_OFFSET			0x00000948
1043 #define USBC_DIEPINT3_OFFSET			0x00000968
1044 #define USBC_DIEPINT4_OFFSET			0x00000988
1045 #define USBC_DIEPTSIZ0_OFFSET			0x00000910
1046 #define USBC_DIEPTSIZ1_OFFSET			0x00000930
1047 #define USBC_DIEPTSIZ2_OFFSET			0x00000950
1048 #define USBC_DIEPTSIZ3_OFFSET			0x00000970
1049 #define USBC_DIEPTSIZ4_OFFSET			0x00000990
1050 #define USBC_OEPCTL0_OFFSET			0x00000B00
1051 #define USBC_OEPCTL1_OFFSET			0x00000B20
1052 #define USBC_OEPCTL2_OFFSET			0x00000B40
1053 #define USBC_OEPCTL3_OFFSET			0x00000B60
1054 #define USBC_OEPCTL4_OFFSET			0x00000B80
1055 #define USBC_OEPINT0_OFFSET			0x00000B08
1056 #define USBC_OEPINT1_OFFSET			0x00000B28
1057 #define USBC_OEPINT2_OFFSET			0x00000B48
1058 #define USBC_OEPINT3_OFFSET			0x00000B68
1059 #define USBC_OEPINT4_OFFSET			0x00000B88
1060 #define USBC_OEPTSIZ0_OFFSET			0x00000B10
1061 #define USBC_OEPTSIZ1_OFFSET			0x00000B30
1062 #define USBC_OEPTSIZ2_OFFSET			0x00000B50
1063 #define USBC_OEPTSIZ3_OFFSET			0x00000B70
1064 #define USBC_OEPTSIZ4_OFFSET			0x00000B90
1065 #define USBC_PCGCCTL_OFFSET			0x00000E00
1066 #define USBC_NPTXDFIFO0_OFFSET			0x00001000
1067 #define USBC_NPTXDFIFO1_OFFSET			0x00002000
1068 #define USBC_NPTXDFIFO2_OFFSET			0x00003000
1069 #define USBC_NPTXDFIFO3_OFFSET			0x00004000
1070 #define USBC_NPTXDFIFO4_OFFSET			0x00005000
1071 #define USBC_NPTXDFIFO5_OFFSET			0x00006000
1072 #define USBC_NPTXDFIFO6_OFFSET			0x00007000
1073 #define USBC_NPTXDFIFO7_OFFSET			0x00008000
1074 #define USBC_GRXSTSRD_OFFSET			0x0004001C
1075 #define USBC_GRXSTSPD_OFFSET			0x00040020
1076 
1077 #endif /* _OCTEON_USBCREG_H_ */
1078