USB HCD driver
Greg KH
gregkh at linuxfoundation.org
Mon Jun 4 18:53:33 EDT 2012
On Sun, Jun 03, 2012 at 11:19:36PM +0100, Theo Markettos wrote:
> On Sun, Jun 03, 2012 at 02:08:27PM -0700, Greg KH wrote:
> > I know a bit about USB :)
> >
> > I thought that I applied some patches recently that showed up in 3.5-rc1
> > that should work for this hardware, have you checked there to see if
> > that really is true or not?
>
> I know a bit about USB on BCM2835 ;-)
>
> I believe there are drivers for Synopsys' USB3 IP ('dwc') in Linux, and I
> think there's also a DWC_OTG (USB2) device controller driver kicking around
> somewhere, but I'm not aware of any clean DWC_OTG host controller drivers
> around.
Hm, I merged some Samsung code that I thought was for a dwc "core" a few
weeks ago, it's in the drivers/usb/gadget/s3c* files. It said it is for
a OTG controller, so perhaps it's the same core in use here as well?
> > And if not, where would a good place for me to start be?
>
> There's a driver called dotg in FreeBSD, which supports the DWC_OTG but only
> in USB2 high speed mode (ie keyboards and mice which use USB1.1 full speed
> won't work). Isochronous support is also lacking. However expanding that
> might not be so hard. It's an awful lot simpler than the Synopsys code -
> about 90KB, vs 40kloc. It's mostly been used on various types of MIPS
> routers (using RT3052, Octeon CN5010) so there might also be some
> endian-ness issues in there. [FreeBSD also has a 'dwc_otg' driver but it's
> device mode only].
>
> My interest is that I've been coordinating a port of RISC OS to the BCM2835,
> and have faced very similar problems. Someone has ported the Synopsys code,
> which I have yet to test but took surprisingly little time. (RISC OS uses
> the NetBSD USB stack). Performance remains to be seen.
>
> > Oh, and why no documentation on the hardware, I thought we had it around
> > here somewhere?
>
> The documentation is Synopsys-private. Only people with certain types of
> Synopsys SolvNet accounts can see it (there are few around). However the
> Ralink RT3050 uses the same core, and there's a register map in the
> datasheet:
> http://www.tracermcc.ru/foto/bender/RT3050_5x_V2.0_081408_0902.pdf
> AFAICS it doesn't look much like EHCI, but I'm not so familiar with that.
Without any open specs, I really can't work on the code, unfortunately :(
How hard can Broadcom lean on people to get this opened up so that we
can get working code?
Well, there seems to be "something" working today, as my board tends to
work, or is this the driver you have given up on cleaning up properly?
> One issue that's been reported is 8000 interrupts per second, even in idle
> mode. According to Jeffrey our driver porter, the Synopsys driver relies on
> the start of frame interrupt for scheduling transfers if "descriptor DMA" is
> not implemented (which it isn't, on BCM2835). 8000 is one interrupt per
> microframe. We have a couple of ideas for that: one is to somehow disable
> the interrupt if nothing interesting is happening. The other is to wire it
> into a FIQ (which the BCM2835 interrupt controller will let you do). That
> gives a much lower interrupt latency for dealing with unwanted interrupts.
> I understand Linux doesn't really use FIQs, which is unfortunate, but
> perhaps could be implemented for purposes such as this.
What is a "FIQ"?
One interrupt per microframe seems crazy, it's as if the hardware
designers never learned from the past when we used to have problems like
this with the very old UHCI controllers. Surely they couldn't have been
that foolish?
Determining if nothing "interesting" is going on isn't usually that
difficult, but lots of devices just send empty data all the time, and
don't like going into autosuspend mode (like mice and keyboards), so
implementing that type of logic can be tough to try to explain to users
why their keystrokes are getting lost.
ugh, what a mess,
greg k-h
More information about the linux-rpi-kernel
mailing list