Commit Graph

158 Commits

Author SHA1 Message Date
Rafal Jaworowski
c49504be41 Import EHCI attachment driver for Freescale integrated controller.
Obtained from:	Freescale, Semihalf.
Written by:	Michal Dubiel
2012-05-26 21:05:11 +00:00
Marius Strobl
243d601f05 Make the VIA workaround application somewhat more consistent with the
ATI one.
2012-05-26 08:43:51 +00:00
Marius Strobl
7e543a0ed3 Make the VIA workaround actually do its intended job.
MFC after:	3 days
2012-05-26 08:31:12 +00:00
Hans Petter Selasky
7e66ab7cb6 Make sure the EHCI bandwidth allocation algorithm
for FULL speed SPLIT transactions works fully.

MFC after:	1 week
2012-05-03 16:06:22 +00:00
Hans Petter Selasky
0a4cc48fe5 Add support for Multi-TT mode of modern USB HUBs.
This will give you more bandwidth for isochronous
FULL speed applications connected through a
High Speed HUB.

This patch has been tested with XHCI and EHCI.

MFC after:	1 week
2012-04-29 17:12:33 +00:00
Hans Petter Selasky
6d917491f5 Fix compiler warnings, mostly signed issues,
when USB modules are compiled with WARNS=9.

MFC after:	1 weeks
2012-04-02 10:50:42 +00:00
Hans Petter Selasky
0b8de86913 Fix for DWC OTG interrupt register programming.
Fix a compiler warning.
Add missing header file.

MFC after:	1 week
2012-03-05 06:41:44 +00:00
Hans Petter Selasky
02f728afc9 Make sure that the USB system suspend event is executed synchronously
and not asynchronously. This fixes problems related to USB system
suspend and resume.  It is assumed that we are always allowed to sleep
from the device_suspend() method.

MFC after:	1 week
Submitted by:	jkim
2012-03-03 08:11:04 +00:00
Hans Petter Selasky
dd03e19c08 Add support for the DesignWare USB 2.0 OTG controller chipset.
Currently the code is not built by any modules. That will
be fixed later. The Atmel ARM bus interface file part of this
commit is just for sake of example. All registers and bits are
declared like macros and not C-structures like in official
Synopsis header files. This driver mostly origins from the
musb_otg.c driver in FreeBSD except that the chip specific
programming has been replaced by the one for DWC 2.0 USB OTG.
Some parts related to system suspend and resume have been left
like empty functions for the future. USB suspend and resume is
fully supported.
2012-01-21 13:31:38 +00:00
Hans Petter Selasky
e02f894bbe Bugfix: Make sure the XHCI driver doesn't clear
the route string field. Else USB 3.0 HUBs
won't work.

MFC after:	5 days
2012-01-13 22:19:14 +00:00
Hans Petter Selasky
99b0e60766 Correct use of USB 3.0 POWER bit in the port status register,
hence it was overlapping the USB 3.0 root HUB's speed bits.

Reported by:	Kohji Okuno
MFC after:	1 week
2012-01-13 07:28:34 +00:00
Hans Petter Selasky
4131f6fb60 - Try to fix support for USB 3.0 HUBs.
- Try to fix support for USB 3.0 suspend and resume.

MFC after:	1 week
2012-01-12 21:21:20 +00:00
Hans Petter Selasky
6bbe7cdfb2 Make sure we probe and attach the root HUB after
resume else no devices will appear again.

MFC after:	1 day
2012-01-02 20:28:33 +00:00
Hans Petter Selasky
c2d0465a9b Add missing change to XHCI driver similar to changes in r228483.
MFC after:	0 days
2011-12-31 13:34:42 +00:00
Oleksandr Tymoshenko
d42cc94633 - Enable usbus on octusb 2011-12-24 00:22:21 +00:00
Hans Petter Selasky
d63cc02d7a Make the recently added "no_shutdown_wait" sysctl writeable.
Suggested by:	avg @
MFC after:	3 days
2011-12-19 23:39:08 +00:00
Hans Petter Selasky
5ed294aec0 Add code to wait for USB shutdown to be executed at system shutdown.
Add sysctl which can be used to skip this waiting.

