Subject: Does uhci work on macppc/big-endian?
To: None <port-macppc@netbsd.org>
From: Dave Huang <khym@azeotrope.org>
List: port-macppc
Date: 03/02/2006 19:15:28
I bought a cheap USB 2.0 PCI card (a Kingwin U2PCI-5), hoping to use
it on my Powermac G4 dual proc... however, while it attaches fine,
NetBSD says "device problem, disabling port n" whenever I plug in a
USB device.

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 3.99.15 (GREYFOX) #13: Wed Mar  1 20:40:44 CST 2006
	khym@greyfox.azeotrope.org:/usr/obj.macppc/sys/arch/macppc/compile/GREYFOX
[ ... ]
uhci0 at pci2 dev 4 function 0: VIA Technologies VT83C572 USB Controller (rev. 0x61)
uhci0: interrupting at irq 54
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci2 dev 4 function 1: VIA Technologies VT83C572 USB Controller (rev. 0x61)
uhci1: interrupting at irq 54
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ehci0 at pci2 dev 4 function 2: VIA Technologies VT8237 EHCI USB Controller (rev. 0x63)
ehci0: interrupting at irq 54
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1
usb2 at ehci0: USB revision 2.0
uhub2 at usb2
uhub2: VIA Technologies EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub2: 4 ports with 4 removable, self powered
[ ... ]

When plugging in a mouse:

ehci0: handing over low speed device on port 3 to uhci1
uhub2: port 3, device disappeared after reset
uhub1: device problem, disabling port 1

Unplugged the mouse and plugged it into a different port:

ehci0: handing over low speed device on port 2 to uhci0
uhub2: port 2, device disappeared after reset
uhub0: device problem, disabling port 2

Plugged a USB 2.0 scanner into another port:

uhub2: device problem, disabling port 4

I notice that the checkin comment for uhci.c 1.39 is "A first stab at
making the UHCI driver endian independent. (It doesn't seem to be
quite working yet.)" Then Izumi Tsutsui posted a patch
<http://www.jp.netbsd.org/ja/JP/ml/port-powerpc-ja/200003/msg00029.html>,
which seems to have been checked in as revision 1.88 "Replace LE()
macro with le32toh()/le32toh()." That patch did add a few le32toh()s
where there was no LE() (mainly in DEBUG code), but it's mostly as the
checkin comment says.

So, does anyone know the status of uhci on big-endian machines? Still
not quite working yet? Anything I can do to help get it working?

(FWIW, I'm actually more interested in using the card under MacOS X,
however my USB 2.0 scanner doesn't seem to work. System Profiler shows
it connected, but the scanner driver hangs. A mouse works fine
though... so I wanted to see if NetBSD was able to do anything with
it.)
-- 
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym@azeotrope.org |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 30 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++