xref: /freebsd/sys/dev/usb/controller/uhcireg.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
11def609aSAndrew Thompson /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
41def609aSAndrew Thompson  * Copyright (c) 1998 The NetBSD Foundation, Inc.
51def609aSAndrew Thompson  * All rights reserved.
61def609aSAndrew Thompson  *
71def609aSAndrew Thompson  * This code is derived from software contributed to The NetBSD Foundation
81def609aSAndrew Thompson  * by Lennart Augustsson (lennart@augustsson.net) at
91def609aSAndrew Thompson  * Carlstedt Research & Technology.
101def609aSAndrew Thompson  *
111def609aSAndrew Thompson  * Redistribution and use in source and binary forms, with or without
121def609aSAndrew Thompson  * modification, are permitted provided that the following conditions
131def609aSAndrew Thompson  * are met:
141def609aSAndrew Thompson  * 1. Redistributions of source code must retain the above copyright
151def609aSAndrew Thompson  *    notice, this list of conditions and the following disclaimer.
161def609aSAndrew Thompson  * 2. Redistributions in binary form must reproduce the above copyright
171def609aSAndrew Thompson  *    notice, this list of conditions and the following disclaimer in the
181def609aSAndrew Thompson  *    documentation and/or other materials provided with the distribution.
191def609aSAndrew Thompson  *
201def609aSAndrew Thompson  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
211def609aSAndrew Thompson  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
221def609aSAndrew Thompson  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
231def609aSAndrew Thompson  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
241def609aSAndrew Thompson  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
251def609aSAndrew Thompson  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
261def609aSAndrew Thompson  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
271def609aSAndrew Thompson  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
281def609aSAndrew Thompson  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
291def609aSAndrew Thompson  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
301def609aSAndrew Thompson  * POSSIBILITY OF SUCH DAMAGE.
311def609aSAndrew Thompson  */
321def609aSAndrew Thompson 
331def609aSAndrew Thompson #ifndef _UHCIREG_H_
341def609aSAndrew Thompson #define	_UHCIREG_H_
351def609aSAndrew Thompson 
36e6af527cSAndrew Thompson #define	PCI_UHCI_BASE_REG	0x20
37e6af527cSAndrew Thompson 
381def609aSAndrew Thompson /* PCI config registers  */
391def609aSAndrew Thompson #define	PCI_USBREV		0x60	/* USB protocol revision */
401def609aSAndrew Thompson #define	PCI_USB_REV_MASK		0xff
411def609aSAndrew Thompson #define	PCI_USB_REV_PRE_1_0	0x00
421def609aSAndrew Thompson #define	PCI_USB_REV_1_0		0x10
431def609aSAndrew Thompson #define	PCI_USB_REV_1_1		0x11
441def609aSAndrew Thompson #define	PCI_LEGSUP		0xc0	/* Legacy Support register */
451def609aSAndrew Thompson #define	PCI_LEGSUP_USBPIRQDEN	0x2000	/* USB PIRQ D Enable */
461def609aSAndrew Thompson #define	PCI_CBIO		0x20	/* configuration base IO */
471def609aSAndrew Thompson #define	PCI_INTERFACE_UHCI	0x00
481def609aSAndrew Thompson 
491def609aSAndrew Thompson /* UHCI registers */
501def609aSAndrew Thompson #define	UHCI_CMD		0x00
511def609aSAndrew Thompson #define	UHCI_CMD_RS		0x0001
521def609aSAndrew Thompson #define	UHCI_CMD_HCRESET	0x0002
531def609aSAndrew Thompson #define	UHCI_CMD_GRESET		0x0004
541def609aSAndrew Thompson #define	UHCI_CMD_EGSM		0x0008
551def609aSAndrew Thompson #define	UHCI_CMD_FGR		0x0010
561def609aSAndrew Thompson #define	UHCI_CMD_SWDBG		0x0020
571def609aSAndrew Thompson #define	UHCI_CMD_CF		0x0040
581def609aSAndrew Thompson #define	UHCI_CMD_MAXP		0x0080
591def609aSAndrew Thompson #define	UHCI_STS		0x02
601def609aSAndrew Thompson #define	UHCI_STS_USBINT		0x0001
611def609aSAndrew Thompson #define	UHCI_STS_USBEI		0x0002
621def609aSAndrew Thompson #define	UHCI_STS_RD		0x0004
631def609aSAndrew Thompson #define	UHCI_STS_HSE		0x0008
641def609aSAndrew Thompson #define	UHCI_STS_HCPE		0x0010
651def609aSAndrew Thompson #define	UHCI_STS_HCH		0x0020
661def609aSAndrew Thompson #define	UHCI_STS_ALLINTRS	0x003f
671def609aSAndrew Thompson #define	UHCI_INTR		0x04
681def609aSAndrew Thompson #define	UHCI_INTR_TOCRCIE	0x0001
691def609aSAndrew Thompson #define	UHCI_INTR_RIE		0x0002
701def609aSAndrew Thompson #define	UHCI_INTR_IOCE		0x0004
711def609aSAndrew Thompson #define	UHCI_INTR_SPIE		0x0008
721def609aSAndrew Thompson #define	UHCI_FRNUM		0x06
731def609aSAndrew Thompson #define	UHCI_FRNUM_MASK		0x03ff
741def609aSAndrew Thompson #define	UHCI_FLBASEADDR		0x08
751def609aSAndrew Thompson #define	UHCI_SOF		0x0c
761def609aSAndrew Thompson #define	UHCI_SOF_MASK		0x7f
771def609aSAndrew Thompson #define	UHCI_PORTSC1      	0x010
781def609aSAndrew Thompson #define	UHCI_PORTSC2      	0x012
791def609aSAndrew Thompson #define	UHCI_PORTSC_CCS		0x0001
801def609aSAndrew Thompson #define	UHCI_PORTSC_CSC		0x0002
811def609aSAndrew Thompson #define	UHCI_PORTSC_PE		0x0004
821def609aSAndrew Thompson #define	UHCI_PORTSC_POEDC	0x0008
831def609aSAndrew Thompson #define	UHCI_PORTSC_LS		0x0030
841def609aSAndrew Thompson #define	UHCI_PORTSC_LS_SHIFT	4
851def609aSAndrew Thompson #define	UHCI_PORTSC_RD		0x0040
861def609aSAndrew Thompson #define	UHCI_PORTSC_LSDA	0x0100
871def609aSAndrew Thompson #define	UHCI_PORTSC_PR		0x0200
881def609aSAndrew Thompson #define	UHCI_PORTSC_OCI		0x0400
891def609aSAndrew Thompson #define	UHCI_PORTSC_OCIC	0x0800
901def609aSAndrew Thompson #define	UHCI_PORTSC_SUSP	0x1000
911def609aSAndrew Thompson 
921def609aSAndrew Thompson #define	URWMASK(x)		((x) & (UHCI_PORTSC_SUSP |		\
931def609aSAndrew Thompson 				UHCI_PORTSC_PR | UHCI_PORTSC_RD |	\
941def609aSAndrew Thompson 				UHCI_PORTSC_PE))
951def609aSAndrew Thompson 
961def609aSAndrew Thompson #endif	/* _UHCIREG_H_ */
97