9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] question on implementation of uhci host controller driver
@ 2006-03-18  4:21 Lonnie Mendez
  2006-03-18  7:50 ` Charles Forsyth
  0 siblings, 1 reply; 8+ messages in thread
From: Lonnie Mendez @ 2006-03-18  4:21 UTC (permalink / raw)
  To: 9fans

Hello list.

While debugging plan 9's uhci usb stack in qemu I noticed that it
immediately issues a USBCMD command to Stop(0) the controller and then
expects hchalted bit in USBSTS to be set. Is this the proper thing to
do? No other stack I've seen seems to rely on this and it seems that
when they do it's after the uhci controller framing has been started.

Here is the beginning output from the qemu logs (port is the base I/O
register offset, 0x0000 is USBCMD, 0x0002 is USBSTS):
uhci writew port=0x0000 val=0x0000
uhci readw port=0x0002 val=0x0000
uhci readw port=0x0002 val=0x0000
uhci readw port=0x0002 val=0x0000
uhci readw port=0x0002 val=0x0000
<snipped - infinite loop ouput>

 From plan 9's uhci stack source:
http://cm.bell-labs.com/sources/plan9/sys/src/9/pc/usbuhci.c

from middle of function reset(Usbhost *uh)

OUT(Cmd, 0); /* stop */
while((IN(Status) & (1<<5)) == 0) /* wait for halt */

The UHCI specification when referencing setting the hchalt bit always
mentions doing this if the "transaction" has finished/completed.
Wouldn't that imply the R/S bit had been set previously?  Is this a
compliant operation or something I don't understand?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-20 15:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-18  4:21 [9fans] question on implementation of uhci host controller driver Lonnie Mendez
2006-03-18  7:50 ` Charles Forsyth
2006-03-18  8:08   ` Lonnie Mendez
2006-03-18  8:16     ` Charles Forsyth
2006-03-18  8:46       ` Lonnie Mendez
2006-03-18  8:53         ` Charles Forsyth
2006-03-18 19:53           ` Lonnie Mendez
2006-03-20 15:55   ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).