Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2003 22:44:10 -0500
From:      Craig Boston <craig@xfoil.gank.org>
To:        ticso@cicely.de, Bernd Walter <ticso@cicely12.cicely.de>, Josef Karthauser <joe@FreeBSD.org>, current@FreeBSD.org
Subject:   *IT WORKS* Re: CardBus USB 2.0 Controller (NEC uPD)
Message-ID:  <200306112244.10466.craig@xfoil.gank.org>
In-Reply-To: <20030612002139.GT26807@cicely12.cicely.de>
References:  <1055260269.91337.127.camel@owen1492.uf.corelab.com> <20030611224538.GB10822@genius.tao.org.uk> <20030612002139.GT26807@cicely12.cicely.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-00=_Kc/5+7lnpPHlV+x
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Believe it or not, after futzing with the debugger for hours, reading the OHCI 
spec, and trying to figure out why writing to the control registers works 
exactly as it should but the card seems to ignore the ED list, I decided to 
try something completely crazy and put the line

pci_enable_busmaster(self);

near the top of ohci_attach() in ohci_pci.c

...and it worked!  I believe my first words upon seeing "ums0: <blah blah>" 
were "You have GOT to be kidding me."

My logic was that since the driver allocates a DMA buffer in main memory that 
the card is supposed to read/write to, maybe cardbus cards have additional 
restrictions on what parts of system RAM they can touch and might have to use 
bus mastering to do it.  I don't know if that's a valid assumption or not, 
but in any case the driver functions perfectly with every USB 1.1 and 2.0 
(put the same line in ehci_pci.c) device I've tried so far.

My USB 2.0 hard drive enclosure is getting around 8MB/s for reads and 7MB/s 
for writes.  I don't know if that's good or not, or even what the physical 
limitations of the drive I have in there are, but it's still much improved 
from the ~ 800KB/s I was getting using in compatibility mode on the built-in 
USB port.

I'm attaching a (trivial) patch for the lazy :)  Be advised, this is far from 
a general solution as it probably breaks some (many?) PCI-based controllers 
that don't support bus mastering.

Craig

--Boundary-00=_Kc/5+7lnpPHlV+x--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306112244.10466.craig>