USB HCD driver

Theo Markettos linux-rpi at markettos.org.uk
Sun Jun 3 18:19:36 EDT 2012


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.

> 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.

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.

Theo

-- 
Computer Laboratory, University of Cambridge



More information about the linux-rpi-kernel mailing list