MFC after:	3 days
2011-12-19 15:35:05 +00:00
Hans Petter Selasky
6bd3e53514 Add missing unlock of USB controller's lock, when
doing shutdown, suspend and resume.

Suggested by:	avg @
MFC after:	3 days
2011-12-19 14:53:42 +00:00
Hans Petter Selasky
5f63a5d203 Fix definition of XHCI port power bit.
Reported by:	Kohji Okuno
MFC after:	3 days
2011-12-14 08:44:16 +00:00
Hans Petter Selasky
2e14174893 Implement better support for USB controller suspend and resume.
This patch should remove the need for kldunload of USB
controller drivers at suspend and kldload of USB controller
drivers at resume.

This patch also fixes some build issues in avr32dci.c

MFC after:	2 weeks
2011-12-14 00:28:54 +00:00
Hans Petter Selasky
3b12bdb58f Rename device_delete_all_children() into device_delete_children().
Suggested by:	jhb @ and marius @
MFC after:	1 week
2011-11-22 21:56:55 +00:00
Marius Strobl
4b7ec27007 - There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.
2011-11-22 21:28:20 +00:00
Hans Petter Selasky
8c09f3a15f Make some XHCI command timeouts less strict.
Reported by:	Jan Henrik Sylvester
MFC after:	1 week
2011-11-18 08:31:24 +00:00
Hans Petter Selasky
96ef942084 Some brands of XHCI controllers needs more time to reset.
Reported by:	Jan Henrik Sylvester
MFC after:	1 week
2011-11-15 20:48:57 +00:00
Hans Petter Selasky
271ae033e9 Style change.
- Make it easier to port the USB code to other platforms by only using
one set of memory functions for clearing and copying memory. None of
the memory copies are overlapping. This means using bcopy() is not
required.
- Fix a compile warning when USB_HAVE_BUSDMA=0
- Add missing semicolon in avr32dci.
- Update some comments.

MFC after:	1 week
2011-11-12 08:16:45 +00:00
Hans Petter Selasky
b3b1747a98 Fix size of USB 3.0 descriptor field.
MFC after:	3 days
2011-11-09 18:48:36 +00:00
Hans Petter Selasky
c089ba5ed7 Fix size of USB 3.0 descriptor field.
MFC after:	3 days
2011-11-09 18:11:29 +00:00
Ed Schouten
6472ac3d8a Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.
The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.
2011-11-07 15:43:11 +00:00
Hans Petter Selasky
3d09c7b327 Fix suspend and resume of FULL and HIGH speed USB devices
in the generic XHCI driver. There appears to be some minor
logic missing for this feature to work.

MFC after:	3 days
2011-10-26 17:43:27 +00:00
Ruslan Ermilov
934d7bccdb Renamed PCI_INTERFACE_XHCI to PCIP_SERIALBUS_USB_XHCI and moved it
to <dev/pci/pcireg.h>.

Reviewed by:	hselasky
MFC after:	3 days
2011-05-17 11:23:43 +00:00
Hans Petter Selasky
ea719ede02 Fix for missing EHCI datatoggle change case.
Reported by:	Mike Tancsa
MFC after:	3 days
Approved by:	thompsa (mentor)
2011-04-26 18:50:35 +00:00
Hans Petter Selasky
b0a5e05f62 We don't need to call EOWRITE4(sc, EHCI_USBINTR, 0) directly from each EHCI
bus driver at detach, hence ehci_detach() does exactly this since r199718.

Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-12 07:49:11 +00:00
Hans Petter Selasky
3ea3537594 - Correct EHCI interrupt disabling at detach.
Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:17:49 +00:00
Hans Petter Selasky
46873d15b1 Fix initialisation order with regard to debug prints.
Reported by:	Luiz Otavio O Souza
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-25 10:11:21 +00:00
Hans Petter Selasky
996c27355c Fix typo.
Reported by:	Garrett Cooper
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-24 07:59:21 +00:00
Hans Petter Selasky
ca794e7847 Comply with style(9).
Reported by:	gavin
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-23 19:41:44 +00:00
Hans Petter Selasky
dbe63d3a27 - Bugfix: Fix a EHCI hardware race, where the hardware computed data toggle
value is updated after that we read it in the queue-head. This patch can
fix problems with BULK timeouts. The issue was found on a Nvidia chipset.

MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-21 21:16:25 +00:00
Hans Petter Selasky
ccac019af4 - Correct USB 3.0 wire-speed to 5.0Gbps
MFC after:	3 days
Approved by:	thompsa (mentor)
2011-02-26 09:28:52 +00:00
Hans Petter Selasky
8833442863 Minor cleanup:
- use device_printf() instead of printf() to give more accurate warnings.
 - use memcpy() instead of bcopy().
 - add missing #if's for non-FreeBSD compilation.

Approved by:	thompsa (mentor)
2011-02-09 08:01:45 +00:00
Marcel Moolenaar
6a9f4949fb Improve the error interrupt handler. In particular, read the
error address on a decoding error to unlatch it and to allow
us to print a better diagnostics message. This also has the
side effect of clearing the condition, which prevents an
interrupt storm.
2011-02-08 22:16:29 +00:00
Hans Petter Selasky
8be0933446 Make USB packet filtering code optional.
Approved by:	thompsa (mentor)
2011-01-18 21:18:51 +00:00
Hans Petter Selasky
c1338c65d6 - Add support for 64-byte contexts to XHCI driver.
- Remove some dead code.
- Fixed one instance of missing endian conversion.

Approved by:	thompsa (mentor)
2011-01-13 20:03:55 +00:00
John Baldwin
58ccf5b41c Remove unneeded includes of <sys/linker_set.h>. Other headers that use
it internally contain nested includes.

Reviewed by:	bde
2011-01-11 13:59:06 +00:00
John Baldwin
c305730dc0 Remove bogus usage of INTR_FAST. "Fast" interrupts are now indicated by
registering a filter handler rather than a threaded handler.  Also remove
a bogus use of INTR_MPSAFE for a filter.
2011-01-06 21:08:06 +00:00
Weongyo Jeong
b443638277 Removes a unused function `usb_bus_find'. 2010-11-25 22:56:26 +00:00
Weongyo Jeong
fe1c24e3d6 Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load /
unloaded repeatly.  Attaching the USB pf is moved to usbus device's
attach.

Pointed by:	yongari
2010-11-25 03:30:43 +00:00
Weongyo Jeong
e376f9c3e7 Removes all duplicated code with BPF that it's greatly simplified and
take all benefits whenever BPF code is improved.

Pointed by:	jkim
Reviewed by:	thompsa
2010-11-24 19:11:32 +00:00
Weongyo Jeong
18ec652552 Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers.  Its implementations
are almost based on BPF code and very similar with it except it's
little bit customized for USB packet only.  The userland program
usbdump(8) would be committed soon.

Discussed with:	hps, thompsa, yongari
2010-11-22 01:11:28 +00:00
Nathan Whitehorn
495ed64c16 The EHCI_CAPLENGTH and EHCI_HCIVERSION registers are actually sub-registers
within the first 4 bytes of the EHCI memory space. For controllers that
use big-endian MMIO, reading them with 1- and 2-byte reads would then
return the wrong values. Instead, read the combined register with a 4-byte
read and mask out the interesting quantities.
2010-10-25 15:51:43 +00:00
Hans Petter Selasky
f7d8cf85e3 Remove unused EHCI register definition.
Define reserved EHCI register.

Approved by:    thompsa (mentor)
2010-10-14 21:41:08 +00:00